Skip to content
Snippets Groups Projects
Commit e7d5fcef authored by Malte Bauch's avatar Malte Bauch
Browse files

removed 'oneof' within proto/core and proto/pnd

Created new RPCs for each 'oneof'.
parent 5b2ddd70
No related branches found
No related tags found
No related merge requests found
.idea/ .idea/
buf.lock
# CoCSN API # CoCSN API
Protocol buffer definitions for goSDN gRPC API. To generate run the following command inside the repo root. Protocol buffer definitions for goSDN gRPC API. To generate you need [buf](https://buf.build/) and the following commands:
```sh ```sh
protoc --proto_path=./proto --proto_path=./deps --go_out=./go --go-grpc_out=./go --go-grpc_opt=paths=source_relative --go_opt=paths=source_relative $(find proto | grep .proto) buf mod update #from within the proto dictionary
buf generate
``` ```
...@@ -7,20 +7,28 @@ import "gosdn/pnd/pnd.proto"; ...@@ -7,20 +7,28 @@ import "gosdn/pnd/pnd.proto";
option go_package = "code.fbi.h-da.de/danet/api/go/gosdn/core"; option go_package = "code.fbi.h-da.de/danet/api/go/gosdn/core";
service core { service core {
rpc Get(GetRequest) returns (GetResponse); rpc GetPnd(GetPndRequest) returns (GetPndResponse);
rpc Set(SetRequest) returns (SetResponse); rpc GetPndList(GetPndListRequest) returns (GetPndResponse);
rpc SetPnd(SetPndRequest) returns (SetPndResponse);
} }
message GetRequest {
message GetPndListRequest {
int64 timestamp = 1; // Timestamp in nanoseconds since Epoch.
}
message GetPndRequest {
int64 timestamp = 1; // Timestamp in nanoseconds since Epoch. int64 timestamp = 1; // Timestamp in nanoseconds since Epoch.
bool all = 2; bool all = 2;
repeated string pid = 3; repeated string pid = 3;
} }
message GetResponse {
message GetPndResponse {
int64 timestamp = 1; // Timestamp in nanoseconds since Epoch. int64 timestamp = 1; // Timestamp in nanoseconds since Epoch.
repeated .gosdn.pnd.PrincipalNetworkDomain pnd = 2; repeated .gosdn.pnd.PrincipalNetworkDomain pnd = 2;
} }
message SetRequest {
message SetPndRequest {
int64 timestamp = 1; // Timestamp in nanoseconds since Epoch. int64 timestamp = 1; // Timestamp in nanoseconds since Epoch.
repeated setPnd pnd = 2; repeated setPnd pnd = 2;
} }
...@@ -31,7 +39,7 @@ message setPnd { ...@@ -31,7 +39,7 @@ message setPnd {
string sbi = 3; string sbi = 3;
} }
message SetResponse { message SetPndResponse {
int64 timestamp = 1; // Timestamp in nanoseconds since Epoch. int64 timestamp = 1; // Timestamp in nanoseconds since Epoch.
enum status { enum status {
OK = 0; OK = 0;
......
...@@ -10,60 +10,111 @@ import "gosdn/southbound/southbound.proto"; ...@@ -10,60 +10,111 @@ import "gosdn/southbound/southbound.proto";
option go_package = "code.fbi.h-da.de/danet/api/go/gosdn/pnd"; option go_package = "code.fbi.h-da.de/danet/api/go/gosdn/pnd";
service pnd { service pnd {
rpc Get(GetRequest) returns (GetResponse); // Allows to request Orchestrated Networking Devices which are managed by a
// specific Principal Network Domain.
rpc GetOnd(GetOndRequest) returns (GetOndResponse);
rpc GetOndList(GetOndListRequest) returns (GetOndResponse);
// Allows to request the Southbound Interfaces a specific Principal Network
// Domain supports.
rpc GetSbi(GetSbiRequest) returns (GetSbiResponse);
rpc GetSbiList(GetSbiListRequest) returns (GetSbiResponse);
// Allows to request Changes registered for a specific Principal Network Domain.
rpc GetChange(GetChangeRequest) returns (GetChangeResponse);
rpc GetChangeList(GetSbiListRequest) returns (GetChangeResponse);
// Allows to request a specific Path of a Orchestrated Networking Device,
// managed by a specific Principal Network Domain.
rpc GetPath(GetPathRequest) returns (GetPathResponse);
rpc Set(SetRequest) returns (SetResponse); rpc Set(SetRequest) returns (SetResponse);
rpc Delete(DeleteRequest) returns (DeleteResponse); rpc Delete(DeleteRequest) returns (DeleteResponse);
} }
message GetRequest { message GetOndListRequest {
int64 timestamp = 1; // Timestamp in nanoseconds since Epoch. int64 timestamp = 1; // Timestamp in nanoseconds since Epoch.
oneof request { string pid = 4;
getPnd pnd = 2;
getOnd ond = 3;
getSbi sbi = 4;
getChange change = 5;
getPath path = 7;
}
string pid = 6;
} }
message getPnd {} message GetOndRequest {
int64 timestamp = 1; // Timestamp in nanoseconds since Epoch.
bool all = 2;
repeated string did = 3;
string pid = 4;
}
message getOnd { message GetSbiListRequest {
bool all = 1; int64 timestamp = 1; // Timestamp in nanoseconds since Epoch.
repeated string did = 2; string pid = 4;
} }
message getSbi { message GetSbiRequest {
bool all = 1; int64 timestamp = 1; // Timestamp in nanoseconds since Epoch.
repeated string sid = 2; bool all = 2;
repeated string sid = 3;
string pid = 4;
} }
message getChange { message GetChangeListRequest {
bool all = 1; int64 timestamp = 1; // Timestamp in nanoseconds since Epoch.
repeated string cuid = 2; string pid = 4;
} }
message getPath { message GetChangeRequest {
string did = 1; int64 timestamp = 1; // Timestamp in nanoseconds since Epoch.
string path = 2; bool all = 2;
repeated 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 GetResponse { message GetResponse {
int64 timestamp = 1; // Timestamp in nanoseconds since Epoch. int64 timestamp = 1; // Timestamp in nanoseconds since Epoch.
PrincipalNetworkDomain pnd = 2; PrincipalNetworkDomain pnd = 2;
repeated OrchestratedNetworkingDevice ond = 3; repeated OrchestratedNetworkingDevice ond = 3;
repeated .gosdn.southbound.SouthboundInterface sbi = 5; repeated .gosdn.southbound.SouthboundInterface sbi = 5;
repeated Change change = 7; repeated Change change = 7;
}
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;
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;
Change change = 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;
repeated Change change = 3;
} }
message PrincipalNetworkDomain { message PrincipalNetworkDomain {
string id = 1; string id = 1;
string name = 2; string name = 2;
string description = 3; string description = 3;
repeated OrchestratedNetworkingDevice ond = 4;
repeated .gosdn.southbound.SouthboundInterface sbi = 5;
repeated Change change = 6;
} }
message OrchestratedNetworkingDevice { message OrchestratedNetworkingDevice {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment