diff --git a/api/proto/gosdn/subscriptionmanagement/subscriptionmanagement.proto b/api/proto/gosdn/subscriptionmanagement/subscriptionmanagement.proto new file mode 100644 index 0000000000000000000000000000000000000000..3838a767b693846d25cb963b8743e7ef3336bc43 --- /dev/null +++ b/api/proto/gosdn/subscriptionmanagement/subscriptionmanagement.proto @@ -0,0 +1,83 @@ +syntax = "proto3"; + +package gosdn.subscriptionmanagement; + +import "buf/validate/validate.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/descriptor.proto"; + +option go_package = "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/submanagement"; + +service SubscriptionManagementService { + rpc GetAll(GetAllRequest) returns (GetAllResponse) { + option (google.api.http) = {get: "/submanagement/subscriptions"}; + } + + rpc Get(GetRequest) returns (GetResponse) { + option (google.api.http) = {get: "/submanagement/{subid}"}; + } + + rpc Delete(DeleteRequest) returns (DeleteResponse) { + option (google.api.http) = {delete: "/submanagement/{subid}"}; + } + + rpc Add(AddRequest) returns (AddResponse) { + option (google.api.http) = { + post: "/submanagement/{mneid}" + body: "*" + }; + } +} + +message Subscription{ + string subid = 1; + string pid = 2; + string mneid = 3; + string mne_name = 4; + repeated string paths = 5; + SubscribeOptions subscribe_options = 6; +} + +message SubscribeOptions { + string gnmi_mode = 1; + string gnmi_stream_mode = 2; + uint64 sample_interval = 3; +} + +message GetAllRequest{ + int64 timestamp = 1; +} + +message GetAllResponse{ + int64 timestamp = 1; + repeated Subscription subscriptions = 2; +} + +message GetRequest { + int64 timestamp = 1; + string subid = 2 [(buf.validate.field).required = true]; +} + +message GetResponse { + int64 timestamp = 1; + Subscription subscriptions = 2; +} + +message DeleteRequest{ + int64 timestamp = 1; + string subid = 2 [(buf.validate.field).required = true]; +} + +message DeleteResponse{ + int64 timestamp = 1; +} + +message AddRequest{ + int64 timestamp = 1; + string mneid = 2 [(buf.validate.field).required = true]; + Subscription subscription = 3 [(buf.validate.field).required = true]; +} + +message AddResponse{ + int64 timestamp = 1; +}