syntax = "proto3";

package gosdn.configurationmanagement;

import "google/api/annotations.proto";
import "gosdn/pnd/pnd.proto";

option go_package = "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/core";

// The ConfigurationManagementService allows to access configurations
service ConfigurationManagementService{
// Allows for export of the whole SDN configuration
rpc ExportSDNConfig(ExportSDNConfigRequest) returns (ExportSDNConfigResponse) {
    option (google.api.http) = {
      get: "/export/{pid}"
    };
  }
// Allows for import of the whole SDN configuration
rpc ImportSDNConfig(ImportSDNConfigRequest) returns (ImportSDNConfigResponse) {
    option (google.api.http) = {
      post: "/import/{pid}"
    };
  }
}

message ExportSDNConfigRequest {
  int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
  string pid = 2;
}

message ExportSDNConfigResponse {
  int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
  string sdnConfigData = 2;
  Status status = 3;
}

message ImportSDNConfigRequest {
  int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
  string pid = 2;
  string sdnConfigData = 3;
}

message ImportSDNConfigResponse {
  int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
  Status status = 2;
}

enum Status {
    STATUS_UNSPECIFIED = 0;
    STATUS_OK = 1;
    STATUS_ERROR = 2;
}
