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/
buf.lock
# 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
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";
option go_package = "code.fbi.h-da.de/danet/api/go/gosdn/core";
service core {
rpc Get(GetRequest) returns (GetResponse);
rpc Set(SetRequest) returns (SetResponse);
rpc GetPnd(GetPndRequest) returns (GetPndResponse);
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.
bool all = 2;
repeated string pid = 3;
}
message GetResponse {
message GetPndResponse {
int64 timestamp = 1; // Timestamp in nanoseconds since Epoch.
repeated .gosdn.pnd.PrincipalNetworkDomain pnd = 2;
}
message SetRequest {
message SetPndRequest {
int64 timestamp = 1; // Timestamp in nanoseconds since Epoch.
repeated setPnd pnd = 2;
}
......@@ -31,7 +39,7 @@ message setPnd {
string sbi = 3;
}
message SetResponse {
message SetPndResponse {
int64 timestamp = 1; // Timestamp in nanoseconds since Epoch.
enum status {
OK = 0;
......
......@@ -10,60 +10,111 @@ import "gosdn/southbound/southbound.proto";
option go_package = "code.fbi.h-da.de/danet/api/go/gosdn/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 Delete(DeleteRequest) returns (DeleteResponse);
}
message GetRequest {
message GetOndListRequest {
int64 timestamp = 1; // Timestamp in nanoseconds since Epoch.
oneof request {
getPnd pnd = 2;
getOnd ond = 3;
getSbi sbi = 4;
getChange change = 5;
getPath path = 7;
}
string pid = 6;
string pid = 4;
}
message getPnd {}
message GetOndRequest {
int64 timestamp = 1; // Timestamp in nanoseconds since Epoch.
bool all = 2;
repeated string did = 3;
string pid = 4;
}
message getOnd {
bool all = 1;
repeated string did = 2;
message GetSbiListRequest {
int64 timestamp = 1; // Timestamp in nanoseconds since Epoch.
string pid = 4;
}
message getSbi {
bool all = 1;
repeated string sid = 2;
message GetSbiRequest {
int64 timestamp = 1; // Timestamp in nanoseconds since Epoch.
bool all = 2;
repeated string sid = 3;
string pid = 4;
}
message getChange {
bool all = 1;
repeated string cuid = 2;
message GetChangeListRequest {
int64 timestamp = 1; // Timestamp in nanoseconds since Epoch.
string pid = 4;
}
message getPath {
string did = 1;
string path = 2;
message GetChangeRequest {
int64 timestamp = 1; // Timestamp in nanoseconds since Epoch.
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 {
int64 timestamp = 1; // Timestamp in nanoseconds since Epoch.
PrincipalNetworkDomain pnd = 2;
repeated OrchestratedNetworkingDevice ond = 3;
repeated .gosdn.southbound.SouthboundInterface sbi = 5;
repeated Change change = 7;
PrincipalNetworkDomain pnd = 2;
repeated OrchestratedNetworkingDevice ond = 3;
repeated .gosdn.southbound.SouthboundInterface sbi = 5;
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 {
string id = 1;
string name = 2;
string description = 3;
repeated OrchestratedNetworkingDevice ond = 4;
repeated .gosdn.southbound.SouthboundInterface sbi = 5;
repeated Change change = 6;
}
message OrchestratedNetworkingDevice {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment