Skip to content
Snippets Groups Projects
pnd.proto 9.35 KiB
Newer Older
  • Learn to ignore specific revisions
  • syntax = "proto3";
    
    package gosdn.pnd.v1alpha;
    
    import "google/api/annotations.proto";
    //import "protoc-gen-openapiv2/options/annotations.proto";
    import "google/protobuf/descriptor.proto";
    import "github.com/openconfig/gnmi/proto/gnmi/gnmi.proto";
    
    import "gosdn/transport/transport.proto";
    import "gosdn/southbound/southbound.proto";
    
    import "protoc-gen-openapiv2/options/annotations.proto";
    
    option go_package = "code.fbi.h-da.de/danet/api/go/gosdn/pnd";
    
    option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
    	info: {
    		title: "goSDN Northbound";
        description: "Protocol Buffer specifications and Go code for the goSDN northbound Interface"
    		version: "0.1";
    		contact: {
    			name: "goSDN Northbound project";
    			url: "https://code.fbi.h-da.de/danet/api";
    			//email: "none@example.com";
    		};
    		license: {
    			name: "BSD 3-Clause License";
    			url: "https://code.fbi.h-da.de/danet/api/-/blob/master/LICENSE";
    		};
      };
    };
    
    service PndService {
      // Allows to request Orchestrated Networking Devices which are managed by a
      // specific Principal Network Domain.
      rpc GetOndList(GetOndListRequest) returns (GetOndListResponse) {
        option (google.api.http) = {
          get: "/v1/pnds/{pid}/onds"
        };
      }
      rpc GetOnd(GetOndRequest) returns (GetOndResponse) {
        option (google.api.http) = {
          get: "/v1/pnds/{pid}/ond/{did}"
        };
      }
      rpc SetOndList(SetOndListRequest) returns (SetOndListResponse) {
        option (google.api.http) = {
          post: "/v1/pnds/{pid}/onds"
          body: "*"
        };
      }
      // Allows to request the Southbound Interfaces a specific Principal Network
      // Domain supports.
      rpc GetSbiList(GetSbiListRequest) returns (GetSbiListResponse) {
        option (google.api.http) = {
          get: "/v1/pnds/{pid}/sbis"
        };
      }
      rpc GetSbi(GetSbiRequest) returns (GetSbiResponse) {
        option (google.api.http) = {
          get: "/v1/pnds/{pid}/sbis/{sid}"
        };
      }
      rpc SetSbiList(SetSbiListRequest) returns (SetSbiListResponse) {
        option (google.api.http) = {
          post: "/v1/pnds/{pid}/sbis"
          body: "*"
        };
      }
      // Allows to request Changes registered for a specific Principal Network Domain.
      rpc GetChangeList(GetChangeListRequest) returns (GetChangeListResponse) {
        option (google.api.http) = {
          get: "/v1/pnds/{pid}/changes"
        };
      }
      rpc GetChange(GetChangeRequest) returns (GetChangeResponse) {
        option (google.api.http) = {
          get: "/v1/pnds/{pid}/changes/{cuid}"
        };
      }
      rpc SetChangeList(SetChangeListRequest) returns (SetChangeListResponse) {
        option (google.api.http) = {
          post: "/v1/pnds/{pid}/changes"
          body: "*"
        };
      }
      // Allows to request a specific Path of a Orchestrated Networking Device,
      // managed by a specific Principal Network Domain.
      rpc GetPath(GetPathRequest) returns (GetPathResponse) {
        option (google.api.http) = {
          get: "/v1/pnds/{pid}/onds/{did}/paths/{path}"
        };
      }
    
      rpc SetPathList(SetPathListRequest) returns (SetPathListResponse) {
    
        option (google.api.http) = {
          post: "/v1/pnds/{pid}/onds/{did}/paths"
          body: "*"
        };
      }
      rpc DeletePnd(DeletePndRequest) returns (DeletePndResponse) {
        option (google.api.http) = {
          delete: "/v1/pnds/{pid}"
        };
      }
      rpc DeleteOnd(DeleteOndRequest) returns (DeleteOndResponse) {
        option (google.api.http) = {
          delete: "/v1/pnds/{pid}/onds/{did}"
        };
      }
    }
    
    message GetOndListRequest {
      int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
      string pid = 4;
    }
    
    message GetOndRequest {
      int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
      string did = 3;
      string pid = 4;
    }
    
    message GetSbiListRequest {
      int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
      string pid = 4;
    }
    message GetSbiRequest {
      int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
      string sid = 3;
      string pid = 4;
    }
    
    message GetChangeListRequest {
      int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
      string pid = 4;
    }
    
    message GetChangeRequest {
      int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
      string cuid = 3;
      string pid = 4;
    }
    
    message GetPathRequest {
      int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
      string did = 2;
      string path = 3;
      string pid = 4;
    }
    
    message GetOndResponse {
      int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
      // TODO: Check if this is really needed. Perhaps a reference to the PND's ID
      // is also sufficient.
      PrincipalNetworkDomain pnd = 2;
      OrchestratedNetworkingDevice ond = 3;
    }
    
    message GetOndListResponse {
      int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
      // TODO: Check if this is really needed. Perhaps a reference to the PND's ID
      // is also sufficient.
      PrincipalNetworkDomain pnd = 2;
      repeated OrchestratedNetworkingDevice ond = 3;
    }
    
    message GetSbiResponse {
      int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
      // TODO: Check if this is really needed. Perhaps a reference to the PND's ID
      // is also sufficient.
      PrincipalNetworkDomain pnd = 2;
      .gosdn.southbound.v1alpha.SouthboundInterface sbi = 3;
    }
    
    message GetSbiListResponse {
      int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
      // TODO: Check if this is really needed. Perhaps a reference to the PND's ID
      // is also sufficient.
      PrincipalNetworkDomain pnd = 2;
      repeated .gosdn.southbound.v1alpha.SouthboundInterface sbi = 3;
    }
    
    message GetPathResponse {
      int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
      // TODO: Check if this is really needed. Perhaps a reference to the PND's ID
      // is also sufficient.
      PrincipalNetworkDomain pnd = 2;
      repeated gnmi.Notification device = 3;
    }
    
    message GetChangeResponse {
      int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
      // TODO: Check if this is really needed. Perhaps a reference to the PND's ID
      // is also sufficient.
      PrincipalNetworkDomain pnd = 2;
      Change change = 3;
    }
    
    message GetChangeListResponse {
      int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
      // TODO: Check if this is really needed. Perhaps a reference to the PND's ID
      // is also sufficient.
      PrincipalNetworkDomain pnd = 2;
      repeated Change change = 3;
    }
    
    message PrincipalNetworkDomain {
      string id = 1;
      string name = 2;
      string description = 3;
    }
    
    message OrchestratedNetworkingDevice {
      string id = 1;
      string name = 2;
      repeated gnmi.Notification device = 3;
      .gosdn.southbound.v1alpha.SouthboundInterface sbi = 4;
    }
    
    
    enum Change_State {
      STATE_UNSPECIFIED = 0;
      STATE_PENDING = 1;
      STATE_COMMITTED = 2;
      STATE_CONFIRMED = 3;
      STATE_INCONSISTENT = 4;
    }
    
    
    message Change {
      string id = 1;
      int64 age = 2;
    
      State state = 3;
    }
    
    message SetOndListRequest {
      int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
      repeated SetOnd ond = 2;
      string pid = 3;
    }
    
    message SetSbiListRequest {
      int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
      repeated SetSbi sbi = 2;
      string pid = 3;
    }
    
    message SetChangeListRequest {
      int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
      repeated SetChange change = 2;
      string pid = 3;
    }
    
    
    message SetPathListRequest {
    
      int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
      repeated ChangeRequest change_request = 2;
      string did = 3;
      string pid = 4;
    }
    
    message SetOnd {
      string address = 1;
      .gosdn.southbound.v1alpha.SouthboundInterface sbi = 2;
      string device_name = 3;
      .gosdn.transport.v1alpha.TransportOption transport_option = 4;
    }
    
    message SetSbi {
    }
    
    
    enum Operation {
      OPERATION_UNSPECIFIED = 0;
      OPERATION_CREATE = 1;
      OPERATION_COMMIT = 2;
      OPERATION_CONFIRM = 3;
    }
    
    
      string cuid = 1;
      Operation op = 2;
    }
    
    //TODO: rename
    message ChangeRequest {
      string path = 1;
      string value = 2;
      ApiOperation api_op = 3;
    }
    
    
    enum ApiOperation {
      API_OPERATION_UNSPECIFIED = 0;
      API_OPERATION_UPDATE = 1;
      API_OPERATION_REPLACE = 2;
      API_OPERATION_DELETE = 3;
    }
    
    message SetResponse{
      int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
      Status status = 2;
    }
    
    message SetOndListResponse{
      int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
      Status status = 2;
      repeated SetResponse responses = 3;
    }
    
    message SetChangeListResponse{
      int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
      Status status = 2;
      repeated SetResponse responses = 3;
    }
    
    message SetChangeResponse{
      int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
      Status status = 2;
    }
    
    message SetSbiListResponse{
      int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
      Status status = 2;
      repeated SetResponse responses = 3;
    }
    
    
    message SetPathListResponse{
    
      int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
      Status status = 2;
    
      repeated SetResponse responses = 3;
    
    }
    
    message DeletePndRequest {
      int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
      string pid = 4;
    }
    
    message DeleteOndRequest {
      int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
      string pid = 4;
      string did = 5;
    }
    
    message DeletePndResponse {
    
      int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
    
      Status status = 2;
    }
    
    message DeleteOndResponse {
    
      int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
    
      Status status = 2;
    }
    
    enum Status {
      STATUS_UNSPECIFIED = 0;
      STATUS_OK = 1;
      STATUS_ERROR = 2;