From 1386b8577304028117645300598adfeb84fc9d2e Mon Sep 17 00:00:00 2001 From: Manuel Kieweg <mail@manuelkieweg.de> Date: Mon, 3 May 2021 17:55:59 +0200 Subject: [PATCH] first nbi draft --- cocsn-v0.0.1.yml | 98 ------------------------------------------- proto/nbi/gosdn.proto | 94 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+), 98 deletions(-) delete mode 100644 cocsn-v0.0.1.yml create mode 100644 proto/nbi/gosdn.proto diff --git a/cocsn-v0.0.1.yml b/cocsn-v0.0.1.yml deleted file mode 100644 index 7e788a7..0000000 --- a/cocsn-v0.0.1.yml +++ /dev/null @@ -1,98 +0,0 @@ -swagger: '2.0' -info: - version: '0.0.1' - title: CoCSN - description: Simple RESTCONF API - contact: - name: Your name -basePath: /restconf -schemes: - - http -consumes: - - application/json -produces: - - application/json -paths: - /data/cocsn-interfaces: - get: - summary: 'Returns a list of interfaces' - operationId: getInterfaces - tags: - - interface - produces: - - application/json - responses: - 200: - description: OK - schema: - $ref: '#/definitions/Interfaces' - 404: - description: An error occurred. - default: - description: Unexpected error - /data/cocsn-interface/{interface}/ip-addresses: - get: - summary: 'Returns IP addresses of an interface' - operationId: getIPAddresses - parameters: - - in: path - name: interface - description: interface to fetch - required: true - type: string - tags: - - interface - produces: - - application/json - responses: - 200: - description: OK - schema: - $ref: '#/definitions/LogicalAddresses' - 404: - description: An error occurred. - default: - description: Unexpected error - /data/cocsn-interface/{interface}/mac-address: - get: - summary: 'Returns MAC address of an interface' - operationId: getMACAddress - parameters: - - in: path - name: interface - description: interface to fetch - required: true - type: string - tags: - - interface - produces: - - application/json - responses: - 200: - description: OK - schema: - $ref: '#/definitions/PhysicalAddress' - 404: - description: An error occurred. - default: - description: Unexpected error -definitions: - Interfaces: - type: array - items: - type: string - properties: - name: - type: string - PhysicalAddress: - type: string - properties: - name: - type: string - LogicalAddresses: - type: array - items: - type: string - properties: - name: - type: string \ No newline at end of file diff --git a/proto/nbi/gosdn.proto b/proto/nbi/gosdn.proto new file mode 100644 index 0000000..adf4b9e --- /dev/null +++ b/proto/nbi/gosdn.proto @@ -0,0 +1,94 @@ +syntax = "proto3"; + +package gosdn; + +import "github.com/openconfig/gnmi/proto/gnmi/gnmi.proto"; + +option (pnd_service) = "0.0.1"; +option go_package = "code.fbi.h-da.de/cocsn/api/proto/gosdn"; + +service pnd { + rpc Get(GetRequest) returns (GetResponse); + rpc Set(SetRequest) returns (SetResponse); +} + +message GetRequest { + int64 timestamp = 1; // Timestamp in nanoseconds since Epoch. + enum get_type { + PND = 0; + OND = 1; + ONDS = 2; + SBI = 3; + SBIS = 4; + Changes = 5; + } + get_type type = 2; + string id = 3; +} + +message GetResponse { + int64 timestamp = 1; // Timestamp in nanoseconds since Epoch. + oneof get_oneof { + PrincipalNetworkingDomain pnd = 2; + OrchestratedNetworkingDevice ond = 3; + OrchestratedNetworkingDevices onds = 4; + SouthboundInterface sbi = 5; + SouthboundInterfaces sbis = 6; + Changes changes = 7; + } + +} + +message SetRequest {} + +message SetResponse{} + +message PrincipalNetworkingDomain { + string id = 1; + string name = 2; + string description = 3; + map<string, OrchestratedNetworkingDevice> onds = 4; + map<string, SouthboundInterface> sbis = 5; + map<string, Change> changes = 6; +} + +message SouthboundInterface { + int64 timestamp = 1; // Timestamp in nanoseconds since Epoch. + string id = 2; + string schema = 3; +} + +message OrchestratedNetworkingDevice { + int64 timestamp = 1; // Timestamp in nanoseconds since Epoch. + string id = 2; + string name = 3; + gnmi.Notification device = 4; +} + +message SouthboundInterfaces { + int64 timestamp = 1; // Timestamp in nanoseconds since Epoch. + map<string, SouthboundInterface> sbis = 2; +} + +message OrchestratedNetworkingDevices { + int64 timestamp = 1; // Timestamp in nanoseconds since Epoch. + map<string, OrchestratedNetworkingDevice> sbis = 2; +} + +message Change { + int64 timestamp = 1; // Timestamp in nanoseconds since Epoch. + string id = 2; + int64 age = 3; + enum state { + PENDING = 0; + COMMITTED = 1; + CONFIRMED = 2; + } + +} + +message Changes { + int64 timestamp = 1; // Timestamp in nanoseconds since Epoch. + map<string, Change> sbis = 2; +} + -- GitLab