Skip to content
Snippets Groups Projects
pnd.proto 9.83 KiB
Newer Older
  • Learn to ignore specific revisions
  • package gosdn.pnd;
    
    
    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 all Orchestrated Networking Devices which are managed by a
    
      // specific Principal Network Domain.
      rpc GetOndList(GetOndListRequest) returns (GetOndListResponse) {
        option (google.api.http) = {
    
          get: "/pnds/{pid}/onds"
    
      // Allows to request a specific Orchestrated Networking Device which is managed by a
      // specific Principal Network Domain.
    
      rpc GetOnd(GetOndRequest) returns (GetOndResponse) {
        option (google.api.http) = {
    
          get: "/pnds/{pid}/ond/{did}"
    
      // Allows add multiple Orchestrated Networking Devices to be managed by a
      // specific Principal Network Domain.
    
      rpc SetOndList(SetOndListRequest) returns (SetOndListResponse) {
        option (google.api.http) = {
    
          post: "/pnds/{pid}/onds"
    
      // Allows to request all Southbound Interfaces a specific Principal Network
    
      // Domain supports.
      rpc GetSbiList(GetSbiListRequest) returns (GetSbiListResponse) {
        option (google.api.http) = {
    
          get: "/pnds/{pid}/sbis"
    
      // Allows to request a specific Southbound Interfaces a specific Principal Network
      // Domain supports.
    
      rpc GetSbi(GetSbiRequest) returns (GetSbiResponse) {
        option (google.api.http) = {
    
          get: "/pnds/{pid}/sbis/{sid}"
    
      // Allows to add multiple specific Southbound Interfaces a specific Principal Network
      // Domain supports.
    
      rpc SetSbiList(SetSbiListRequest) returns (SetSbiListResponse) {
        option (google.api.http) = {
    
          post: "/pnds/{pid}/sbis"
    
      // Allows to request all Changes registered for a specific Principal Network Domain.
    
      rpc GetChangeList(GetChangeListRequest) returns (GetChangeListResponse) {
        option (google.api.http) = {
    
          get: "/pnds/{pid}/changes"
    
      // Allows to request a specific Change registered for a specific Principal Network Domain.
    
      rpc GetChange(GetChangeRequest) returns (GetChangeResponse) {
        option (google.api.http) = {
    
          get: "/pnds/{pid}/changes/{cuid}"
    
      // Allows to operate on multiple Changes registered for a specific Principal Network Domain.
    
      rpc SetChangeList(SetChangeListRequest) returns (SetChangeListResponse) {
        option (google.api.http) = {
    
          post: "/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: "/pnds/{pid}/onds/{did}/paths/{path}"
    
      // Allows to set a specific Path of a Orchestrated Networking Device,
      // managed by a specific Principal Network Domain.
    
      rpc SetPathList(SetPathListRequest) returns (SetPathListResponse) {
    
        option (google.api.http) = {
    
          post: "/pnds/{pid}/onds/{did}/paths"
    
      // Allows to delete a specific Orchestrated Networking Device which is managed by a
      // specific Principal Network Domain.
    
      rpc DeleteOnd(DeleteOndRequest) returns (DeleteOndResponse) {
        option (google.api.http) = {
    
          delete: "/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.
    
      repeated 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;
    
      repeated 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.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.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.SouthboundInterface sbi = 4;
    
    enum ChangeState {
      CHANGE_STATE_UNSPECIFIED = 0;
      CHANGE_STATE_PENDING = 1;
      CHANGE_STATE_COMMITTED = 2;
      CHANGE_STATE_CONFIRMED = 3;
      CHANGE_STATE_INCONSISTENT = 4;
    
    message Change {
      string id = 1;
      int64 age = 2;
    
      ChangeState 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;
    }
    
    
    //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 SetOnd {
      string address = 1;
    
      .gosdn.southbound.SouthboundInterface sbi = 2;
    
      .gosdn.transport.TransportOption transport_option = 4;
    
    enum Operation {
      OPERATION_UNSPECIFIED = 0;
      OPERATION_CREATE = 1;
      OPERATION_COMMIT = 2;
      OPERATION_CONFIRM = 3;
    }
    
    
      string cuid = 1;
      Operation op = 2;
    }
    
    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 DeleteOndRequest {
      int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
      string pid = 4;
      string did = 5;
    }
    
    message DeleteOndResponse {
    
      int64 timestamp = 1;          // Timestamp in nanoseconds since Epoch.
    
      Status status = 2;
    }
    
    enum Status {
      STATUS_UNSPECIFIED = 0;
      STATUS_OK = 1;
      STATUS_ERROR = 2;