diff --git a/api/go/gosdn/subscriptionmanagement/subscriptionmanagement.pb.go b/api/go/gosdn/subscriptionmanagement/subscriptionmanagement.pb.go index 960978e9dc7567655f1540e81dea2b7d03ed7b8e..617bea4d27eea7184ec26cec37ce541c4e6b10e7 100644 --- a/api/go/gosdn/subscriptionmanagement/subscriptionmanagement.pb.go +++ b/api/go/gosdn/subscriptionmanagement/subscriptionmanagement.pb.go @@ -32,7 +32,7 @@ type Subscription struct { Pid string `protobuf:"bytes,2,opt,name=pid,proto3" json:"pid,omitempty"` Mneid string `protobuf:"bytes,3,opt,name=mneid,proto3" json:"mneid,omitempty"` MneName string `protobuf:"bytes,4,opt,name=mne_name,json=mneName,proto3" json:"mne_name,omitempty"` - Paths []string `protobuf:"bytes,5,rep,name=paths,proto3" json:"paths,omitempty"` + Paths []*Path `protobuf:"bytes,5,rep,name=paths,proto3" json:"paths,omitempty"` SubscribeOptions *SubscribeOptions `protobuf:"bytes,6,opt,name=subscribe_options,json=subscribeOptions,proto3" json:"subscribe_options,omitempty"` } @@ -96,7 +96,7 @@ func (x *Subscription) GetMneName() string { return "" } -func (x *Subscription) GetPaths() []string { +func (x *Subscription) GetPaths() []*Path { if x != nil { return x.Paths } @@ -110,6 +110,53 @@ func (x *Subscription) GetSubscribeOptions() *SubscribeOptions { return nil } +type Path struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Elem []string `protobuf:"bytes,1,rep,name=elem,proto3" json:"elem,omitempty"` +} + +func (x *Path) Reset() { + *x = Path{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Path) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Path) ProtoMessage() {} + +func (x *Path) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Path.ProtoReflect.Descriptor instead. +func (*Path) Descriptor() ([]byte, []int) { + return file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_rawDescGZIP(), []int{1} +} + +func (x *Path) GetElem() []string { + if x != nil { + return x.Elem + } + return nil +} + type SubscribeOptions struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -123,7 +170,7 @@ type SubscribeOptions struct { func (x *SubscribeOptions) Reset() { *x = SubscribeOptions{} if protoimpl.UnsafeEnabled { - mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[1] + mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -136,7 +183,7 @@ func (x *SubscribeOptions) String() string { func (*SubscribeOptions) ProtoMessage() {} func (x *SubscribeOptions) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[1] + mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -149,7 +196,7 @@ func (x *SubscribeOptions) ProtoReflect() protoreflect.Message { // Deprecated: Use SubscribeOptions.ProtoReflect.Descriptor instead. func (*SubscribeOptions) Descriptor() ([]byte, []int) { - return file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_rawDescGZIP(), []int{1} + return file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_rawDescGZIP(), []int{2} } func (x *SubscribeOptions) GetGnmiMode() string { @@ -184,7 +231,7 @@ type GetAllRequest struct { func (x *GetAllRequest) Reset() { *x = GetAllRequest{} if protoimpl.UnsafeEnabled { - mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[2] + mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -197,7 +244,7 @@ func (x *GetAllRequest) String() string { func (*GetAllRequest) ProtoMessage() {} func (x *GetAllRequest) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[2] + mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -210,7 +257,7 @@ func (x *GetAllRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetAllRequest.ProtoReflect.Descriptor instead. func (*GetAllRequest) Descriptor() ([]byte, []int) { - return file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_rawDescGZIP(), []int{2} + return file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_rawDescGZIP(), []int{3} } func (x *GetAllRequest) GetTimestamp() int64 { @@ -232,7 +279,7 @@ type GetAllResponse struct { func (x *GetAllResponse) Reset() { *x = GetAllResponse{} if protoimpl.UnsafeEnabled { - mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[3] + mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -245,7 +292,7 @@ func (x *GetAllResponse) String() string { func (*GetAllResponse) ProtoMessage() {} func (x *GetAllResponse) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[3] + mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -258,7 +305,7 @@ func (x *GetAllResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetAllResponse.ProtoReflect.Descriptor instead. func (*GetAllResponse) Descriptor() ([]byte, []int) { - return file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_rawDescGZIP(), []int{3} + return file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_rawDescGZIP(), []int{4} } func (x *GetAllResponse) GetTimestamp() int64 { @@ -287,7 +334,7 @@ type GetRequest struct { func (x *GetRequest) Reset() { *x = GetRequest{} if protoimpl.UnsafeEnabled { - mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[4] + mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -300,7 +347,7 @@ func (x *GetRequest) String() string { func (*GetRequest) ProtoMessage() {} func (x *GetRequest) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[4] + mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -313,7 +360,7 @@ func (x *GetRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetRequest.ProtoReflect.Descriptor instead. func (*GetRequest) Descriptor() ([]byte, []int) { - return file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_rawDescGZIP(), []int{4} + return file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_rawDescGZIP(), []int{5} } func (x *GetRequest) GetTimestamp() int64 { @@ -342,7 +389,7 @@ type GetResponse struct { func (x *GetResponse) Reset() { *x = GetResponse{} if protoimpl.UnsafeEnabled { - mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[5] + mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -355,7 +402,7 @@ func (x *GetResponse) String() string { func (*GetResponse) ProtoMessage() {} func (x *GetResponse) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[5] + mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -368,7 +415,7 @@ func (x *GetResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetResponse.ProtoReflect.Descriptor instead. func (*GetResponse) Descriptor() ([]byte, []int) { - return file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_rawDescGZIP(), []int{5} + return file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_rawDescGZIP(), []int{6} } func (x *GetResponse) GetTimestamp() int64 { @@ -397,7 +444,7 @@ type DeleteRequest struct { func (x *DeleteRequest) Reset() { *x = DeleteRequest{} if protoimpl.UnsafeEnabled { - mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[6] + mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -410,7 +457,7 @@ func (x *DeleteRequest) String() string { func (*DeleteRequest) ProtoMessage() {} func (x *DeleteRequest) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[6] + mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -423,7 +470,7 @@ func (x *DeleteRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead. func (*DeleteRequest) Descriptor() ([]byte, []int) { - return file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_rawDescGZIP(), []int{6} + return file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_rawDescGZIP(), []int{7} } func (x *DeleteRequest) GetTimestamp() int64 { @@ -451,7 +498,7 @@ type DeleteResponse struct { func (x *DeleteResponse) Reset() { *x = DeleteResponse{} if protoimpl.UnsafeEnabled { - mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[7] + mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -464,7 +511,7 @@ func (x *DeleteResponse) String() string { func (*DeleteResponse) ProtoMessage() {} func (x *DeleteResponse) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[7] + mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -477,7 +524,7 @@ func (x *DeleteResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead. func (*DeleteResponse) Descriptor() ([]byte, []int) { - return file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_rawDescGZIP(), []int{7} + return file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_rawDescGZIP(), []int{8} } func (x *DeleteResponse) GetTimestamp() int64 { @@ -500,7 +547,7 @@ type AddRequest struct { func (x *AddRequest) Reset() { *x = AddRequest{} if protoimpl.UnsafeEnabled { - mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[8] + mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -513,7 +560,7 @@ func (x *AddRequest) String() string { func (*AddRequest) ProtoMessage() {} func (x *AddRequest) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[8] + mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -526,7 +573,7 @@ func (x *AddRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AddRequest.ProtoReflect.Descriptor instead. func (*AddRequest) Descriptor() ([]byte, []int) { - return file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_rawDescGZIP(), []int{8} + return file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_rawDescGZIP(), []int{9} } func (x *AddRequest) GetTimestamp() int64 { @@ -561,7 +608,7 @@ type AddResponse struct { func (x *AddResponse) Reset() { *x = AddResponse{} if protoimpl.UnsafeEnabled { - mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[9] + mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -574,7 +621,7 @@ func (x *AddResponse) String() string { func (*AddResponse) ProtoMessage() {} func (x *AddResponse) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[9] + mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -587,7 +634,7 @@ func (x *AddResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use AddResponse.ProtoReflect.Descriptor instead. func (*AddResponse) Descriptor() ([]byte, []int) { - return file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_rawDescGZIP(), []int{9} + return file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_rawDescGZIP(), []int{10} } func (x *AddResponse) GetTimestamp() int64 { @@ -608,7 +655,7 @@ type ResetAllSubscriptionsRequest struct { func (x *ResetAllSubscriptionsRequest) Reset() { *x = ResetAllSubscriptionsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[10] + mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -621,7 +668,7 @@ func (x *ResetAllSubscriptionsRequest) String() string { func (*ResetAllSubscriptionsRequest) ProtoMessage() {} func (x *ResetAllSubscriptionsRequest) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[10] + mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -634,7 +681,7 @@ func (x *ResetAllSubscriptionsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ResetAllSubscriptionsRequest.ProtoReflect.Descriptor instead. func (*ResetAllSubscriptionsRequest) Descriptor() ([]byte, []int) { - return file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_rawDescGZIP(), []int{10} + return file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_rawDescGZIP(), []int{11} } func (x *ResetAllSubscriptionsRequest) GetTimestamp() int64 { @@ -655,7 +702,7 @@ type ResetAllSubscriptionsResponse struct { func (x *ResetAllSubscriptionsResponse) Reset() { *x = ResetAllSubscriptionsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[11] + mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -668,7 +715,7 @@ func (x *ResetAllSubscriptionsResponse) String() string { func (*ResetAllSubscriptionsResponse) ProtoMessage() {} func (x *ResetAllSubscriptionsResponse) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[11] + mi := &file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -681,7 +728,7 @@ func (x *ResetAllSubscriptionsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ResetAllSubscriptionsResponse.ProtoReflect.Descriptor instead. func (*ResetAllSubscriptionsResponse) Descriptor() ([]byte, []int) { - return file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_rawDescGZIP(), []int{11} + return file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_rawDescGZIP(), []int{12} } func (x *ResetAllSubscriptionsResponse) GetTimestamp() int64 { @@ -705,21 +752,25 @@ var file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_rawDesc = []b 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xda, 0x01, 0x0a, 0x0c, 0x53, 0x75, 0x62, 0x73, 0x63, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xfe, 0x01, 0x0a, 0x0c, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x75, 0x62, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x75, 0x62, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6e, 0x65, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x6e, 0x65, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x6e, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x6e, 0x65, 0x4e, 0x61, 0x6d, 0x65, - 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, 0x74, 0x68, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x05, 0x70, 0x61, 0x74, 0x68, 0x73, 0x12, 0x5b, 0x0a, 0x11, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, - 0x69, 0x62, 0x65, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2e, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x52, 0x10, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x22, 0x82, 0x01, 0x0a, 0x10, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, + 0x12, 0x38, 0x0a, 0x05, 0x70, 0x61, 0x74, 0x68, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x22, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x50, + 0x61, 0x74, 0x68, 0x52, 0x05, 0x70, 0x61, 0x74, 0x68, 0x73, 0x12, 0x5b, 0x0a, 0x11, 0x73, 0x75, + 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x73, 0x75, + 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x10, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x1a, 0x0a, 0x04, 0x50, 0x61, 0x74, 0x68, 0x12, + 0x12, 0x0a, 0x04, 0x65, 0x6c, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x65, + 0x6c, 0x65, 0x6d, 0x22, 0x82, 0x01, 0x0a, 0x10, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x6e, 0x6d, 0x69, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x6e, 0x6d, 0x69, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x67, 0x6e, 0x6d, 0x69, 0x5f, 0x73, 0x74, @@ -844,41 +895,43 @@ func file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_rawDescGZIP( return file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_rawDescData } -var file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_goTypes = []any{ (*Subscription)(nil), // 0: gosdn.subscriptionmanagement.Subscription - (*SubscribeOptions)(nil), // 1: gosdn.subscriptionmanagement.SubscribeOptions - (*GetAllRequest)(nil), // 2: gosdn.subscriptionmanagement.GetAllRequest - (*GetAllResponse)(nil), // 3: gosdn.subscriptionmanagement.GetAllResponse - (*GetRequest)(nil), // 4: gosdn.subscriptionmanagement.GetRequest - (*GetResponse)(nil), // 5: gosdn.subscriptionmanagement.GetResponse - (*DeleteRequest)(nil), // 6: gosdn.subscriptionmanagement.DeleteRequest - (*DeleteResponse)(nil), // 7: gosdn.subscriptionmanagement.DeleteResponse - (*AddRequest)(nil), // 8: gosdn.subscriptionmanagement.AddRequest - (*AddResponse)(nil), // 9: gosdn.subscriptionmanagement.AddResponse - (*ResetAllSubscriptionsRequest)(nil), // 10: gosdn.subscriptionmanagement.ResetAllSubscriptionsRequest - (*ResetAllSubscriptionsResponse)(nil), // 11: gosdn.subscriptionmanagement.ResetAllSubscriptionsResponse + (*Path)(nil), // 1: gosdn.subscriptionmanagement.Path + (*SubscribeOptions)(nil), // 2: gosdn.subscriptionmanagement.SubscribeOptions + (*GetAllRequest)(nil), // 3: gosdn.subscriptionmanagement.GetAllRequest + (*GetAllResponse)(nil), // 4: gosdn.subscriptionmanagement.GetAllResponse + (*GetRequest)(nil), // 5: gosdn.subscriptionmanagement.GetRequest + (*GetResponse)(nil), // 6: gosdn.subscriptionmanagement.GetResponse + (*DeleteRequest)(nil), // 7: gosdn.subscriptionmanagement.DeleteRequest + (*DeleteResponse)(nil), // 8: gosdn.subscriptionmanagement.DeleteResponse + (*AddRequest)(nil), // 9: gosdn.subscriptionmanagement.AddRequest + (*AddResponse)(nil), // 10: gosdn.subscriptionmanagement.AddResponse + (*ResetAllSubscriptionsRequest)(nil), // 11: gosdn.subscriptionmanagement.ResetAllSubscriptionsRequest + (*ResetAllSubscriptionsResponse)(nil), // 12: gosdn.subscriptionmanagement.ResetAllSubscriptionsResponse } var file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_depIdxs = []int32{ - 1, // 0: gosdn.subscriptionmanagement.Subscription.subscribe_options:type_name -> gosdn.subscriptionmanagement.SubscribeOptions - 0, // 1: gosdn.subscriptionmanagement.GetAllResponse.subscriptions:type_name -> gosdn.subscriptionmanagement.Subscription - 0, // 2: gosdn.subscriptionmanagement.GetResponse.subscriptions:type_name -> gosdn.subscriptionmanagement.Subscription - 0, // 3: gosdn.subscriptionmanagement.AddRequest.subscription:type_name -> gosdn.subscriptionmanagement.Subscription - 2, // 4: gosdn.subscriptionmanagement.SubscriptionManagementService.GetAll:input_type -> gosdn.subscriptionmanagement.GetAllRequest - 4, // 5: gosdn.subscriptionmanagement.SubscriptionManagementService.Get:input_type -> gosdn.subscriptionmanagement.GetRequest - 6, // 6: gosdn.subscriptionmanagement.SubscriptionManagementService.Delete:input_type -> gosdn.subscriptionmanagement.DeleteRequest - 8, // 7: gosdn.subscriptionmanagement.SubscriptionManagementService.Add:input_type -> gosdn.subscriptionmanagement.AddRequest - 10, // 8: gosdn.subscriptionmanagement.SubscriptionManagementService.ResetAllSubscriptions:input_type -> gosdn.subscriptionmanagement.ResetAllSubscriptionsRequest - 3, // 9: gosdn.subscriptionmanagement.SubscriptionManagementService.GetAll:output_type -> gosdn.subscriptionmanagement.GetAllResponse - 5, // 10: gosdn.subscriptionmanagement.SubscriptionManagementService.Get:output_type -> gosdn.subscriptionmanagement.GetResponse - 7, // 11: gosdn.subscriptionmanagement.SubscriptionManagementService.Delete:output_type -> gosdn.subscriptionmanagement.DeleteResponse - 9, // 12: gosdn.subscriptionmanagement.SubscriptionManagementService.Add:output_type -> gosdn.subscriptionmanagement.AddResponse - 11, // 13: gosdn.subscriptionmanagement.SubscriptionManagementService.ResetAllSubscriptions:output_type -> gosdn.subscriptionmanagement.ResetAllSubscriptionsResponse - 9, // [9:14] is the sub-list for method output_type - 4, // [4:9] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 1, // 0: gosdn.subscriptionmanagement.Subscription.paths:type_name -> gosdn.subscriptionmanagement.Path + 2, // 1: gosdn.subscriptionmanagement.Subscription.subscribe_options:type_name -> gosdn.subscriptionmanagement.SubscribeOptions + 0, // 2: gosdn.subscriptionmanagement.GetAllResponse.subscriptions:type_name -> gosdn.subscriptionmanagement.Subscription + 0, // 3: gosdn.subscriptionmanagement.GetResponse.subscriptions:type_name -> gosdn.subscriptionmanagement.Subscription + 0, // 4: gosdn.subscriptionmanagement.AddRequest.subscription:type_name -> gosdn.subscriptionmanagement.Subscription + 3, // 5: gosdn.subscriptionmanagement.SubscriptionManagementService.GetAll:input_type -> gosdn.subscriptionmanagement.GetAllRequest + 5, // 6: gosdn.subscriptionmanagement.SubscriptionManagementService.Get:input_type -> gosdn.subscriptionmanagement.GetRequest + 7, // 7: gosdn.subscriptionmanagement.SubscriptionManagementService.Delete:input_type -> gosdn.subscriptionmanagement.DeleteRequest + 9, // 8: gosdn.subscriptionmanagement.SubscriptionManagementService.Add:input_type -> gosdn.subscriptionmanagement.AddRequest + 11, // 9: gosdn.subscriptionmanagement.SubscriptionManagementService.ResetAllSubscriptions:input_type -> gosdn.subscriptionmanagement.ResetAllSubscriptionsRequest + 4, // 10: gosdn.subscriptionmanagement.SubscriptionManagementService.GetAll:output_type -> gosdn.subscriptionmanagement.GetAllResponse + 6, // 11: gosdn.subscriptionmanagement.SubscriptionManagementService.Get:output_type -> gosdn.subscriptionmanagement.GetResponse + 8, // 12: gosdn.subscriptionmanagement.SubscriptionManagementService.Delete:output_type -> gosdn.subscriptionmanagement.DeleteResponse + 10, // 13: gosdn.subscriptionmanagement.SubscriptionManagementService.Add:output_type -> gosdn.subscriptionmanagement.AddResponse + 12, // 14: gosdn.subscriptionmanagement.SubscriptionManagementService.ResetAllSubscriptions:output_type -> gosdn.subscriptionmanagement.ResetAllSubscriptionsResponse + 10, // [10:15] is the sub-list for method output_type + 5, // [5:10] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_init() } @@ -900,7 +953,7 @@ func file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_init() { } } file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*SubscribeOptions); i { + switch v := v.(*Path); i { case 0: return &v.state case 1: @@ -912,7 +965,7 @@ func file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_init() { } } file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*GetAllRequest); i { + switch v := v.(*SubscribeOptions); i { case 0: return &v.state case 1: @@ -924,7 +977,7 @@ func file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_init() { } } file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*GetAllResponse); i { + switch v := v.(*GetAllRequest); i { case 0: return &v.state case 1: @@ -936,7 +989,7 @@ func file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_init() { } } file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*GetRequest); i { + switch v := v.(*GetAllResponse); i { case 0: return &v.state case 1: @@ -948,7 +1001,7 @@ func file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_init() { } } file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*GetResponse); i { + switch v := v.(*GetRequest); i { case 0: return &v.state case 1: @@ -960,7 +1013,7 @@ func file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_init() { } } file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[6].Exporter = func(v any, i int) any { - switch v := v.(*DeleteRequest); i { + switch v := v.(*GetResponse); i { case 0: return &v.state case 1: @@ -972,7 +1025,7 @@ func file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_init() { } } file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[7].Exporter = func(v any, i int) any { - switch v := v.(*DeleteResponse); i { + switch v := v.(*DeleteRequest); i { case 0: return &v.state case 1: @@ -984,7 +1037,7 @@ func file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_init() { } } file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[8].Exporter = func(v any, i int) any { - switch v := v.(*AddRequest); i { + switch v := v.(*DeleteResponse); i { case 0: return &v.state case 1: @@ -996,7 +1049,7 @@ func file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_init() { } } file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[9].Exporter = func(v any, i int) any { - switch v := v.(*AddResponse); i { + switch v := v.(*AddRequest); i { case 0: return &v.state case 1: @@ -1008,7 +1061,7 @@ func file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_init() { } } file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[10].Exporter = func(v any, i int) any { - switch v := v.(*ResetAllSubscriptionsRequest); i { + switch v := v.(*AddResponse); i { case 0: return &v.state case 1: @@ -1020,6 +1073,18 @@ func file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_init() { } } file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[11].Exporter = func(v any, i int) any { + switch v := v.(*ResetAllSubscriptionsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_msgTypes[12].Exporter = func(v any, i int) any { switch v := v.(*ResetAllSubscriptionsResponse); i { case 0: return &v.state @@ -1038,7 +1103,7 @@ func file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_gosdn_subscriptionmanagement_subscriptionmanagement_proto_rawDesc, NumEnums: 0, - NumMessages: 12, + NumMessages: 13, NumExtensions: 0, NumServices: 1, }, diff --git a/api/openapiv2/gosdn_northbound.swagger.json b/api/openapiv2/gosdn_northbound.swagger.json index ff5e9d1b6604233b24068269c71e7064b3d40b11..7e1d7500d998d0f22e86baa4160aee9916f332f3 100644 --- a/api/openapiv2/gosdn_northbound.swagger.json +++ b/api/openapiv2/gosdn_northbound.swagger.json @@ -3240,6 +3240,17 @@ } } }, + "gosdnsubscriptionmanagementPath": { + "type": "object", + "properties": { + "elem": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, "gosdnsubscriptionmanagementSubscription": { "type": "object", "properties": { @@ -3258,7 +3269,8 @@ "paths": { "type": "array", "items": { - "type": "string" + "type": "object", + "$ref": "#/definitions/gosdnsubscriptionmanagementPath" } }, "subscribeOptions": { diff --git a/api/proto/gosdn/subscriptionmanagement/subscriptionmanagement.proto b/api/proto/gosdn/subscriptionmanagement/subscriptionmanagement.proto index 55b70e2a76b13e4733e7d955b7a192b742b11387..ec542892ea84ac8cbbbb35199d7584397b5fdc39 100644 --- a/api/proto/gosdn/subscriptionmanagement/subscriptionmanagement.proto +++ b/api/proto/gosdn/subscriptionmanagement/subscriptionmanagement.proto @@ -38,10 +38,14 @@ message Subscription{ string pid = 2; string mneid = 3; string mne_name = 4; - repeated string paths = 5; + repeated Path paths = 5; SubscribeOptions subscribe_options = 6; } +message Path{ + repeated string elem = 1; +} + message SubscribeOptions { string gnmi_mode = 1; string gnmi_stream_mode = 2; diff --git a/cli/cmd/subManagementGetAll.go b/cli/cmd/subManagementGetAll.go new file mode 100644 index 0000000000000000000000000000000000000000..cf844c00d9a95e85fa992a16e32690c0ebd2887f --- /dev/null +++ b/cli/cmd/subManagementGetAll.go @@ -0,0 +1,67 @@ +/* +Copyright © 2021 da/net Research Group <danet@h-da.de> +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +package cmd + +import ( + "code.fbi.h-da.de/danet/gosdn/controller/api" + "github.com/pterm/pterm" + "github.com/sirupsen/logrus" + + "github.com/spf13/cobra" + "github.com/spf13/viper" +) + +// subGetAllCmd represents the get all subscriptions command. +var subGetAllCmd = &cobra.Command{ + Use: "getAll", + Short: "Fetches all current gNMI subscriptions.", + Long: "Fetches all current gNMI subscriptions.", + Run: func(cmd *cobra.Command, args []string) { + spinner, _ := pterm.DefaultSpinner.Start("Fetching subscriptions") + + resp, err := api.GetAll(createContextWithAuthorization(), viper.GetString("controllerAPIEndpoint")) + if err != nil { + pterm.Error.Println(err) + return + } + + for _, sub := range resp.Subscriptions { + logrus.Println(sub) + } + + spinner.Success() + }, +} + +func init() { + subCmd.AddCommand(subGetAllCmd) +} diff --git a/controller/api/subManagement.go b/controller/api/subManagement.go index c5317a481bd5484754facada0bdc3eb571197977..f439d2413420593e662b10cb191bf647965e7721 100644 --- a/controller/api/subManagement.go +++ b/controller/api/subManagement.go @@ -21,3 +21,17 @@ func ResetAllSubscriptions(ctx context.Context, addr string) (*subpb.ResetAllSub return subClient.ResetAllSubscriptions(ctx, req) } + +// GetAll returns information about all running subscriptions. +func GetAll(ctx context.Context, addr string) (*subpb.GetAllResponse, error) { + subClient, err := nbi.SubManagementClient(addr, dialOptions...) + if err != nil { + return nil, err + } + + req := &subpb.GetAllRequest{ + Timestamp: time.Now().UnixNano(), + } + + return subClient.GetAll(ctx, req) +} diff --git a/controller/northbound/server/submanagement.go b/controller/northbound/server/submanagement.go index add7d64c7bf1d2327c5b396aeb3dedc58083f930..a59a4fef0c7b66700ba92ba15e850634d2a4c5c3 100644 --- a/controller/northbound/server/submanagement.go +++ b/controller/northbound/server/submanagement.go @@ -33,3 +33,38 @@ func (s *SubManagementServer) ResetAllSubscriptions(ctx context.Context, request Timestamp: time.Now().UnixNano(), }, nil } + +// GetAll returns information about all running subscriptions. +func (s *SubManagementServer) GetAll(ctx context.Context, request *subpb.GetAllRequest) (*subpb.GetAllResponse, error) { + subInfos := s.networkElementWatchter.GetAllSubscriptionInformations() + + subInfosToReturn := make([]*subpb.Subscription, 0) + + for _, info := range subInfos { + + tmpPaths := make([]*subpb.Path, 0) + for _, path := range info.Opts.Paths { + tmpPaths = append(tmpPaths, &subpb.Path{ + Elem: path, + }) + } + + subInfosToReturn = append(subInfosToReturn, &subpb.Subscription{ + Subid: info.SubID, + Pid: info.PndID, + Mneid: info.MneID, + MneName: info.MneName, + Paths: tmpPaths, + SubscribeOptions: &subpb.SubscribeOptions{ + GnmiMode: info.Opts.Mode, + GnmiStreamMode: info.Opts.StreamMode, + SampleInterval: info.Opts.SampleInterval, + }, + }) + } + + return &subpb.GetAllResponse{ + Timestamp: time.Now().UnixNano(), + Subscriptions: subInfosToReturn, + }, nil +} diff --git a/controller/nucleus/networkElementWatcher.go b/controller/nucleus/networkElementWatcher.go index 83bef8f25445f341aca8d80e6d2e453d1d6332f1..bbe19684bc7e2b5719556b1863d0fddbd12c20d3 100644 --- a/controller/nucleus/networkElementWatcher.go +++ b/controller/nucleus/networkElementWatcher.go @@ -40,9 +40,13 @@ type NetworkElementWatcher struct { // networkelementSubscriptionHelper is used to store information to stop a running subscribe go routine. type networkelementSubscriptionHelper struct { + SubID string + MneID string + MneName string + PndID string stopSubscribeCtx context.Context stopFunc context.CancelFunc - opts *gnmi.SubscribeOptions + Opts *gnmi.SubscribeOptions } // NewNetworkElementWatcher allows to subscribe to network element paths. @@ -92,15 +96,19 @@ func (n *NetworkElementWatcher) SubscribeToNetworkElement(mne networkelement.Net func (n *NetworkElementWatcher) subscribeToNetworkElement(mne networkelement.NetworkElement, opts *gnmi.SubscribeOptions) { subID := uuid.New() + opts.Paths = n.mergeGnmiSubscriptions(mne.GetGnmiSubscriptionPaths(), config.GetGnmiSubscriptionPaths()) + stopContext, cancel := context.WithCancel(context.Background()) n.addToNetworkElementSubscriptions(subID, &networkelementSubscriptionHelper{ stopSubscribeCtx: stopContext, stopFunc: cancel, - opts: opts, + SubID: subID.String(), + MneID: mne.ID().String(), + MneName: mne.Name(), + PndID: mne.PndID().String(), + Opts: opts, }) - opts.Paths = n.mergeGnmiSubscriptions(mne.GetGnmiSubscriptionPaths(), config.GetGnmiSubscriptionPaths()) - go n.callSubscribe(stopContext, mne, opts) }