diff --git a/README.md b/README.md index 7a6c65aaf885069ca6cf012f182876a848c3ee7f..ce2d4c028c2dbd6644703245aae9343b096c4761 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ to get all submodules. network using one unified controller. `goSDN` provides: -* Model driven device representation +* Model driven device/network element representation * Native multi vendor support * Multi controller environments @@ -43,7 +43,7 @@ A simple showcase how the controller can be adressed after - The `cli` is the CLI to manage the `controller`. - `csbi` is the implementation of Containerised-Southbound-Interfaces (based on the idea and the proof of concept of Manuel Kieweg). Allowing to request - capabilities of ONDs and generate a containerised Southbound-Interface based + capabilities of MNEs and generate a containerised Southbound-Interface based on them. - `controller` represents the `goSDN-controller`. @@ -51,19 +51,19 @@ A simple showcase how the controller can be adressed after The `goSDN` controllers core - also called `nucleus` - is a lightweight library that manages principal network domains and provides southbound interface -operations for orchestrated networking devices. +operations for managed network elements. In addition we provide a simple Northbound-API for the controller () ## Principal Networking Domain (PND) The PND is the single source of truth within a network. Its state is held and -maintained by the controller. Any configuration of an OND has to be applied by +maintained by the controller. Any configuration of an MNE has to be applied by the PND. -## Orchestrated Networking Device (OND) +## Managed Network Element (MNE) -Any device directly configured by `goSDN` +Any network element directly configured by `goSDN` # Installing `goSDN` provides a `Makefile` for all common use cases. diff --git a/api/go/gosdn/device/device.pb.go b/api/go/gosdn/device/device.pb.go deleted file mode 100644 index 3cc794c2cf549c3a05af4c9ab517654c0e76ddaa..0000000000000000000000000000000000000000 --- a/api/go/gosdn/device/device.pb.go +++ /dev/null @@ -1,1168 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.1 -// protoc (unknown) -// source: gosdn/device/device.proto - -package device - -import ( - _ "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/pnd" - southbound "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/southbound" - transport "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/transport" - _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" - _ "github.com/openconfig/gnmi/proto/gnmi" - _ "google.golang.org/genproto/googleapis/api/annotations" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - _ "google.golang.org/protobuf/types/descriptorpb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Status int32 - -const ( - Status_STATUS_UNSPECIFIED Status = 0 - Status_STATUS_OK Status = 1 - Status_STATUS_ERROR Status = 2 -) - -// Enum value maps for Status. -var ( - Status_name = map[int32]string{ - 0: "STATUS_UNSPECIFIED", - 1: "STATUS_OK", - 2: "STATUS_ERROR", - } - Status_value = map[string]int32{ - "STATUS_UNSPECIFIED": 0, - "STATUS_OK": 1, - "STATUS_ERROR": 2, - } -) - -func (x Status) Enum() *Status { - p := new(Status) - *p = x - return p -} - -func (x Status) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Status) Descriptor() protoreflect.EnumDescriptor { - return file_gosdn_device_device_proto_enumTypes[0].Descriptor() -} - -func (Status) Type() protoreflect.EnumType { - return &file_gosdn_device_device_proto_enumTypes[0] -} - -func (x Status) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Status.Descriptor instead. -func (Status) EnumDescriptor() ([]byte, []int) { - return file_gosdn_device_device_proto_rawDescGZIP(), []int{0} -} - -type Device struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Model string `protobuf:"bytes,3,opt,name=model,proto3" json:"model,omitempty"` - TransportAddress string `protobuf:"bytes,4,opt,name=transportAddress,proto3" json:"transportAddress,omitempty"` -} - -func (x *Device) Reset() { - *x = Device{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_device_device_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Device) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Device) ProtoMessage() {} - -func (x *Device) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_device_device_proto_msgTypes[0] - 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 Device.ProtoReflect.Descriptor instead. -func (*Device) Descriptor() ([]byte, []int) { - return file_gosdn_device_device_proto_rawDescGZIP(), []int{0} -} - -func (x *Device) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Device) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Device) GetModel() string { - if x != nil { - return x.Model - } - return "" -} - -func (x *Device) GetTransportAddress() string { - if x != nil { - return x.TransportAddress - } - return "" -} - -type AddDeviceConfiguration struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Sbi *southbound.SouthboundInterface `protobuf:"bytes,2,opt,name=sbi,proto3" json:"sbi,omitempty"` - DeviceName string `protobuf:"bytes,3,opt,name=device_name,json=deviceName,proto3" json:"device_name,omitempty"` - TransportOption *transport.TransportOption `protobuf:"bytes,4,opt,name=transport_option,json=transportOption,proto3" json:"transport_option,omitempty"` -} - -func (x *AddDeviceConfiguration) Reset() { - *x = AddDeviceConfiguration{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_device_device_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AddDeviceConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddDeviceConfiguration) ProtoMessage() {} - -func (x *AddDeviceConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_device_device_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 AddDeviceConfiguration.ProtoReflect.Descriptor instead. -func (*AddDeviceConfiguration) Descriptor() ([]byte, []int) { - return file_gosdn_device_device_proto_rawDescGZIP(), []int{1} -} - -func (x *AddDeviceConfiguration) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *AddDeviceConfiguration) GetSbi() *southbound.SouthboundInterface { - if x != nil { - return x.Sbi - } - return nil -} - -func (x *AddDeviceConfiguration) GetDeviceName() string { - if x != nil { - return x.DeviceName - } - return "" -} - -func (x *AddDeviceConfiguration) GetTransportOption() *transport.TransportOption { - if x != nil { - return x.TransportOption - } - return nil -} - -type AddDeviceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Device *AddDeviceConfiguration `protobuf:"bytes,2,opt,name=device,proto3" json:"device,omitempty"` - Pid string `protobuf:"bytes,3,opt,name=pid,proto3" json:"pid,omitempty"` -} - -func (x *AddDeviceRequest) Reset() { - *x = AddDeviceRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_device_device_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AddDeviceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddDeviceRequest) ProtoMessage() {} - -func (x *AddDeviceRequest) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_device_device_proto_msgTypes[2] - 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 AddDeviceRequest.ProtoReflect.Descriptor instead. -func (*AddDeviceRequest) Descriptor() ([]byte, []int) { - return file_gosdn_device_device_proto_rawDescGZIP(), []int{2} -} - -func (x *AddDeviceRequest) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *AddDeviceRequest) GetDevice() *AddDeviceConfiguration { - if x != nil { - return x.Device - } - return nil -} - -func (x *AddDeviceRequest) GetPid() string { - if x != nil { - return x.Pid - } - return "" -} - -type AddDeviceResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.device.Status" json:"status,omitempty"` - DeviceId string `protobuf:"bytes,3,opt,name=deviceId,proto3" json:"deviceId,omitempty"` -} - -func (x *AddDeviceResponse) Reset() { - *x = AddDeviceResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_device_device_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AddDeviceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddDeviceResponse) ProtoMessage() {} - -func (x *AddDeviceResponse) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_device_device_proto_msgTypes[3] - 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 AddDeviceResponse.ProtoReflect.Descriptor instead. -func (*AddDeviceResponse) Descriptor() ([]byte, []int) { - return file_gosdn_device_device_proto_rawDescGZIP(), []int{3} -} - -func (x *AddDeviceResponse) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *AddDeviceResponse) GetStatus() Status { - if x != nil { - return x.Status - } - return Status_STATUS_UNSPECIFIED -} - -func (x *AddDeviceResponse) GetDeviceId() string { - if x != nil { - return x.DeviceId - } - return "" -} - -type GetDeviceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - DeviceID string `protobuf:"bytes,2,opt,name=deviceID,proto3" json:"deviceID,omitempty"` -} - -func (x *GetDeviceRequest) Reset() { - *x = GetDeviceRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_device_device_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetDeviceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetDeviceRequest) ProtoMessage() {} - -func (x *GetDeviceRequest) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_device_device_proto_msgTypes[4] - 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 GetDeviceRequest.ProtoReflect.Descriptor instead. -func (*GetDeviceRequest) Descriptor() ([]byte, []int) { - return file_gosdn_device_device_proto_rawDescGZIP(), []int{4} -} - -func (x *GetDeviceRequest) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *GetDeviceRequest) GetDeviceID() string { - if x != nil { - return x.DeviceID - } - return "" -} - -type GetDeviceResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.device.Status" json:"status,omitempty"` - Device *Device `protobuf:"bytes,3,opt,name=device,proto3" json:"device,omitempty"` -} - -func (x *GetDeviceResponse) Reset() { - *x = GetDeviceResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_device_device_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetDeviceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetDeviceResponse) ProtoMessage() {} - -func (x *GetDeviceResponse) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_device_device_proto_msgTypes[5] - 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 GetDeviceResponse.ProtoReflect.Descriptor instead. -func (*GetDeviceResponse) Descriptor() ([]byte, []int) { - return file_gosdn_device_device_proto_rawDescGZIP(), []int{5} -} - -func (x *GetDeviceResponse) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *GetDeviceResponse) GetStatus() Status { - if x != nil { - return x.Status - } - return Status_STATUS_UNSPECIFIED -} - -func (x *GetDeviceResponse) GetDevice() *Device { - if x != nil { - return x.Device - } - return nil -} - -type GetAllDeviceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` -} - -func (x *GetAllDeviceRequest) Reset() { - *x = GetAllDeviceRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_device_device_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetAllDeviceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetAllDeviceRequest) ProtoMessage() {} - -func (x *GetAllDeviceRequest) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_device_device_proto_msgTypes[6] - 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 GetAllDeviceRequest.ProtoReflect.Descriptor instead. -func (*GetAllDeviceRequest) Descriptor() ([]byte, []int) { - return file_gosdn_device_device_proto_rawDescGZIP(), []int{6} -} - -func (x *GetAllDeviceRequest) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -type GetAllDeviceResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.device.Status" json:"status,omitempty"` - Device []*Device `protobuf:"bytes,3,rep,name=device,proto3" json:"device,omitempty"` -} - -func (x *GetAllDeviceResponse) Reset() { - *x = GetAllDeviceResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_device_device_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetAllDeviceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetAllDeviceResponse) ProtoMessage() {} - -func (x *GetAllDeviceResponse) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_device_device_proto_msgTypes[7] - 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 GetAllDeviceResponse.ProtoReflect.Descriptor instead. -func (*GetAllDeviceResponse) Descriptor() ([]byte, []int) { - return file_gosdn_device_device_proto_rawDescGZIP(), []int{7} -} - -func (x *GetAllDeviceResponse) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *GetAllDeviceResponse) GetStatus() Status { - if x != nil { - return x.Status - } - return Status_STATUS_UNSPECIFIED -} - -func (x *GetAllDeviceResponse) GetDevice() []*Device { - if x != nil { - return x.Device - } - return nil -} - -type UpdateDeviceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Device *Device `protobuf:"bytes,2,opt,name=device,proto3" json:"device,omitempty"` -} - -func (x *UpdateDeviceRequest) Reset() { - *x = UpdateDeviceRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_device_device_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateDeviceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateDeviceRequest) ProtoMessage() {} - -func (x *UpdateDeviceRequest) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_device_device_proto_msgTypes[8] - 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 UpdateDeviceRequest.ProtoReflect.Descriptor instead. -func (*UpdateDeviceRequest) Descriptor() ([]byte, []int) { - return file_gosdn_device_device_proto_rawDescGZIP(), []int{8} -} - -func (x *UpdateDeviceRequest) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *UpdateDeviceRequest) GetDevice() *Device { - if x != nil { - return x.Device - } - return nil -} - -type UpdateDeviceResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.device.Status" json:"status,omitempty"` -} - -func (x *UpdateDeviceResponse) Reset() { - *x = UpdateDeviceResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_device_device_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateDeviceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateDeviceResponse) ProtoMessage() {} - -func (x *UpdateDeviceResponse) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_device_device_proto_msgTypes[9] - 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 UpdateDeviceResponse.ProtoReflect.Descriptor instead. -func (*UpdateDeviceResponse) Descriptor() ([]byte, []int) { - return file_gosdn_device_device_proto_rawDescGZIP(), []int{9} -} - -func (x *UpdateDeviceResponse) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *UpdateDeviceResponse) GetStatus() Status { - if x != nil { - return x.Status - } - return Status_STATUS_UNSPECIFIED -} - -type DeleteDeviceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - DeviceID string `protobuf:"bytes,2,opt,name=deviceID,proto3" json:"deviceID,omitempty"` -} - -func (x *DeleteDeviceRequest) Reset() { - *x = DeleteDeviceRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_device_device_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteDeviceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteDeviceRequest) ProtoMessage() {} - -func (x *DeleteDeviceRequest) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_device_device_proto_msgTypes[10] - 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 DeleteDeviceRequest.ProtoReflect.Descriptor instead. -func (*DeleteDeviceRequest) Descriptor() ([]byte, []int) { - return file_gosdn_device_device_proto_rawDescGZIP(), []int{10} -} - -func (x *DeleteDeviceRequest) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *DeleteDeviceRequest) GetDeviceID() string { - if x != nil { - return x.DeviceID - } - return "" -} - -type DeleteDeviceResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.device.Status" json:"status,omitempty"` -} - -func (x *DeleteDeviceResponse) Reset() { - *x = DeleteDeviceResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_gosdn_device_device_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteDeviceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteDeviceResponse) ProtoMessage() {} - -func (x *DeleteDeviceResponse) ProtoReflect() protoreflect.Message { - mi := &file_gosdn_device_device_proto_msgTypes[11] - 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 DeleteDeviceResponse.ProtoReflect.Descriptor instead. -func (*DeleteDeviceResponse) Descriptor() ([]byte, []int) { - return file_gosdn_device_device_proto_rawDescGZIP(), []int{11} -} - -func (x *DeleteDeviceResponse) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *DeleteDeviceResponse) GetStatus() Status { - if x != nil { - return x.Status - } - return Status_STATUS_UNSPECIFIED -} - -var File_gosdn_device_device_proto protoreflect.FileDescriptor - -var file_gosdn_device_device_proto_rawDesc = []byte{ - 0x0a, 0x19, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x64, - 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x67, 0x6f, 0x73, - 0x64, 0x6e, 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2f, 0x61, 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, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, - 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x2f, 0x67, 0x6e, 0x6d, 0x69, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6e, 0x6d, 0x69, - 0x2f, 0x67, 0x6e, 0x6d, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x67, 0x6f, 0x73, - 0x64, 0x6e, 0x2f, 0x70, 0x6e, 0x64, 0x2f, 0x70, 0x6e, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x1f, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, - 0x74, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x21, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x62, 0x6f, - 0x75, 0x6e, 0x64, 0x2f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6e, 0x0a, 0x06, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x2a, 0x0a, 0x10, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x70, 0x6f, 0x72, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x41, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x22, 0xd9, 0x01, 0x0a, 0x16, 0x41, 0x64, 0x64, 0x44, 0x65, 0x76, 0x69, - 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x37, 0x0a, 0x03, 0x73, 0x62, 0x69, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x73, - 0x6f, 0x75, 0x74, 0x68, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x62, - 0x6f, 0x75, 0x6e, 0x64, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x52, 0x03, 0x73, - 0x62, 0x69, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4e, - 0x61, 0x6d, 0x65, 0x12, 0x4b, 0x0a, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, - 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, - 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x0f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x22, 0x80, 0x01, 0x0a, 0x10, 0x41, 0x64, 0x64, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x12, 0x3c, 0x0a, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x64, 0x65, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x70, 0x69, 0x64, 0x22, 0x7b, 0x0a, 0x11, 0x41, 0x64, 0x64, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x64, - 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, - 0x22, 0x4c, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, 0x22, 0x8d, - 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63, - 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x2c, 0x0a, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, - 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x22, 0x33, - 0x0a, 0x13, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x22, 0x90, 0x01, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x44, 0x65, - 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x73, - 0x64, 0x6e, 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2c, 0x0a, 0x06, 0x64, 0x65, 0x76, 0x69, - 0x63, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, - 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x06, - 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x22, 0x61, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, - 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2c, 0x0a, 0x06, 0x64, - 0x65, 0x76, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, - 0x73, 0x64, 0x6e, 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, - 0x65, 0x52, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x22, 0x62, 0x0a, 0x14, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, - 0x2c, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x14, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x4f, 0x0a, - 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x44, 0x22, 0x62, - 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x64, 0x65, 0x76, - 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x2a, 0x41, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, - 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x4f, - 0x4b, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x45, 0x52, - 0x52, 0x4f, 0x52, 0x10, 0x02, 0x32, 0x9d, 0x03, 0x0a, 0x0d, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x61, 0x0a, 0x03, 0x41, 0x64, 0x64, 0x12, 0x1e, - 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x41, 0x64, - 0x64, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, - 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x41, 0x64, - 0x64, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x3a, 0x01, 0x2a, 0x22, 0x0e, 0x2f, 0x64, 0x65, 0x76, - 0x69, 0x63, 0x65, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x57, 0x0a, 0x03, 0x47, 0x65, - 0x74, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x0f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x09, 0x12, 0x07, 0x2f, 0x64, 0x65, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x64, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x12, 0x21, 0x2e, - 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x47, 0x65, 0x74, - 0x41, 0x6c, 0x6c, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x22, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, - 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x13, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0d, 0x12, 0x0b, 0x2f, 0x64, - 0x65, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x61, 0x6c, 0x6c, 0x12, 0x6a, 0x0a, 0x06, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x12, 0x21, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x64, 0x65, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x64, - 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x65, 0x76, 0x69, - 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x13, 0x3a, 0x01, 0x2a, 0x22, 0x0e, 0x2f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x75, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x32, 0x5a, 0x30, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x66, 0x62, - 0x69, 0x2e, 0x68, 0x2d, 0x64, 0x61, 0x2e, 0x64, 0x65, 0x2f, 0x64, 0x61, 0x6e, 0x65, 0x74, 0x2f, - 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x67, 0x6f, 0x73, - 0x64, 0x6e, 0x2f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, -} - -var ( - file_gosdn_device_device_proto_rawDescOnce sync.Once - file_gosdn_device_device_proto_rawDescData = file_gosdn_device_device_proto_rawDesc -) - -func file_gosdn_device_device_proto_rawDescGZIP() []byte { - file_gosdn_device_device_proto_rawDescOnce.Do(func() { - file_gosdn_device_device_proto_rawDescData = protoimpl.X.CompressGZIP(file_gosdn_device_device_proto_rawDescData) - }) - return file_gosdn_device_device_proto_rawDescData -} - -var file_gosdn_device_device_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_gosdn_device_device_proto_msgTypes = make([]protoimpl.MessageInfo, 12) -var file_gosdn_device_device_proto_goTypes = []interface{}{ - (Status)(0), // 0: gosdn.device.Status - (*Device)(nil), // 1: gosdn.device.Device - (*AddDeviceConfiguration)(nil), // 2: gosdn.device.AddDeviceConfiguration - (*AddDeviceRequest)(nil), // 3: gosdn.device.AddDeviceRequest - (*AddDeviceResponse)(nil), // 4: gosdn.device.AddDeviceResponse - (*GetDeviceRequest)(nil), // 5: gosdn.device.GetDeviceRequest - (*GetDeviceResponse)(nil), // 6: gosdn.device.GetDeviceResponse - (*GetAllDeviceRequest)(nil), // 7: gosdn.device.GetAllDeviceRequest - (*GetAllDeviceResponse)(nil), // 8: gosdn.device.GetAllDeviceResponse - (*UpdateDeviceRequest)(nil), // 9: gosdn.device.UpdateDeviceRequest - (*UpdateDeviceResponse)(nil), // 10: gosdn.device.UpdateDeviceResponse - (*DeleteDeviceRequest)(nil), // 11: gosdn.device.DeleteDeviceRequest - (*DeleteDeviceResponse)(nil), // 12: gosdn.device.DeleteDeviceResponse - (*southbound.SouthboundInterface)(nil), // 13: gosdn.southbound.SouthboundInterface - (*transport.TransportOption)(nil), // 14: gosdn.transport.TransportOption -} -var file_gosdn_device_device_proto_depIdxs = []int32{ - 13, // 0: gosdn.device.AddDeviceConfiguration.sbi:type_name -> gosdn.southbound.SouthboundInterface - 14, // 1: gosdn.device.AddDeviceConfiguration.transport_option:type_name -> gosdn.transport.TransportOption - 2, // 2: gosdn.device.AddDeviceRequest.device:type_name -> gosdn.device.AddDeviceConfiguration - 0, // 3: gosdn.device.AddDeviceResponse.status:type_name -> gosdn.device.Status - 0, // 4: gosdn.device.GetDeviceResponse.status:type_name -> gosdn.device.Status - 1, // 5: gosdn.device.GetDeviceResponse.device:type_name -> gosdn.device.Device - 0, // 6: gosdn.device.GetAllDeviceResponse.status:type_name -> gosdn.device.Status - 1, // 7: gosdn.device.GetAllDeviceResponse.device:type_name -> gosdn.device.Device - 1, // 8: gosdn.device.UpdateDeviceRequest.device:type_name -> gosdn.device.Device - 0, // 9: gosdn.device.UpdateDeviceResponse.status:type_name -> gosdn.device.Status - 0, // 10: gosdn.device.DeleteDeviceResponse.status:type_name -> gosdn.device.Status - 3, // 11: gosdn.device.DeviceService.Add:input_type -> gosdn.device.AddDeviceRequest - 5, // 12: gosdn.device.DeviceService.Get:input_type -> gosdn.device.GetDeviceRequest - 7, // 13: gosdn.device.DeviceService.GetAll:input_type -> gosdn.device.GetAllDeviceRequest - 9, // 14: gosdn.device.DeviceService.Update:input_type -> gosdn.device.UpdateDeviceRequest - 4, // 15: gosdn.device.DeviceService.Add:output_type -> gosdn.device.AddDeviceResponse - 6, // 16: gosdn.device.DeviceService.Get:output_type -> gosdn.device.GetDeviceResponse - 8, // 17: gosdn.device.DeviceService.GetAll:output_type -> gosdn.device.GetAllDeviceResponse - 10, // 18: gosdn.device.DeviceService.Update:output_type -> gosdn.device.UpdateDeviceResponse - 15, // [15:19] is the sub-list for method output_type - 11, // [11:15] is the sub-list for method input_type - 11, // [11:11] is the sub-list for extension type_name - 11, // [11:11] is the sub-list for extension extendee - 0, // [0:11] is the sub-list for field type_name -} - -func init() { file_gosdn_device_device_proto_init() } -func file_gosdn_device_device_proto_init() { - if File_gosdn_device_device_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_gosdn_device_device_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Device); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gosdn_device_device_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddDeviceConfiguration); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gosdn_device_device_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddDeviceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gosdn_device_device_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddDeviceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gosdn_device_device_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDeviceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gosdn_device_device_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetDeviceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gosdn_device_device_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetAllDeviceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gosdn_device_device_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetAllDeviceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gosdn_device_device_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateDeviceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gosdn_device_device_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateDeviceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gosdn_device_device_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteDeviceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gosdn_device_device_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteDeviceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_gosdn_device_device_proto_rawDesc, - NumEnums: 1, - NumMessages: 12, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_gosdn_device_device_proto_goTypes, - DependencyIndexes: file_gosdn_device_device_proto_depIdxs, - EnumInfos: file_gosdn_device_device_proto_enumTypes, - MessageInfos: file_gosdn_device_device_proto_msgTypes, - }.Build() - File_gosdn_device_device_proto = out.File - file_gosdn_device_device_proto_rawDesc = nil - file_gosdn_device_device_proto_goTypes = nil - file_gosdn_device_device_proto_depIdxs = nil -} diff --git a/api/go/gosdn/device/device_grpc.pb.go b/api/go/gosdn/device/device_grpc.pb.go deleted file mode 100644 index c3ac5549182b86db55db544ed5a19e6b3f9ac5e1..0000000000000000000000000000000000000000 --- a/api/go/gosdn/device/device_grpc.pb.go +++ /dev/null @@ -1,209 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. - -package device - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -// DeviceServiceClient is the client API for DeviceService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type DeviceServiceClient interface { - Add(ctx context.Context, in *AddDeviceRequest, opts ...grpc.CallOption) (*AddDeviceResponse, error) - Get(ctx context.Context, in *GetDeviceRequest, opts ...grpc.CallOption) (*GetDeviceResponse, error) - GetAll(ctx context.Context, in *GetAllDeviceRequest, opts ...grpc.CallOption) (*GetAllDeviceResponse, error) - Update(ctx context.Context, in *UpdateDeviceRequest, opts ...grpc.CallOption) (*UpdateDeviceResponse, error) -} - -type deviceServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewDeviceServiceClient(cc grpc.ClientConnInterface) DeviceServiceClient { - return &deviceServiceClient{cc} -} - -func (c *deviceServiceClient) Add(ctx context.Context, in *AddDeviceRequest, opts ...grpc.CallOption) (*AddDeviceResponse, error) { - out := new(AddDeviceResponse) - err := c.cc.Invoke(ctx, "/gosdn.device.DeviceService/Add", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *deviceServiceClient) Get(ctx context.Context, in *GetDeviceRequest, opts ...grpc.CallOption) (*GetDeviceResponse, error) { - out := new(GetDeviceResponse) - err := c.cc.Invoke(ctx, "/gosdn.device.DeviceService/Get", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *deviceServiceClient) GetAll(ctx context.Context, in *GetAllDeviceRequest, opts ...grpc.CallOption) (*GetAllDeviceResponse, error) { - out := new(GetAllDeviceResponse) - err := c.cc.Invoke(ctx, "/gosdn.device.DeviceService/GetAll", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *deviceServiceClient) Update(ctx context.Context, in *UpdateDeviceRequest, opts ...grpc.CallOption) (*UpdateDeviceResponse, error) { - out := new(UpdateDeviceResponse) - err := c.cc.Invoke(ctx, "/gosdn.device.DeviceService/Update", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// DeviceServiceServer is the server API for DeviceService service. -// All implementations must embed UnimplementedDeviceServiceServer -// for forward compatibility -type DeviceServiceServer interface { - Add(context.Context, *AddDeviceRequest) (*AddDeviceResponse, error) - Get(context.Context, *GetDeviceRequest) (*GetDeviceResponse, error) - GetAll(context.Context, *GetAllDeviceRequest) (*GetAllDeviceResponse, error) - Update(context.Context, *UpdateDeviceRequest) (*UpdateDeviceResponse, error) - mustEmbedUnimplementedDeviceServiceServer() -} - -// UnimplementedDeviceServiceServer must be embedded to have forward compatible implementations. -type UnimplementedDeviceServiceServer struct { -} - -func (UnimplementedDeviceServiceServer) Add(context.Context, *AddDeviceRequest) (*AddDeviceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Add not implemented") -} -func (UnimplementedDeviceServiceServer) Get(context.Context, *GetDeviceRequest) (*GetDeviceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") -} -func (UnimplementedDeviceServiceServer) GetAll(context.Context, *GetAllDeviceRequest) (*GetAllDeviceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetAll not implemented") -} -func (UnimplementedDeviceServiceServer) Update(context.Context, *UpdateDeviceRequest) (*UpdateDeviceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Update not implemented") -} -func (UnimplementedDeviceServiceServer) mustEmbedUnimplementedDeviceServiceServer() {} - -// UnsafeDeviceServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to DeviceServiceServer will -// result in compilation errors. -type UnsafeDeviceServiceServer interface { - mustEmbedUnimplementedDeviceServiceServer() -} - -func RegisterDeviceServiceServer(s grpc.ServiceRegistrar, srv DeviceServiceServer) { - s.RegisterService(&DeviceService_ServiceDesc, srv) -} - -func _DeviceService_Add_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddDeviceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DeviceServiceServer).Add(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gosdn.device.DeviceService/Add", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DeviceServiceServer).Add(ctx, req.(*AddDeviceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _DeviceService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetDeviceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DeviceServiceServer).Get(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gosdn.device.DeviceService/Get", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DeviceServiceServer).Get(ctx, req.(*GetDeviceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _DeviceService_GetAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetAllDeviceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DeviceServiceServer).GetAll(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gosdn.device.DeviceService/GetAll", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DeviceServiceServer).GetAll(ctx, req.(*GetAllDeviceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _DeviceService_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateDeviceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DeviceServiceServer).Update(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gosdn.device.DeviceService/Update", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DeviceServiceServer).Update(ctx, req.(*UpdateDeviceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// DeviceService_ServiceDesc is the grpc.ServiceDesc for DeviceService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var DeviceService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "gosdn.device.DeviceService", - HandlerType: (*DeviceServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Add", - Handler: _DeviceService_Add_Handler, - }, - { - MethodName: "Get", - Handler: _DeviceService_Get_Handler, - }, - { - MethodName: "GetAll", - Handler: _DeviceService_GetAll_Handler, - }, - { - MethodName: "Update", - Handler: _DeviceService_Update_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "gosdn/device/device.proto", -} diff --git a/api/go/gosdn/networkelement/networkelement.pb.go b/api/go/gosdn/networkelement/networkelement.pb.go new file mode 100644 index 0000000000000000000000000000000000000000..51cdb0ca7ca994a3fdb35e55e1f070cee0ced70b --- /dev/null +++ b/api/go/gosdn/networkelement/networkelement.pb.go @@ -0,0 +1,1202 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc (unknown) +// source: gosdn/networkelement/networkelement.proto + +package networkelement + +import ( + _ "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/pnd" + southbound "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/southbound" + transport "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/transport" + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + _ "github.com/openconfig/gnmi/proto/gnmi" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + _ "google.golang.org/protobuf/types/descriptorpb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Status int32 + +const ( + Status_STATUS_UNSPECIFIED Status = 0 + Status_STATUS_OK Status = 1 + Status_STATUS_ERROR Status = 2 +) + +// Enum value maps for Status. +var ( + Status_name = map[int32]string{ + 0: "STATUS_UNSPECIFIED", + 1: "STATUS_OK", + 2: "STATUS_ERROR", + } + Status_value = map[string]int32{ + "STATUS_UNSPECIFIED": 0, + "STATUS_OK": 1, + "STATUS_ERROR": 2, + } +) + +func (x Status) Enum() *Status { + p := new(Status) + *p = x + return p +} + +func (x Status) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Status) Descriptor() protoreflect.EnumDescriptor { + return file_gosdn_networkelement_networkelement_proto_enumTypes[0].Descriptor() +} + +func (Status) Type() protoreflect.EnumType { + return &file_gosdn_networkelement_networkelement_proto_enumTypes[0] +} + +func (x Status) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Status.Descriptor instead. +func (Status) EnumDescriptor() ([]byte, []int) { + return file_gosdn_networkelement_networkelement_proto_rawDescGZIP(), []int{0} +} + +type NetworkElement struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Model string `protobuf:"bytes,3,opt,name=model,proto3" json:"model,omitempty"` + TransportAddress string `protobuf:"bytes,4,opt,name=transport_address,json=transportAddress,proto3" json:"transport_address,omitempty"` +} + +func (x *NetworkElement) Reset() { + *x = NetworkElement{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_networkelement_networkelement_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NetworkElement) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NetworkElement) ProtoMessage() {} + +func (x *NetworkElement) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_networkelement_networkelement_proto_msgTypes[0] + 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 NetworkElement.ProtoReflect.Descriptor instead. +func (*NetworkElement) Descriptor() ([]byte, []int) { + return file_gosdn_networkelement_networkelement_proto_rawDescGZIP(), []int{0} +} + +func (x *NetworkElement) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *NetworkElement) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *NetworkElement) GetModel() string { + if x != nil { + return x.Model + } + return "" +} + +func (x *NetworkElement) GetTransportAddress() string { + if x != nil { + return x.TransportAddress + } + return "" +} + +type AddNetworkElementConfiguration struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Sbi *southbound.SouthboundInterface `protobuf:"bytes,2,opt,name=sbi,proto3" json:"sbi,omitempty"` + NetworkElementName string `protobuf:"bytes,3,opt,name=network_element_name,json=networkElementName,proto3" json:"network_element_name,omitempty"` + TransportOption *transport.TransportOption `protobuf:"bytes,4,opt,name=transport_option,json=transportOption,proto3" json:"transport_option,omitempty"` +} + +func (x *AddNetworkElementConfiguration) Reset() { + *x = AddNetworkElementConfiguration{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_networkelement_networkelement_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddNetworkElementConfiguration) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddNetworkElementConfiguration) ProtoMessage() {} + +func (x *AddNetworkElementConfiguration) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_networkelement_networkelement_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 AddNetworkElementConfiguration.ProtoReflect.Descriptor instead. +func (*AddNetworkElementConfiguration) Descriptor() ([]byte, []int) { + return file_gosdn_networkelement_networkelement_proto_rawDescGZIP(), []int{1} +} + +func (x *AddNetworkElementConfiguration) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *AddNetworkElementConfiguration) GetSbi() *southbound.SouthboundInterface { + if x != nil { + return x.Sbi + } + return nil +} + +func (x *AddNetworkElementConfiguration) GetNetworkElementName() string { + if x != nil { + return x.NetworkElementName + } + return "" +} + +func (x *AddNetworkElementConfiguration) GetTransportOption() *transport.TransportOption { + if x != nil { + return x.TransportOption + } + return nil +} + +type AddNetworkElementRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + NetworkElement *AddNetworkElementConfiguration `protobuf:"bytes,2,opt,name=network_element,json=networkElement,proto3" json:"network_element,omitempty"` + Pid string `protobuf:"bytes,3,opt,name=pid,proto3" json:"pid,omitempty"` +} + +func (x *AddNetworkElementRequest) Reset() { + *x = AddNetworkElementRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_networkelement_networkelement_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddNetworkElementRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddNetworkElementRequest) ProtoMessage() {} + +func (x *AddNetworkElementRequest) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_networkelement_networkelement_proto_msgTypes[2] + 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 AddNetworkElementRequest.ProtoReflect.Descriptor instead. +func (*AddNetworkElementRequest) Descriptor() ([]byte, []int) { + return file_gosdn_networkelement_networkelement_proto_rawDescGZIP(), []int{2} +} + +func (x *AddNetworkElementRequest) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *AddNetworkElementRequest) GetNetworkElement() *AddNetworkElementConfiguration { + if x != nil { + return x.NetworkElement + } + return nil +} + +func (x *AddNetworkElementRequest) GetPid() string { + if x != nil { + return x.Pid + } + return "" +} + +type AddNetworkElementResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.networkelement.Status" json:"status,omitempty"` + NetworkElementId string `protobuf:"bytes,3,opt,name=network_element_id,json=networkElementId,proto3" json:"network_element_id,omitempty"` +} + +func (x *AddNetworkElementResponse) Reset() { + *x = AddNetworkElementResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_networkelement_networkelement_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddNetworkElementResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddNetworkElementResponse) ProtoMessage() {} + +func (x *AddNetworkElementResponse) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_networkelement_networkelement_proto_msgTypes[3] + 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 AddNetworkElementResponse.ProtoReflect.Descriptor instead. +func (*AddNetworkElementResponse) Descriptor() ([]byte, []int) { + return file_gosdn_networkelement_networkelement_proto_rawDescGZIP(), []int{3} +} + +func (x *AddNetworkElementResponse) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *AddNetworkElementResponse) GetStatus() Status { + if x != nil { + return x.Status + } + return Status_STATUS_UNSPECIFIED +} + +func (x *AddNetworkElementResponse) GetNetworkElementId() string { + if x != nil { + return x.NetworkElementId + } + return "" +} + +type GetNetworkElementRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + NetworkElementId string `protobuf:"bytes,2,opt,name=network_element_id,json=networkElementId,proto3" json:"network_element_id,omitempty"` +} + +func (x *GetNetworkElementRequest) Reset() { + *x = GetNetworkElementRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_networkelement_networkelement_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetNetworkElementRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetNetworkElementRequest) ProtoMessage() {} + +func (x *GetNetworkElementRequest) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_networkelement_networkelement_proto_msgTypes[4] + 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 GetNetworkElementRequest.ProtoReflect.Descriptor instead. +func (*GetNetworkElementRequest) Descriptor() ([]byte, []int) { + return file_gosdn_networkelement_networkelement_proto_rawDescGZIP(), []int{4} +} + +func (x *GetNetworkElementRequest) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *GetNetworkElementRequest) GetNetworkElementId() string { + if x != nil { + return x.NetworkElementId + } + return "" +} + +type GetNetworkElementResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.networkelement.Status" json:"status,omitempty"` + NetworkElement *NetworkElement `protobuf:"bytes,3,opt,name=network_element,json=networkElement,proto3" json:"network_element,omitempty"` +} + +func (x *GetNetworkElementResponse) Reset() { + *x = GetNetworkElementResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_networkelement_networkelement_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetNetworkElementResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetNetworkElementResponse) ProtoMessage() {} + +func (x *GetNetworkElementResponse) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_networkelement_networkelement_proto_msgTypes[5] + 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 GetNetworkElementResponse.ProtoReflect.Descriptor instead. +func (*GetNetworkElementResponse) Descriptor() ([]byte, []int) { + return file_gosdn_networkelement_networkelement_proto_rawDescGZIP(), []int{5} +} + +func (x *GetNetworkElementResponse) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *GetNetworkElementResponse) GetStatus() Status { + if x != nil { + return x.Status + } + return Status_STATUS_UNSPECIFIED +} + +func (x *GetNetworkElementResponse) GetNetworkElement() *NetworkElement { + if x != nil { + return x.NetworkElement + } + return nil +} + +type GetAllNetworkElementRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` +} + +func (x *GetAllNetworkElementRequest) Reset() { + *x = GetAllNetworkElementRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_networkelement_networkelement_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAllNetworkElementRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAllNetworkElementRequest) ProtoMessage() {} + +func (x *GetAllNetworkElementRequest) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_networkelement_networkelement_proto_msgTypes[6] + 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 GetAllNetworkElementRequest.ProtoReflect.Descriptor instead. +func (*GetAllNetworkElementRequest) Descriptor() ([]byte, []int) { + return file_gosdn_networkelement_networkelement_proto_rawDescGZIP(), []int{6} +} + +func (x *GetAllNetworkElementRequest) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +type GetAllNetworkElementResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.networkelement.Status" json:"status,omitempty"` + NetworkElement []*NetworkElement `protobuf:"bytes,3,rep,name=network_element,json=networkElement,proto3" json:"network_element,omitempty"` +} + +func (x *GetAllNetworkElementResponse) Reset() { + *x = GetAllNetworkElementResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_networkelement_networkelement_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAllNetworkElementResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAllNetworkElementResponse) ProtoMessage() {} + +func (x *GetAllNetworkElementResponse) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_networkelement_networkelement_proto_msgTypes[7] + 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 GetAllNetworkElementResponse.ProtoReflect.Descriptor instead. +func (*GetAllNetworkElementResponse) Descriptor() ([]byte, []int) { + return file_gosdn_networkelement_networkelement_proto_rawDescGZIP(), []int{7} +} + +func (x *GetAllNetworkElementResponse) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *GetAllNetworkElementResponse) GetStatus() Status { + if x != nil { + return x.Status + } + return Status_STATUS_UNSPECIFIED +} + +func (x *GetAllNetworkElementResponse) GetNetworkElement() []*NetworkElement { + if x != nil { + return x.NetworkElement + } + return nil +} + +type UpdateNetworkElementRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + NetworkElement *NetworkElement `protobuf:"bytes,2,opt,name=network_element,json=networkElement,proto3" json:"network_element,omitempty"` +} + +func (x *UpdateNetworkElementRequest) Reset() { + *x = UpdateNetworkElementRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_networkelement_networkelement_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateNetworkElementRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateNetworkElementRequest) ProtoMessage() {} + +func (x *UpdateNetworkElementRequest) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_networkelement_networkelement_proto_msgTypes[8] + 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 UpdateNetworkElementRequest.ProtoReflect.Descriptor instead. +func (*UpdateNetworkElementRequest) Descriptor() ([]byte, []int) { + return file_gosdn_networkelement_networkelement_proto_rawDescGZIP(), []int{8} +} + +func (x *UpdateNetworkElementRequest) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *UpdateNetworkElementRequest) GetNetworkElement() *NetworkElement { + if x != nil { + return x.NetworkElement + } + return nil +} + +type UpdateNetworkElementResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.networkelement.Status" json:"status,omitempty"` +} + +func (x *UpdateNetworkElementResponse) Reset() { + *x = UpdateNetworkElementResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_networkelement_networkelement_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateNetworkElementResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateNetworkElementResponse) ProtoMessage() {} + +func (x *UpdateNetworkElementResponse) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_networkelement_networkelement_proto_msgTypes[9] + 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 UpdateNetworkElementResponse.ProtoReflect.Descriptor instead. +func (*UpdateNetworkElementResponse) Descriptor() ([]byte, []int) { + return file_gosdn_networkelement_networkelement_proto_rawDescGZIP(), []int{9} +} + +func (x *UpdateNetworkElementResponse) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *UpdateNetworkElementResponse) GetStatus() Status { + if x != nil { + return x.Status + } + return Status_STATUS_UNSPECIFIED +} + +type DeleteNetworkElementRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + NetworkElementId string `protobuf:"bytes,2,opt,name=network_element_id,json=networkElementId,proto3" json:"network_element_id,omitempty"` +} + +func (x *DeleteNetworkElementRequest) Reset() { + *x = DeleteNetworkElementRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_networkelement_networkelement_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteNetworkElementRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteNetworkElementRequest) ProtoMessage() {} + +func (x *DeleteNetworkElementRequest) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_networkelement_networkelement_proto_msgTypes[10] + 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 DeleteNetworkElementRequest.ProtoReflect.Descriptor instead. +func (*DeleteNetworkElementRequest) Descriptor() ([]byte, []int) { + return file_gosdn_networkelement_networkelement_proto_rawDescGZIP(), []int{10} +} + +func (x *DeleteNetworkElementRequest) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *DeleteNetworkElementRequest) GetNetworkElementId() string { + if x != nil { + return x.NetworkElementId + } + return "" +} + +type DeleteNetworkElementResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.networkelement.Status" json:"status,omitempty"` +} + +func (x *DeleteNetworkElementResponse) Reset() { + *x = DeleteNetworkElementResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_networkelement_networkelement_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteNetworkElementResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteNetworkElementResponse) ProtoMessage() {} + +func (x *DeleteNetworkElementResponse) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_networkelement_networkelement_proto_msgTypes[11] + 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 DeleteNetworkElementResponse.ProtoReflect.Descriptor instead. +func (*DeleteNetworkElementResponse) Descriptor() ([]byte, []int) { + return file_gosdn_networkelement_networkelement_proto_rawDescGZIP(), []int{11} +} + +func (x *DeleteNetworkElementResponse) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *DeleteNetworkElementResponse) GetStatus() Status { + if x != nil { + return x.Status + } + return Status_STATUS_UNSPECIFIED +} + +var File_gosdn_networkelement_networkelement_proto protoreflect.FileDescriptor + +var file_gosdn_networkelement_networkelement_proto_rawDesc = []byte{ + 0x0a, 0x29, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x65, + 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x6c, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x67, 0x6f, 0x73, + 0x64, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 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, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, + 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, + 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, + 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x6d, 0x69, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6e, 0x6d, 0x69, 0x2f, 0x67, 0x6e, 0x6d, 0x69, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2f, 0x70, 0x6e, 0x64, 0x2f, 0x70, + 0x6e, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2f, + 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, + 0x6f, 0x72, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x67, 0x6f, 0x73, 0x64, 0x6e, + 0x2f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x2f, 0x73, 0x6f, 0x75, 0x74, + 0x68, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x77, 0x0a, 0x0e, + 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x2b, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x6e, + 0x73, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xf2, 0x01, 0x0a, 0x1e, 0x41, 0x64, 0x64, 0x4e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x37, 0x0a, 0x03, 0x73, 0x62, 0x69, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x25, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x62, 0x6f, 0x75, + 0x6e, 0x64, 0x2e, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x49, 0x6e, 0x74, + 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x52, 0x03, 0x73, 0x62, 0x69, 0x12, 0x30, 0x0a, 0x14, 0x6e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x6e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x4b, 0x0a, + 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, + 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, + 0x6f, 0x72, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x70, 0x6f, 0x72, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xa9, 0x01, 0x0a, 0x18, 0x41, + 0x64, 0x64, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x5d, 0x0a, 0x0f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x5f, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, + 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x6c, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x41, 0x64, 0x64, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x6c, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x70, 0x69, 0x64, 0x22, 0x9d, 0x01, 0x0a, 0x19, 0x41, 0x64, 0x64, 0x4e, 0x65, + 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x12, 0x34, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x6e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x5f, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x6c, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x66, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x12, 0x2c, 0x0a, 0x12, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x65, 0x6c, 0x65, 0x6d, + 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6e, 0x65, + 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0xbe, + 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x6c, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x34, 0x0a, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x73, + 0x64, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x4d, 0x0a, 0x0f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x65, 0x6c, 0x65, 0x6d, + 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x73, 0x64, + 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x0e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x22, + 0x3b, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, + 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0xc1, 0x01, 0x0a, + 0x1c, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x6c, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, + 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x34, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x67, 0x6f, + 0x73, 0x64, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x6c, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x4d, 0x0a, 0x0f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x65, 0x6c, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x73, + 0x64, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x52, 0x0e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x22, 0x8a, 0x01, 0x0a, 0x1b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x4d, + 0x0a, 0x0f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, + 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x4e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0e, 0x6e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x72, 0x0a, + 0x1c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x6c, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, + 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x34, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x67, 0x6f, + 0x73, 0x64, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x6c, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x22, 0x69, 0x0a, 0x1b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2c, + 0x0a, 0x12, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x72, 0x0a, 0x1c, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x6c, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x34, 0x0a, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x73, + 0x64, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x2a, 0x41, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, + 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x4f, 0x4b, 0x10, + 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x45, 0x52, 0x52, 0x4f, + 0x52, 0x10, 0x02, 0x32, 0xcd, 0x04, 0x0a, 0x15, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x45, + 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x8a, 0x01, + 0x0a, 0x03, 0x41, 0x64, 0x64, 0x12, 0x2e, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x6e, 0x65, + 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x41, 0x64, 0x64, + 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x6e, 0x65, + 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x41, 0x64, 0x64, + 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x3a, 0x01, + 0x2a, 0x22, 0x17, 0x2f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2d, 0x65, 0x6c, 0x65, 0x6d, + 0x65, 0x6e, 0x74, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x80, 0x01, 0x0a, 0x03, 0x47, + 0x65, 0x74, 0x12, 0x2e, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, 0x2f, 0x6e, 0x65, + 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2d, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x8d, 0x01, + 0x0a, 0x06, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x12, 0x31, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, + 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, + 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x6c, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x67, 0x6f, + 0x73, 0x64, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x6c, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x12, 0x14, 0x2f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x2d, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x61, 0x6c, 0x6c, 0x12, 0x93, 0x01, + 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x31, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, + 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x6c, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x67, 0x6f, + 0x73, 0x64, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x6c, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x3a, 0x01, 0x2a, 0x22, 0x17, 0x2f, 0x6e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x2d, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x42, 0x3a, 0x5a, 0x38, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x66, 0x62, 0x69, 0x2e, + 0x68, 0x2d, 0x64, 0x61, 0x2e, 0x64, 0x65, 0x2f, 0x64, 0x61, 0x6e, 0x65, 0x74, 0x2f, 0x67, 0x6f, + 0x73, 0x64, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x67, 0x6f, 0x73, 0x64, 0x6e, + 0x2f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_gosdn_networkelement_networkelement_proto_rawDescOnce sync.Once + file_gosdn_networkelement_networkelement_proto_rawDescData = file_gosdn_networkelement_networkelement_proto_rawDesc +) + +func file_gosdn_networkelement_networkelement_proto_rawDescGZIP() []byte { + file_gosdn_networkelement_networkelement_proto_rawDescOnce.Do(func() { + file_gosdn_networkelement_networkelement_proto_rawDescData = protoimpl.X.CompressGZIP(file_gosdn_networkelement_networkelement_proto_rawDescData) + }) + return file_gosdn_networkelement_networkelement_proto_rawDescData +} + +var file_gosdn_networkelement_networkelement_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_gosdn_networkelement_networkelement_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_gosdn_networkelement_networkelement_proto_goTypes = []interface{}{ + (Status)(0), // 0: gosdn.networkelement.Status + (*NetworkElement)(nil), // 1: gosdn.networkelement.NetworkElement + (*AddNetworkElementConfiguration)(nil), // 2: gosdn.networkelement.AddNetworkElementConfiguration + (*AddNetworkElementRequest)(nil), // 3: gosdn.networkelement.AddNetworkElementRequest + (*AddNetworkElementResponse)(nil), // 4: gosdn.networkelement.AddNetworkElementResponse + (*GetNetworkElementRequest)(nil), // 5: gosdn.networkelement.GetNetworkElementRequest + (*GetNetworkElementResponse)(nil), // 6: gosdn.networkelement.GetNetworkElementResponse + (*GetAllNetworkElementRequest)(nil), // 7: gosdn.networkelement.GetAllNetworkElementRequest + (*GetAllNetworkElementResponse)(nil), // 8: gosdn.networkelement.GetAllNetworkElementResponse + (*UpdateNetworkElementRequest)(nil), // 9: gosdn.networkelement.UpdateNetworkElementRequest + (*UpdateNetworkElementResponse)(nil), // 10: gosdn.networkelement.UpdateNetworkElementResponse + (*DeleteNetworkElementRequest)(nil), // 11: gosdn.networkelement.DeleteNetworkElementRequest + (*DeleteNetworkElementResponse)(nil), // 12: gosdn.networkelement.DeleteNetworkElementResponse + (*southbound.SouthboundInterface)(nil), // 13: gosdn.southbound.SouthboundInterface + (*transport.TransportOption)(nil), // 14: gosdn.transport.TransportOption +} +var file_gosdn_networkelement_networkelement_proto_depIdxs = []int32{ + 13, // 0: gosdn.networkelement.AddNetworkElementConfiguration.sbi:type_name -> gosdn.southbound.SouthboundInterface + 14, // 1: gosdn.networkelement.AddNetworkElementConfiguration.transport_option:type_name -> gosdn.transport.TransportOption + 2, // 2: gosdn.networkelement.AddNetworkElementRequest.network_element:type_name -> gosdn.networkelement.AddNetworkElementConfiguration + 0, // 3: gosdn.networkelement.AddNetworkElementResponse.status:type_name -> gosdn.networkelement.Status + 0, // 4: gosdn.networkelement.GetNetworkElementResponse.status:type_name -> gosdn.networkelement.Status + 1, // 5: gosdn.networkelement.GetNetworkElementResponse.network_element:type_name -> gosdn.networkelement.NetworkElement + 0, // 6: gosdn.networkelement.GetAllNetworkElementResponse.status:type_name -> gosdn.networkelement.Status + 1, // 7: gosdn.networkelement.GetAllNetworkElementResponse.network_element:type_name -> gosdn.networkelement.NetworkElement + 1, // 8: gosdn.networkelement.UpdateNetworkElementRequest.network_element:type_name -> gosdn.networkelement.NetworkElement + 0, // 9: gosdn.networkelement.UpdateNetworkElementResponse.status:type_name -> gosdn.networkelement.Status + 0, // 10: gosdn.networkelement.DeleteNetworkElementResponse.status:type_name -> gosdn.networkelement.Status + 3, // 11: gosdn.networkelement.NetworkElementService.Add:input_type -> gosdn.networkelement.AddNetworkElementRequest + 5, // 12: gosdn.networkelement.NetworkElementService.Get:input_type -> gosdn.networkelement.GetNetworkElementRequest + 7, // 13: gosdn.networkelement.NetworkElementService.GetAll:input_type -> gosdn.networkelement.GetAllNetworkElementRequest + 9, // 14: gosdn.networkelement.NetworkElementService.Update:input_type -> gosdn.networkelement.UpdateNetworkElementRequest + 4, // 15: gosdn.networkelement.NetworkElementService.Add:output_type -> gosdn.networkelement.AddNetworkElementResponse + 6, // 16: gosdn.networkelement.NetworkElementService.Get:output_type -> gosdn.networkelement.GetNetworkElementResponse + 8, // 17: gosdn.networkelement.NetworkElementService.GetAll:output_type -> gosdn.networkelement.GetAllNetworkElementResponse + 10, // 18: gosdn.networkelement.NetworkElementService.Update:output_type -> gosdn.networkelement.UpdateNetworkElementResponse + 15, // [15:19] is the sub-list for method output_type + 11, // [11:15] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name +} + +func init() { file_gosdn_networkelement_networkelement_proto_init() } +func file_gosdn_networkelement_networkelement_proto_init() { + if File_gosdn_networkelement_networkelement_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_gosdn_networkelement_networkelement_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NetworkElement); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_networkelement_networkelement_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddNetworkElementConfiguration); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_networkelement_networkelement_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddNetworkElementRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_networkelement_networkelement_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddNetworkElementResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_networkelement_networkelement_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetNetworkElementRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_networkelement_networkelement_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetNetworkElementResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_networkelement_networkelement_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAllNetworkElementRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_networkelement_networkelement_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAllNetworkElementResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_networkelement_networkelement_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateNetworkElementRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_networkelement_networkelement_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateNetworkElementResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_networkelement_networkelement_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteNetworkElementRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_networkelement_networkelement_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteNetworkElementResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_gosdn_networkelement_networkelement_proto_rawDesc, + NumEnums: 1, + NumMessages: 12, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_gosdn_networkelement_networkelement_proto_goTypes, + DependencyIndexes: file_gosdn_networkelement_networkelement_proto_depIdxs, + EnumInfos: file_gosdn_networkelement_networkelement_proto_enumTypes, + MessageInfos: file_gosdn_networkelement_networkelement_proto_msgTypes, + }.Build() + File_gosdn_networkelement_networkelement_proto = out.File + file_gosdn_networkelement_networkelement_proto_rawDesc = nil + file_gosdn_networkelement_networkelement_proto_goTypes = nil + file_gosdn_networkelement_networkelement_proto_depIdxs = nil +} diff --git a/api/go/gosdn/device/device.pb.gw.go b/api/go/gosdn/networkelement/networkelement.pb.gw.go similarity index 51% rename from api/go/gosdn/device/device.pb.gw.go rename to api/go/gosdn/networkelement/networkelement.pb.gw.go index 64ca57255f446d0de326e6fa388a479d7416c998..2ad35433b955d2d19cbad6d7c0e48de1f746e27d 100644 --- a/api/go/gosdn/device/device.pb.gw.go +++ b/api/go/gosdn/networkelement/networkelement.pb.gw.go @@ -1,12 +1,12 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: gosdn/device/device.proto +// source: gosdn/networkelement/networkelement.proto /* -Package device is a reverse proxy. +Package networkelement is a reverse proxy. It translates gRPC into RESTful JSON APIs. */ -package device +package networkelement import ( "context" @@ -31,8 +31,8 @@ var _ = runtime.String var _ = utilities.NewDoubleArray var _ = metadata.Join -func request_DeviceService_Add_0(ctx context.Context, marshaler runtime.Marshaler, client DeviceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AddDeviceRequest +func request_NetworkElementService_Add_0(ctx context.Context, marshaler runtime.Marshaler, client NetworkElementServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AddNetworkElementRequest var metadata runtime.ServerMetadata newReader, berr := utilities.IOReaderFactory(req.Body) @@ -48,8 +48,8 @@ func request_DeviceService_Add_0(ctx context.Context, marshaler runtime.Marshale } -func local_request_DeviceService_Add_0(ctx context.Context, marshaler runtime.Marshaler, server DeviceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AddDeviceRequest +func local_request_NetworkElementService_Add_0(ctx context.Context, marshaler runtime.Marshaler, server NetworkElementServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AddNetworkElementRequest var metadata runtime.ServerMetadata newReader, berr := utilities.IOReaderFactory(req.Body) @@ -66,17 +66,17 @@ func local_request_DeviceService_Add_0(ctx context.Context, marshaler runtime.Ma } var ( - filter_DeviceService_Get_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} + filter_NetworkElementService_Get_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) -func request_DeviceService_Get_0(ctx context.Context, marshaler runtime.Marshaler, client DeviceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetDeviceRequest +func request_NetworkElementService_Get_0(ctx context.Context, marshaler runtime.Marshaler, client NetworkElementServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetNetworkElementRequest var metadata runtime.ServerMetadata if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_DeviceService_Get_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_NetworkElementService_Get_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -85,14 +85,14 @@ func request_DeviceService_Get_0(ctx context.Context, marshaler runtime.Marshale } -func local_request_DeviceService_Get_0(ctx context.Context, marshaler runtime.Marshaler, server DeviceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetDeviceRequest +func local_request_NetworkElementService_Get_0(ctx context.Context, marshaler runtime.Marshaler, server NetworkElementServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetNetworkElementRequest var metadata runtime.ServerMetadata if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_DeviceService_Get_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_NetworkElementService_Get_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -102,17 +102,17 @@ func local_request_DeviceService_Get_0(ctx context.Context, marshaler runtime.Ma } var ( - filter_DeviceService_GetAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} + filter_NetworkElementService_GetAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) -func request_DeviceService_GetAll_0(ctx context.Context, marshaler runtime.Marshaler, client DeviceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetAllDeviceRequest +func request_NetworkElementService_GetAll_0(ctx context.Context, marshaler runtime.Marshaler, client NetworkElementServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetAllNetworkElementRequest var metadata runtime.ServerMetadata if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_DeviceService_GetAll_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_NetworkElementService_GetAll_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -121,14 +121,14 @@ func request_DeviceService_GetAll_0(ctx context.Context, marshaler runtime.Marsh } -func local_request_DeviceService_GetAll_0(ctx context.Context, marshaler runtime.Marshaler, server DeviceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetAllDeviceRequest +func local_request_NetworkElementService_GetAll_0(ctx context.Context, marshaler runtime.Marshaler, server NetworkElementServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetAllNetworkElementRequest var metadata runtime.ServerMetadata if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_DeviceService_GetAll_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_NetworkElementService_GetAll_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -137,8 +137,8 @@ func local_request_DeviceService_GetAll_0(ctx context.Context, marshaler runtime } -func request_DeviceService_Update_0(ctx context.Context, marshaler runtime.Marshaler, client DeviceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UpdateDeviceRequest +func request_NetworkElementService_Update_0(ctx context.Context, marshaler runtime.Marshaler, client NetworkElementServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateNetworkElementRequest var metadata runtime.ServerMetadata newReader, berr := utilities.IOReaderFactory(req.Body) @@ -154,8 +154,8 @@ func request_DeviceService_Update_0(ctx context.Context, marshaler runtime.Marsh } -func local_request_DeviceService_Update_0(ctx context.Context, marshaler runtime.Marshaler, server DeviceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UpdateDeviceRequest +func local_request_NetworkElementService_Update_0(ctx context.Context, marshaler runtime.Marshaler, server NetworkElementServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateNetworkElementRequest var metadata runtime.ServerMetadata newReader, berr := utilities.IOReaderFactory(req.Body) @@ -171,24 +171,24 @@ func local_request_DeviceService_Update_0(ctx context.Context, marshaler runtime } -// RegisterDeviceServiceHandlerServer registers the http handlers for service DeviceService to "mux". -// UnaryRPC :call DeviceServiceServer directly. +// RegisterNetworkElementServiceHandlerServer registers the http handlers for service NetworkElementService to "mux". +// UnaryRPC :call NetworkElementServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterDeviceServiceHandlerFromEndpoint instead. -func RegisterDeviceServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DeviceServiceServer) error { +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterNetworkElementServiceHandlerFromEndpoint instead. +func RegisterNetworkElementServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server NetworkElementServiceServer) error { - mux.Handle("POST", pattern_DeviceService_Add_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_NetworkElementService_Add_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.device.DeviceService/Add", runtime.WithHTTPPathPattern("/device/create")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.networkelement.NetworkElementService/Add", runtime.WithHTTPPathPattern("/network-element/create")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_DeviceService_Add_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_NetworkElementService_Add_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -196,22 +196,22 @@ func RegisterDeviceServiceHandlerServer(ctx context.Context, mux *runtime.ServeM return } - forward_DeviceService_Add_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_NetworkElementService_Add_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_DeviceService_Get_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_NetworkElementService_Get_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.device.DeviceService/Get", runtime.WithHTTPPathPattern("/device")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.networkelement.NetworkElementService/Get", runtime.WithHTTPPathPattern("/network-element")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_DeviceService_Get_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_NetworkElementService_Get_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -219,22 +219,22 @@ func RegisterDeviceServiceHandlerServer(ctx context.Context, mux *runtime.ServeM return } - forward_DeviceService_Get_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_NetworkElementService_Get_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_DeviceService_GetAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_NetworkElementService_GetAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.device.DeviceService/GetAll", runtime.WithHTTPPathPattern("/device/all")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.networkelement.NetworkElementService/GetAll", runtime.WithHTTPPathPattern("/network-element/all")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_DeviceService_GetAll_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_NetworkElementService_GetAll_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -242,22 +242,22 @@ func RegisterDeviceServiceHandlerServer(ctx context.Context, mux *runtime.ServeM return } - forward_DeviceService_GetAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_NetworkElementService_GetAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("POST", pattern_DeviceService_Update_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_NetworkElementService_Update_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.device.DeviceService/Update", runtime.WithHTTPPathPattern("/device/update")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.networkelement.NetworkElementService/Update", runtime.WithHTTPPathPattern("/network-element/update")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_DeviceService_Update_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_NetworkElementService_Update_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -265,16 +265,16 @@ func RegisterDeviceServiceHandlerServer(ctx context.Context, mux *runtime.ServeM return } - forward_DeviceService_Update_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_NetworkElementService_Update_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) return nil } -// RegisterDeviceServiceHandlerFromEndpoint is same as RegisterDeviceServiceHandler but +// RegisterNetworkElementServiceHandlerFromEndpoint is same as RegisterNetworkElementServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterDeviceServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { +func RegisterNetworkElementServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { conn, err := grpc.Dial(endpoint, opts...) if err != nil { return err @@ -294,99 +294,99 @@ func RegisterDeviceServiceHandlerFromEndpoint(ctx context.Context, mux *runtime. }() }() - return RegisterDeviceServiceHandler(ctx, mux, conn) + return RegisterNetworkElementServiceHandler(ctx, mux, conn) } -// RegisterDeviceServiceHandler registers the http handlers for service DeviceService to "mux". +// RegisterNetworkElementServiceHandler registers the http handlers for service NetworkElementService to "mux". // The handlers forward requests to the grpc endpoint over "conn". -func RegisterDeviceServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterDeviceServiceHandlerClient(ctx, mux, NewDeviceServiceClient(conn)) +func RegisterNetworkElementServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterNetworkElementServiceHandlerClient(ctx, mux, NewNetworkElementServiceClient(conn)) } -// RegisterDeviceServiceHandlerClient registers the http handlers for service DeviceService -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "DeviceServiceClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "DeviceServiceClient" +// RegisterNetworkElementServiceHandlerClient registers the http handlers for service NetworkElementService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "NetworkElementServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "NetworkElementServiceClient" // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "DeviceServiceClient" to call the correct interceptors. -func RegisterDeviceServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DeviceServiceClient) error { +// "NetworkElementServiceClient" to call the correct interceptors. +func RegisterNetworkElementServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NetworkElementServiceClient) error { - mux.Handle("POST", pattern_DeviceService_Add_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_NetworkElementService_Add_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.device.DeviceService/Add", runtime.WithHTTPPathPattern("/device/create")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.networkelement.NetworkElementService/Add", runtime.WithHTTPPathPattern("/network-element/create")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_DeviceService_Add_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_NetworkElementService_Add_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_DeviceService_Add_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_NetworkElementService_Add_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_DeviceService_Get_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_NetworkElementService_Get_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.device.DeviceService/Get", runtime.WithHTTPPathPattern("/device")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.networkelement.NetworkElementService/Get", runtime.WithHTTPPathPattern("/network-element")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_DeviceService_Get_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_NetworkElementService_Get_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_DeviceService_Get_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_NetworkElementService_Get_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_DeviceService_GetAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_NetworkElementService_GetAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.device.DeviceService/GetAll", runtime.WithHTTPPathPattern("/device/all")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.networkelement.NetworkElementService/GetAll", runtime.WithHTTPPathPattern("/network-element/all")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_DeviceService_GetAll_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_NetworkElementService_GetAll_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_DeviceService_GetAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_NetworkElementService_GetAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("POST", pattern_DeviceService_Update_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_NetworkElementService_Update_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.device.DeviceService/Update", runtime.WithHTTPPathPattern("/device/update")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.networkelement.NetworkElementService/Update", runtime.WithHTTPPathPattern("/network-element/update")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_DeviceService_Update_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_NetworkElementService_Update_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_DeviceService_Update_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_NetworkElementService_Update_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -394,21 +394,21 @@ func RegisterDeviceServiceHandlerClient(ctx context.Context, mux *runtime.ServeM } var ( - pattern_DeviceService_Add_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"device", "create"}, "")) + pattern_NetworkElementService_Add_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"network-element", "create"}, "")) - pattern_DeviceService_Get_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"device"}, "")) + pattern_NetworkElementService_Get_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"network-element"}, "")) - pattern_DeviceService_GetAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"device", "all"}, "")) + pattern_NetworkElementService_GetAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"network-element", "all"}, "")) - pattern_DeviceService_Update_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"device", "update"}, "")) + pattern_NetworkElementService_Update_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"network-element", "update"}, "")) ) var ( - forward_DeviceService_Add_0 = runtime.ForwardResponseMessage + forward_NetworkElementService_Add_0 = runtime.ForwardResponseMessage - forward_DeviceService_Get_0 = runtime.ForwardResponseMessage + forward_NetworkElementService_Get_0 = runtime.ForwardResponseMessage - forward_DeviceService_GetAll_0 = runtime.ForwardResponseMessage + forward_NetworkElementService_GetAll_0 = runtime.ForwardResponseMessage - forward_DeviceService_Update_0 = runtime.ForwardResponseMessage + forward_NetworkElementService_Update_0 = runtime.ForwardResponseMessage ) diff --git a/api/go/gosdn/networkelement/networkelement_grpc.pb.go b/api/go/gosdn/networkelement/networkelement_grpc.pb.go new file mode 100644 index 0000000000000000000000000000000000000000..c73b569e984108d4922b5e7bdbad421b90dff3b5 --- /dev/null +++ b/api/go/gosdn/networkelement/networkelement_grpc.pb.go @@ -0,0 +1,209 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package networkelement + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// NetworkElementServiceClient is the client API for NetworkElementService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type NetworkElementServiceClient interface { + Add(ctx context.Context, in *AddNetworkElementRequest, opts ...grpc.CallOption) (*AddNetworkElementResponse, error) + Get(ctx context.Context, in *GetNetworkElementRequest, opts ...grpc.CallOption) (*GetNetworkElementResponse, error) + GetAll(ctx context.Context, in *GetAllNetworkElementRequest, opts ...grpc.CallOption) (*GetAllNetworkElementResponse, error) + Update(ctx context.Context, in *UpdateNetworkElementRequest, opts ...grpc.CallOption) (*UpdateNetworkElementResponse, error) +} + +type networkElementServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewNetworkElementServiceClient(cc grpc.ClientConnInterface) NetworkElementServiceClient { + return &networkElementServiceClient{cc} +} + +func (c *networkElementServiceClient) Add(ctx context.Context, in *AddNetworkElementRequest, opts ...grpc.CallOption) (*AddNetworkElementResponse, error) { + out := new(AddNetworkElementResponse) + err := c.cc.Invoke(ctx, "/gosdn.networkelement.NetworkElementService/Add", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *networkElementServiceClient) Get(ctx context.Context, in *GetNetworkElementRequest, opts ...grpc.CallOption) (*GetNetworkElementResponse, error) { + out := new(GetNetworkElementResponse) + err := c.cc.Invoke(ctx, "/gosdn.networkelement.NetworkElementService/Get", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *networkElementServiceClient) GetAll(ctx context.Context, in *GetAllNetworkElementRequest, opts ...grpc.CallOption) (*GetAllNetworkElementResponse, error) { + out := new(GetAllNetworkElementResponse) + err := c.cc.Invoke(ctx, "/gosdn.networkelement.NetworkElementService/GetAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *networkElementServiceClient) Update(ctx context.Context, in *UpdateNetworkElementRequest, opts ...grpc.CallOption) (*UpdateNetworkElementResponse, error) { + out := new(UpdateNetworkElementResponse) + err := c.cc.Invoke(ctx, "/gosdn.networkelement.NetworkElementService/Update", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// NetworkElementServiceServer is the server API for NetworkElementService service. +// All implementations must embed UnimplementedNetworkElementServiceServer +// for forward compatibility +type NetworkElementServiceServer interface { + Add(context.Context, *AddNetworkElementRequest) (*AddNetworkElementResponse, error) + Get(context.Context, *GetNetworkElementRequest) (*GetNetworkElementResponse, error) + GetAll(context.Context, *GetAllNetworkElementRequest) (*GetAllNetworkElementResponse, error) + Update(context.Context, *UpdateNetworkElementRequest) (*UpdateNetworkElementResponse, error) + mustEmbedUnimplementedNetworkElementServiceServer() +} + +// UnimplementedNetworkElementServiceServer must be embedded to have forward compatible implementations. +type UnimplementedNetworkElementServiceServer struct { +} + +func (UnimplementedNetworkElementServiceServer) Add(context.Context, *AddNetworkElementRequest) (*AddNetworkElementResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Add not implemented") +} +func (UnimplementedNetworkElementServiceServer) Get(context.Context, *GetNetworkElementRequest) (*GetNetworkElementResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") +} +func (UnimplementedNetworkElementServiceServer) GetAll(context.Context, *GetAllNetworkElementRequest) (*GetAllNetworkElementResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAll not implemented") +} +func (UnimplementedNetworkElementServiceServer) Update(context.Context, *UpdateNetworkElementRequest) (*UpdateNetworkElementResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Update not implemented") +} +func (UnimplementedNetworkElementServiceServer) mustEmbedUnimplementedNetworkElementServiceServer() {} + +// UnsafeNetworkElementServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to NetworkElementServiceServer will +// result in compilation errors. +type UnsafeNetworkElementServiceServer interface { + mustEmbedUnimplementedNetworkElementServiceServer() +} + +func RegisterNetworkElementServiceServer(s grpc.ServiceRegistrar, srv NetworkElementServiceServer) { + s.RegisterService(&NetworkElementService_ServiceDesc, srv) +} + +func _NetworkElementService_Add_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddNetworkElementRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NetworkElementServiceServer).Add(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gosdn.networkelement.NetworkElementService/Add", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NetworkElementServiceServer).Add(ctx, req.(*AddNetworkElementRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NetworkElementService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetNetworkElementRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NetworkElementServiceServer).Get(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gosdn.networkelement.NetworkElementService/Get", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NetworkElementServiceServer).Get(ctx, req.(*GetNetworkElementRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NetworkElementService_GetAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAllNetworkElementRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NetworkElementServiceServer).GetAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gosdn.networkelement.NetworkElementService/GetAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NetworkElementServiceServer).GetAll(ctx, req.(*GetAllNetworkElementRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NetworkElementService_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateNetworkElementRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NetworkElementServiceServer).Update(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gosdn.networkelement.NetworkElementService/Update", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NetworkElementServiceServer).Update(ctx, req.(*UpdateNetworkElementRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// NetworkElementService_ServiceDesc is the grpc.ServiceDesc for NetworkElementService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var NetworkElementService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "gosdn.networkelement.NetworkElementService", + HandlerType: (*NetworkElementServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Add", + Handler: _NetworkElementService_Add_Handler, + }, + { + MethodName: "Get", + Handler: _NetworkElementService_Get_Handler, + }, + { + MethodName: "GetAll", + Handler: _NetworkElementService_GetAll_Handler, + }, + { + MethodName: "Update", + Handler: _NetworkElementService_Update_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "gosdn/networkelement/networkelement.proto", +} diff --git a/api/go/gosdn/pnd/pnd.pb.go b/api/go/gosdn/pnd/pnd.pb.go index 56805359cdf83b9bc3b586f74396ef899a8ed18b..312077b0b9a59afc919ff3353be6573ff089fde3 100644 --- a/api/go/gosdn/pnd/pnd.pb.go +++ b/api/go/gosdn/pnd/pnd.pb.go @@ -390,7 +390,7 @@ func (StreamMode) EnumDescriptor() ([]byte, []int) { return file_gosdn_pnd_pnd_proto_rawDescGZIP(), []int{6} } -type GetOndListRequest struct { +type GetMneListRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -399,8 +399,8 @@ type GetOndListRequest struct { Pid string `protobuf:"bytes,2,opt,name=pid,proto3" json:"pid,omitempty"` } -func (x *GetOndListRequest) Reset() { - *x = GetOndListRequest{} +func (x *GetMneListRequest) Reset() { + *x = GetMneListRequest{} if protoimpl.UnsafeEnabled { mi := &file_gosdn_pnd_pnd_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -408,13 +408,13 @@ func (x *GetOndListRequest) Reset() { } } -func (x *GetOndListRequest) String() string { +func (x *GetMneListRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetOndListRequest) ProtoMessage() {} +func (*GetMneListRequest) ProtoMessage() {} -func (x *GetOndListRequest) ProtoReflect() protoreflect.Message { +func (x *GetMneListRequest) ProtoReflect() protoreflect.Message { mi := &file_gosdn_pnd_pnd_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -426,37 +426,37 @@ func (x *GetOndListRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetOndListRequest.ProtoReflect.Descriptor instead. -func (*GetOndListRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use GetMneListRequest.ProtoReflect.Descriptor instead. +func (*GetMneListRequest) Descriptor() ([]byte, []int) { return file_gosdn_pnd_pnd_proto_rawDescGZIP(), []int{0} } -func (x *GetOndListRequest) GetTimestamp() int64 { +func (x *GetMneListRequest) GetTimestamp() int64 { if x != nil { return x.Timestamp } return 0 } -func (x *GetOndListRequest) GetPid() string { +func (x *GetMneListRequest) GetPid() string { if x != nil { return x.Pid } return "" } -type GetOndRequest struct { +type GetMneRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Timestamp in nanoseconds since Epoch. - Did string `protobuf:"bytes,2,opt,name=did,proto3" json:"did,omitempty"` + Mneid string `protobuf:"bytes,2,opt,name=mneid,proto3" json:"mneid,omitempty"` Pid string `protobuf:"bytes,3,opt,name=pid,proto3" json:"pid,omitempty"` } -func (x *GetOndRequest) Reset() { - *x = GetOndRequest{} +func (x *GetMneRequest) Reset() { + *x = GetMneRequest{} if protoimpl.UnsafeEnabled { mi := &file_gosdn_pnd_pnd_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -464,13 +464,13 @@ func (x *GetOndRequest) Reset() { } } -func (x *GetOndRequest) String() string { +func (x *GetMneRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetOndRequest) ProtoMessage() {} +func (*GetMneRequest) ProtoMessage() {} -func (x *GetOndRequest) ProtoReflect() protoreflect.Message { +func (x *GetMneRequest) ProtoReflect() protoreflect.Message { mi := &file_gosdn_pnd_pnd_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -482,26 +482,26 @@ func (x *GetOndRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetOndRequest.ProtoReflect.Descriptor instead. -func (*GetOndRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use GetMneRequest.ProtoReflect.Descriptor instead. +func (*GetMneRequest) Descriptor() ([]byte, []int) { return file_gosdn_pnd_pnd_proto_rawDescGZIP(), []int{1} } -func (x *GetOndRequest) GetTimestamp() int64 { +func (x *GetMneRequest) GetTimestamp() int64 { if x != nil { return x.Timestamp } return 0 } -func (x *GetOndRequest) GetDid() string { +func (x *GetMneRequest) GetMneid() string { if x != nil { - return x.Did + return x.Mneid } return "" } -func (x *GetOndRequest) GetPid() string { +func (x *GetMneRequest) GetPid() string { if x != nil { return x.Pid } @@ -750,7 +750,7 @@ type GetPathRequest struct { unknownFields protoimpl.UnknownFields Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Timestamp in nanoseconds since Epoch. - Did string `protobuf:"bytes,2,opt,name=did,proto3" json:"did,omitempty"` + Mneid string `protobuf:"bytes,2,opt,name=mneid,proto3" json:"mneid,omitempty"` Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` Pid string `protobuf:"bytes,4,opt,name=pid,proto3" json:"pid,omitempty"` } @@ -794,9 +794,9 @@ func (x *GetPathRequest) GetTimestamp() int64 { return 0 } -func (x *GetPathRequest) GetDid() string { +func (x *GetPathRequest) GetMneid() string { if x != nil { - return x.Did + return x.Mneid } return "" } @@ -815,7 +815,7 @@ func (x *GetPathRequest) GetPid() string { return "" } -type GetOndResponse struct { +type GetMneResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -823,12 +823,12 @@ type GetOndResponse struct { Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Timestamp in nanoseconds since Epoch. // TODO: Check if this is really needed. Perhaps a reference to the PND's ID // is also sufficient. - Pnd *PrincipalNetworkDomain `protobuf:"bytes,2,opt,name=pnd,proto3" json:"pnd,omitempty"` - Ond *OrchestratedNetworkingDevice `protobuf:"bytes,3,opt,name=ond,proto3" json:"ond,omitempty"` + Pnd *PrincipalNetworkDomain `protobuf:"bytes,2,opt,name=pnd,proto3" json:"pnd,omitempty"` + Mne *ManagedNetworkElement `protobuf:"bytes,3,opt,name=mne,proto3" json:"mne,omitempty"` } -func (x *GetOndResponse) Reset() { - *x = GetOndResponse{} +func (x *GetMneResponse) Reset() { + *x = GetMneResponse{} if protoimpl.UnsafeEnabled { mi := &file_gosdn_pnd_pnd_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -836,13 +836,13 @@ func (x *GetOndResponse) Reset() { } } -func (x *GetOndResponse) String() string { +func (x *GetMneResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetOndResponse) ProtoMessage() {} +func (*GetMneResponse) ProtoMessage() {} -func (x *GetOndResponse) ProtoReflect() protoreflect.Message { +func (x *GetMneResponse) ProtoReflect() protoreflect.Message { mi := &file_gosdn_pnd_pnd_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -854,33 +854,33 @@ func (x *GetOndResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetOndResponse.ProtoReflect.Descriptor instead. -func (*GetOndResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use GetMneResponse.ProtoReflect.Descriptor instead. +func (*GetMneResponse) Descriptor() ([]byte, []int) { return file_gosdn_pnd_pnd_proto_rawDescGZIP(), []int{7} } -func (x *GetOndResponse) GetTimestamp() int64 { +func (x *GetMneResponse) GetTimestamp() int64 { if x != nil { return x.Timestamp } return 0 } -func (x *GetOndResponse) GetPnd() *PrincipalNetworkDomain { +func (x *GetMneResponse) GetPnd() *PrincipalNetworkDomain { if x != nil { return x.Pnd } return nil } -func (x *GetOndResponse) GetOnd() *OrchestratedNetworkingDevice { +func (x *GetMneResponse) GetMne() *ManagedNetworkElement { if x != nil { - return x.Ond + return x.Mne } return nil } -type GetOndListResponse struct { +type GetMneListResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -888,12 +888,12 @@ type GetOndListResponse struct { Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Timestamp in nanoseconds since Epoch. // TODO: Check if this is really needed. Perhaps a reference to the PND's ID // is also sufficient. - Pnd *PrincipalNetworkDomain `protobuf:"bytes,2,opt,name=pnd,proto3" json:"pnd,omitempty"` - Ond []*OrchestratedNetworkingDevice `protobuf:"bytes,3,rep,name=ond,proto3" json:"ond,omitempty"` + Pnd *PrincipalNetworkDomain `protobuf:"bytes,2,opt,name=pnd,proto3" json:"pnd,omitempty"` + Mne []*ManagedNetworkElement `protobuf:"bytes,3,rep,name=mne,proto3" json:"mne,omitempty"` } -func (x *GetOndListResponse) Reset() { - *x = GetOndListResponse{} +func (x *GetMneListResponse) Reset() { + *x = GetMneListResponse{} if protoimpl.UnsafeEnabled { mi := &file_gosdn_pnd_pnd_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -901,13 +901,13 @@ func (x *GetOndListResponse) Reset() { } } -func (x *GetOndListResponse) String() string { +func (x *GetMneListResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetOndListResponse) ProtoMessage() {} +func (*GetMneListResponse) ProtoMessage() {} -func (x *GetOndListResponse) ProtoReflect() protoreflect.Message { +func (x *GetMneListResponse) ProtoReflect() protoreflect.Message { mi := &file_gosdn_pnd_pnd_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -919,33 +919,33 @@ func (x *GetOndListResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetOndListResponse.ProtoReflect.Descriptor instead. -func (*GetOndListResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use GetMneListResponse.ProtoReflect.Descriptor instead. +func (*GetMneListResponse) Descriptor() ([]byte, []int) { return file_gosdn_pnd_pnd_proto_rawDescGZIP(), []int{8} } -func (x *GetOndListResponse) GetTimestamp() int64 { +func (x *GetMneListResponse) GetTimestamp() int64 { if x != nil { return x.Timestamp } return 0 } -func (x *GetOndListResponse) GetPnd() *PrincipalNetworkDomain { +func (x *GetMneListResponse) GetPnd() *PrincipalNetworkDomain { if x != nil { return x.Pnd } return nil } -func (x *GetOndListResponse) GetOnd() []*OrchestratedNetworkingDevice { +func (x *GetMneListResponse) GetMne() []*ManagedNetworkElement { if x != nil { - return x.Ond + return x.Mne } return nil } -type GetFlattenedOndListResponse struct { +type GetFlattenedMneListResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -953,12 +953,12 @@ type GetFlattenedOndListResponse struct { Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Timestamp in nanoseconds since Epoch. // TODO: Check if this is really needed. Perhaps a reference to the PND's ID // is also sufficient. - Pnd *PrincipalNetworkDomain `protobuf:"bytes,2,opt,name=pnd,proto3" json:"pnd,omitempty"` - Ond []*FlattenedOrchestratedNetworkingDevice `protobuf:"bytes,3,rep,name=ond,proto3" json:"ond,omitempty"` + Pnd *PrincipalNetworkDomain `protobuf:"bytes,2,opt,name=pnd,proto3" json:"pnd,omitempty"` + Mne []*FlattenedManagedNetworkElement `protobuf:"bytes,3,rep,name=mne,proto3" json:"mne,omitempty"` } -func (x *GetFlattenedOndListResponse) Reset() { - *x = GetFlattenedOndListResponse{} +func (x *GetFlattenedMneListResponse) Reset() { + *x = GetFlattenedMneListResponse{} if protoimpl.UnsafeEnabled { mi := &file_gosdn_pnd_pnd_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -966,13 +966,13 @@ func (x *GetFlattenedOndListResponse) Reset() { } } -func (x *GetFlattenedOndListResponse) String() string { +func (x *GetFlattenedMneListResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetFlattenedOndListResponse) ProtoMessage() {} +func (*GetFlattenedMneListResponse) ProtoMessage() {} -func (x *GetFlattenedOndListResponse) ProtoReflect() protoreflect.Message { +func (x *GetFlattenedMneListResponse) ProtoReflect() protoreflect.Message { mi := &file_gosdn_pnd_pnd_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -984,28 +984,28 @@ func (x *GetFlattenedOndListResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetFlattenedOndListResponse.ProtoReflect.Descriptor instead. -func (*GetFlattenedOndListResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use GetFlattenedMneListResponse.ProtoReflect.Descriptor instead. +func (*GetFlattenedMneListResponse) Descriptor() ([]byte, []int) { return file_gosdn_pnd_pnd_proto_rawDescGZIP(), []int{9} } -func (x *GetFlattenedOndListResponse) GetTimestamp() int64 { +func (x *GetFlattenedMneListResponse) GetTimestamp() int64 { if x != nil { return x.Timestamp } return 0 } -func (x *GetFlattenedOndListResponse) GetPnd() *PrincipalNetworkDomain { +func (x *GetFlattenedMneListResponse) GetPnd() *PrincipalNetworkDomain { if x != nil { return x.Pnd } return nil } -func (x *GetFlattenedOndListResponse) GetOnd() []*FlattenedOrchestratedNetworkingDevice { +func (x *GetFlattenedMneListResponse) GetMne() []*FlattenedManagedNetworkElement { if x != nil { - return x.Ond + return x.Mne } return nil } @@ -1148,8 +1148,8 @@ type GetPathResponse struct { Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Timestamp in nanoseconds since Epoch. // TODO: Check if this is really needed. Perhaps a reference to the PND's ID // is also sufficient. - Pnd *PrincipalNetworkDomain `protobuf:"bytes,2,opt,name=pnd,proto3" json:"pnd,omitempty"` - Device []*gnmi.Notification `protobuf:"bytes,3,rep,name=device,proto3" json:"device,omitempty"` + Pnd *PrincipalNetworkDomain `protobuf:"bytes,2,opt,name=pnd,proto3" json:"pnd,omitempty"` + MneNotification []*gnmi.Notification `protobuf:"bytes,3,rep,name=mne_notification,json=mneNotification,proto3" json:"mne_notification,omitempty"` } func (x *GetPathResponse) Reset() { @@ -1198,9 +1198,9 @@ func (x *GetPathResponse) GetPnd() *PrincipalNetworkDomain { return nil } -func (x *GetPathResponse) GetDevice() []*gnmi.Notification { +func (x *GetPathResponse) GetMneNotification() []*gnmi.Notification { if x != nil { - return x.Device + return x.MneNotification } return nil } @@ -1398,19 +1398,19 @@ func (x *PrincipalNetworkDomain) GetDescription() string { return "" } -type OrchestratedNetworkingDevice struct { +type ManagedNetworkElement struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Device []*gnmi.Notification `protobuf:"bytes,3,rep,name=device,proto3" json:"device,omitempty"` - Sbi *southbound.SouthboundInterface `protobuf:"bytes,4,opt,name=sbi,proto3" json:"sbi,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + MneNotification []*gnmi.Notification `protobuf:"bytes,3,rep,name=mne_notification,json=mneNotification,proto3" json:"mne_notification,omitempty"` + Sbi *southbound.SouthboundInterface `protobuf:"bytes,4,opt,name=sbi,proto3" json:"sbi,omitempty"` } -func (x *OrchestratedNetworkingDevice) Reset() { - *x = OrchestratedNetworkingDevice{} +func (x *ManagedNetworkElement) Reset() { + *x = ManagedNetworkElement{} if protoimpl.UnsafeEnabled { mi := &file_gosdn_pnd_pnd_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1418,13 +1418,13 @@ func (x *OrchestratedNetworkingDevice) Reset() { } } -func (x *OrchestratedNetworkingDevice) String() string { +func (x *ManagedNetworkElement) String() string { return protoimpl.X.MessageStringOf(x) } -func (*OrchestratedNetworkingDevice) ProtoMessage() {} +func (*ManagedNetworkElement) ProtoMessage() {} -func (x *OrchestratedNetworkingDevice) ProtoReflect() protoreflect.Message { +func (x *ManagedNetworkElement) ProtoReflect() protoreflect.Message { mi := &file_gosdn_pnd_pnd_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1436,40 +1436,40 @@ func (x *OrchestratedNetworkingDevice) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use OrchestratedNetworkingDevice.ProtoReflect.Descriptor instead. -func (*OrchestratedNetworkingDevice) Descriptor() ([]byte, []int) { +// Deprecated: Use ManagedNetworkElement.ProtoReflect.Descriptor instead. +func (*ManagedNetworkElement) Descriptor() ([]byte, []int) { return file_gosdn_pnd_pnd_proto_rawDescGZIP(), []int{16} } -func (x *OrchestratedNetworkingDevice) GetId() string { +func (x *ManagedNetworkElement) GetId() string { if x != nil { return x.Id } return "" } -func (x *OrchestratedNetworkingDevice) GetName() string { +func (x *ManagedNetworkElement) GetName() string { if x != nil { return x.Name } return "" } -func (x *OrchestratedNetworkingDevice) GetDevice() []*gnmi.Notification { +func (x *ManagedNetworkElement) GetMneNotification() []*gnmi.Notification { if x != nil { - return x.Device + return x.MneNotification } return nil } -func (x *OrchestratedNetworkingDevice) GetSbi() *southbound.SouthboundInterface { +func (x *ManagedNetworkElement) GetSbi() *southbound.SouthboundInterface { if x != nil { return x.Sbi } return nil } -type FlattenedOrchestratedNetworkingDevice struct { +type FlattenedManagedNetworkElement struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -1479,8 +1479,8 @@ type FlattenedOrchestratedNetworkingDevice struct { Sbi string `protobuf:"bytes,3,opt,name=sbi,proto3" json:"sbi,omitempty"` } -func (x *FlattenedOrchestratedNetworkingDevice) Reset() { - *x = FlattenedOrchestratedNetworkingDevice{} +func (x *FlattenedManagedNetworkElement) Reset() { + *x = FlattenedManagedNetworkElement{} if protoimpl.UnsafeEnabled { mi := &file_gosdn_pnd_pnd_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1488,13 +1488,13 @@ func (x *FlattenedOrchestratedNetworkingDevice) Reset() { } } -func (x *FlattenedOrchestratedNetworkingDevice) String() string { +func (x *FlattenedManagedNetworkElement) String() string { return protoimpl.X.MessageStringOf(x) } -func (*FlattenedOrchestratedNetworkingDevice) ProtoMessage() {} +func (*FlattenedManagedNetworkElement) ProtoMessage() {} -func (x *FlattenedOrchestratedNetworkingDevice) ProtoReflect() protoreflect.Message { +func (x *FlattenedManagedNetworkElement) ProtoReflect() protoreflect.Message { mi := &file_gosdn_pnd_pnd_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1506,26 +1506,26 @@ func (x *FlattenedOrchestratedNetworkingDevice) ProtoReflect() protoreflect.Mess return mi.MessageOf(x) } -// Deprecated: Use FlattenedOrchestratedNetworkingDevice.ProtoReflect.Descriptor instead. -func (*FlattenedOrchestratedNetworkingDevice) Descriptor() ([]byte, []int) { +// Deprecated: Use FlattenedManagedNetworkElement.ProtoReflect.Descriptor instead. +func (*FlattenedManagedNetworkElement) Descriptor() ([]byte, []int) { return file_gosdn_pnd_pnd_proto_rawDescGZIP(), []int{17} } -func (x *FlattenedOrchestratedNetworkingDevice) GetId() string { +func (x *FlattenedManagedNetworkElement) GetId() string { if x != nil { return x.Id } return "" } -func (x *FlattenedOrchestratedNetworkingDevice) GetName() string { +func (x *FlattenedManagedNetworkElement) GetName() string { if x != nil { return x.Name } return "" } -func (x *FlattenedOrchestratedNetworkingDevice) GetSbi() string { +func (x *FlattenedManagedNetworkElement) GetSbi() string { if x != nil { return x.Sbi } @@ -1603,18 +1603,18 @@ func (x *Change) GetDiff() *gnmi.Notification { return nil } -type SetOndListRequest struct { +type SetMneListRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Timestamp in nanoseconds since Epoch. - Ond []*SetOnd `protobuf:"bytes,2,rep,name=ond,proto3" json:"ond,omitempty"` + Mne []*SetMne `protobuf:"bytes,2,rep,name=mne,proto3" json:"mne,omitempty"` Pid string `protobuf:"bytes,3,opt,name=pid,proto3" json:"pid,omitempty"` } -func (x *SetOndListRequest) Reset() { - *x = SetOndListRequest{} +func (x *SetMneListRequest) Reset() { + *x = SetMneListRequest{} if protoimpl.UnsafeEnabled { mi := &file_gosdn_pnd_pnd_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1622,13 +1622,13 @@ func (x *SetOndListRequest) Reset() { } } -func (x *SetOndListRequest) String() string { +func (x *SetMneListRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*SetOndListRequest) ProtoMessage() {} +func (*SetMneListRequest) ProtoMessage() {} -func (x *SetOndListRequest) ProtoReflect() protoreflect.Message { +func (x *SetMneListRequest) ProtoReflect() protoreflect.Message { mi := &file_gosdn_pnd_pnd_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1640,26 +1640,26 @@ func (x *SetOndListRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use SetOndListRequest.ProtoReflect.Descriptor instead. -func (*SetOndListRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use SetMneListRequest.ProtoReflect.Descriptor instead. +func (*SetMneListRequest) Descriptor() ([]byte, []int) { return file_gosdn_pnd_pnd_proto_rawDescGZIP(), []int{19} } -func (x *SetOndListRequest) GetTimestamp() int64 { +func (x *SetMneListRequest) GetTimestamp() int64 { if x != nil { return x.Timestamp } return 0 } -func (x *SetOndListRequest) GetOnd() []*SetOnd { +func (x *SetMneListRequest) GetMne() []*SetMne { if x != nil { - return x.Ond + return x.Mne } return nil } -func (x *SetOndListRequest) GetPid() string { +func (x *SetMneListRequest) GetPid() string { if x != nil { return x.Pid } @@ -1861,7 +1861,7 @@ type ChangeRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Did string `protobuf:"bytes,1,opt,name=did,proto3" json:"did,omitempty"` + Mneid string `protobuf:"bytes,1,opt,name=mneid,proto3" json:"mneid,omitempty"` Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` ApiOp ApiOperation `protobuf:"varint,4,opt,name=api_op,json=apiOp,proto3,enum=gosdn.pnd.ApiOperation" json:"api_op,omitempty"` @@ -1899,9 +1899,9 @@ func (*ChangeRequest) Descriptor() ([]byte, []int) { return file_gosdn_pnd_pnd_proto_rawDescGZIP(), []int{23} } -func (x *ChangeRequest) GetDid() string { +func (x *ChangeRequest) GetMneid() string { if x != nil { - return x.Did + return x.Mneid } return "" } @@ -1927,19 +1927,19 @@ func (x *ChangeRequest) GetApiOp() ApiOperation { return ApiOperation_API_OPERATION_UNSPECIFIED } -type SetOnd struct { +type SetMne struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` Sbi *southbound.SouthboundInterface `protobuf:"bytes,2,opt,name=sbi,proto3" json:"sbi,omitempty"` - DeviceName string `protobuf:"bytes,3,opt,name=device_name,json=deviceName,proto3" json:"device_name,omitempty"` + MneName string `protobuf:"bytes,3,opt,name=mne_name,json=mneName,proto3" json:"mne_name,omitempty"` TransportOption *transport.TransportOption `protobuf:"bytes,4,opt,name=transport_option,json=transportOption,proto3" json:"transport_option,omitempty"` } -func (x *SetOnd) Reset() { - *x = SetOnd{} +func (x *SetMne) Reset() { + *x = SetMne{} if protoimpl.UnsafeEnabled { mi := &file_gosdn_pnd_pnd_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1947,13 +1947,13 @@ func (x *SetOnd) Reset() { } } -func (x *SetOnd) String() string { +func (x *SetMne) String() string { return protoimpl.X.MessageStringOf(x) } -func (*SetOnd) ProtoMessage() {} +func (*SetMne) ProtoMessage() {} -func (x *SetOnd) ProtoReflect() protoreflect.Message { +func (x *SetMne) ProtoReflect() protoreflect.Message { mi := &file_gosdn_pnd_pnd_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1965,33 +1965,33 @@ func (x *SetOnd) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use SetOnd.ProtoReflect.Descriptor instead. -func (*SetOnd) Descriptor() ([]byte, []int) { +// Deprecated: Use SetMne.ProtoReflect.Descriptor instead. +func (*SetMne) Descriptor() ([]byte, []int) { return file_gosdn_pnd_pnd_proto_rawDescGZIP(), []int{24} } -func (x *SetOnd) GetAddress() string { +func (x *SetMne) GetAddress() string { if x != nil { return x.Address } return "" } -func (x *SetOnd) GetSbi() *southbound.SouthboundInterface { +func (x *SetMne) GetSbi() *southbound.SouthboundInterface { if x != nil { return x.Sbi } return nil } -func (x *SetOnd) GetDeviceName() string { +func (x *SetMne) GetMneName() string { if x != nil { - return x.DeviceName + return x.MneName } return "" } -func (x *SetOnd) GetTransportOption() *transport.TransportOption { +func (x *SetMne) GetTransportOption() *transport.TransportOption { if x != nil { return x.TransportOption } @@ -2163,7 +2163,7 @@ func (x *SetResponse) GetStatus() Status { return Status_STATUS_UNSPECIFIED } -type SetOndListResponse struct { +type SetMneListResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -2173,8 +2173,8 @@ type SetOndListResponse struct { Responses []*SetResponse `protobuf:"bytes,3,rep,name=responses,proto3" json:"responses,omitempty"` } -func (x *SetOndListResponse) Reset() { - *x = SetOndListResponse{} +func (x *SetMneListResponse) Reset() { + *x = SetMneListResponse{} if protoimpl.UnsafeEnabled { mi := &file_gosdn_pnd_pnd_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2182,13 +2182,13 @@ func (x *SetOndListResponse) Reset() { } } -func (x *SetOndListResponse) String() string { +func (x *SetMneListResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*SetOndListResponse) ProtoMessage() {} +func (*SetMneListResponse) ProtoMessage() {} -func (x *SetOndListResponse) ProtoReflect() protoreflect.Message { +func (x *SetMneListResponse) ProtoReflect() protoreflect.Message { mi := &file_gosdn_pnd_pnd_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2200,26 +2200,26 @@ func (x *SetOndListResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use SetOndListResponse.ProtoReflect.Descriptor instead. -func (*SetOndListResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use SetMneListResponse.ProtoReflect.Descriptor instead. +func (*SetMneListResponse) Descriptor() ([]byte, []int) { return file_gosdn_pnd_pnd_proto_rawDescGZIP(), []int{28} } -func (x *SetOndListResponse) GetTimestamp() int64 { +func (x *SetMneListResponse) GetTimestamp() int64 { if x != nil { return x.Timestamp } return 0 } -func (x *SetOndListResponse) GetStatus() Status { +func (x *SetMneListResponse) GetStatus() Status { if x != nil { return x.Status } return Status_STATUS_UNSPECIFIED } -func (x *SetOndListResponse) GetResponses() []*SetResponse { +func (x *SetMneListResponse) GetResponses() []*SetResponse { if x != nil { return x.Responses } @@ -2470,18 +2470,18 @@ func (x *SetPathListResponse) GetResponses() []*SetResponse { return nil } -type DeleteOndRequest struct { +type DeleteMneRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Timestamp in nanoseconds since Epoch. Pid string `protobuf:"bytes,2,opt,name=pid,proto3" json:"pid,omitempty"` - Did string `protobuf:"bytes,3,opt,name=did,proto3" json:"did,omitempty"` + Mneid string `protobuf:"bytes,3,opt,name=mneid,proto3" json:"mneid,omitempty"` } -func (x *DeleteOndRequest) Reset() { - *x = DeleteOndRequest{} +func (x *DeleteMneRequest) Reset() { + *x = DeleteMneRequest{} if protoimpl.UnsafeEnabled { mi := &file_gosdn_pnd_pnd_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2489,13 +2489,13 @@ func (x *DeleteOndRequest) Reset() { } } -func (x *DeleteOndRequest) String() string { +func (x *DeleteMneRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*DeleteOndRequest) ProtoMessage() {} +func (*DeleteMneRequest) ProtoMessage() {} -func (x *DeleteOndRequest) ProtoReflect() protoreflect.Message { +func (x *DeleteMneRequest) ProtoReflect() protoreflect.Message { mi := &file_gosdn_pnd_pnd_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2507,33 +2507,33 @@ func (x *DeleteOndRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use DeleteOndRequest.ProtoReflect.Descriptor instead. -func (*DeleteOndRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use DeleteMneRequest.ProtoReflect.Descriptor instead. +func (*DeleteMneRequest) Descriptor() ([]byte, []int) { return file_gosdn_pnd_pnd_proto_rawDescGZIP(), []int{33} } -func (x *DeleteOndRequest) GetTimestamp() int64 { +func (x *DeleteMneRequest) GetTimestamp() int64 { if x != nil { return x.Timestamp } return 0 } -func (x *DeleteOndRequest) GetPid() string { +func (x *DeleteMneRequest) GetPid() string { if x != nil { return x.Pid } return "" } -func (x *DeleteOndRequest) GetDid() string { +func (x *DeleteMneRequest) GetMneid() string { if x != nil { - return x.Did + return x.Mneid } return "" } -type DeleteOndResponse struct { +type DeleteMneResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -2542,8 +2542,8 @@ type DeleteOndResponse struct { Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.pnd.Status" json:"status,omitempty"` } -func (x *DeleteOndResponse) Reset() { - *x = DeleteOndResponse{} +func (x *DeleteMneResponse) Reset() { + *x = DeleteMneResponse{} if protoimpl.UnsafeEnabled { mi := &file_gosdn_pnd_pnd_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2551,13 +2551,13 @@ func (x *DeleteOndResponse) Reset() { } } -func (x *DeleteOndResponse) String() string { +func (x *DeleteMneResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*DeleteOndResponse) ProtoMessage() {} +func (*DeleteMneResponse) ProtoMessage() {} -func (x *DeleteOndResponse) ProtoReflect() protoreflect.Message { +func (x *DeleteMneResponse) ProtoReflect() protoreflect.Message { mi := &file_gosdn_pnd_pnd_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2569,19 +2569,19 @@ func (x *DeleteOndResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use DeleteOndResponse.ProtoReflect.Descriptor instead. -func (*DeleteOndResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use DeleteMneResponse.ProtoReflect.Descriptor instead. +func (*DeleteMneResponse) Descriptor() ([]byte, []int) { return file_gosdn_pnd_pnd_proto_rawDescGZIP(), []int{34} } -func (x *DeleteOndResponse) GetTimestamp() int64 { +func (x *DeleteMneResponse) GetTimestamp() int64 { if x != nil { return x.Timestamp } return 0 } -func (x *DeleteOndResponse) GetStatus() Status { +func (x *DeleteMneResponse) GetStatus() Status { if x != nil { return x.Status } @@ -2594,7 +2594,7 @@ type SubscribePathRequest struct { unknownFields protoimpl.UnknownFields Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Timestamp in nanoseconds since Epoch. - Did string `protobuf:"bytes,2,opt,name=did,proto3" json:"did,omitempty"` + Mneid string `protobuf:"bytes,2,opt,name=mneid,proto3" json:"mneid,omitempty"` Pid string `protobuf:"bytes,3,opt,name=pid,proto3" json:"pid,omitempty"` Sublist *SubscriptionList `protobuf:"bytes,4,opt,name=sublist,proto3" json:"sublist,omitempty"` } @@ -2638,9 +2638,9 @@ func (x *SubscribePathRequest) GetTimestamp() int64 { return 0 } -func (x *SubscribePathRequest) GetDid() string { +func (x *SubscribePathRequest) GetMneid() string { if x != nil { - return x.Did + return x.Mneid } return "" } @@ -2723,7 +2723,7 @@ type Subscription struct { Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` StreamMode StreamMode `protobuf:"varint,2,opt,name=stream_mode,json=streamMode,proto3,enum=gosdn.pnd.StreamMode" json:"stream_mode,omitempty"` - SampleInterval uint64 `protobuf:"varint,3,opt,name=sample_interval,json=sampleInterval,proto3" json:"sample_interval,omitempty"` // ns between samples in SAMPLE mode. + SampleInterval uint64 `protobuf:"varint,3,opt,name=sample_interval,json=sampleInterval,proto3" json:"sample_interval,omitempty"` // time in ns between samples in SAMPLE mode. } func (x *Subscription) Reset() { @@ -2784,9 +2784,9 @@ type SubscribePathResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Timestamp in nanoseconds since Epoch. - Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.pnd.Status" json:"status,omitempty"` - Device []*gnmi.Notification `protobuf:"bytes,3,rep,name=device,proto3" json:"device,omitempty"` + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Timestamp in nanoseconds since Epoch. + Status Status `protobuf:"varint,2,opt,name=status,proto3,enum=gosdn.pnd.Status" json:"status,omitempty"` + MneNotification []*gnmi.Notification `protobuf:"bytes,3,rep,name=mne_notification,json=mneNotification,proto3" json:"mne_notification,omitempty"` } func (x *SubscribePathResponse) Reset() { @@ -2835,9 +2835,9 @@ func (x *SubscribePathResponse) GetStatus() Status { return Status_STATUS_UNSPECIFIED } -func (x *SubscribePathResponse) GetDevice() []*gnmi.Notification { +func (x *SubscribePathResponse) GetMneNotification() []*gnmi.Notification { if x != nil { - return x.Device + return x.MneNotification } return nil } @@ -2861,227 +2861,218 @@ var file_gosdn_pnd_pnd_proto_rawDesc = []byte{ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x43, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4f, 0x6e, 0x64, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x43, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4d, 0x6e, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x69, 0x64, 0x22, 0x51, 0x0a, 0x0d, 0x47, - 0x65, 0x74, 0x4f, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x69, 0x64, 0x22, 0x55, 0x0a, 0x0d, 0x47, + 0x65, 0x74, 0x4d, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, - 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x69, 0x64, 0x22, 0x43, - 0x0a, 0x11, 0x47, 0x65, 0x74, 0x53, 0x62, 0x69, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x70, 0x69, 0x64, 0x22, 0x51, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x53, 0x62, 0x69, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x73, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x70, 0x69, 0x64, 0x22, 0x46, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, - 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x10, 0x0a, 0x03, - 0x70, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x69, 0x64, 0x22, 0x56, - 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6e, + 0x65, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x6e, 0x65, 0x69, 0x64, + 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, + 0x69, 0x64, 0x22, 0x43, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x53, 0x62, 0x69, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x70, 0x69, 0x64, 0x22, 0x51, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x53, 0x62, + 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x69, 0x64, 0x22, 0x46, 0x0a, 0x14, 0x47, 0x65, + 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x12, 0x12, 0x0a, 0x04, 0x63, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, - 0x63, 0x75, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x70, 0x69, 0x64, 0x22, 0x66, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x74, - 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x10, 0x0a, 0x03, - 0x70, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x69, 0x64, 0x22, 0x9e, - 0x01, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4f, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, - 0x33, 0x0a, 0x03, 0x70, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, - 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, - 0x61, 0x6c, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, - 0x03, 0x70, 0x6e, 0x64, 0x12, 0x39, 0x0a, 0x03, 0x6f, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x27, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x4f, 0x72, - 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x64, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, - 0x6b, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x03, 0x6f, 0x6e, 0x64, 0x22, - 0xa2, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x4f, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, + 0x69, 0x64, 0x22, 0x56, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x12, 0x33, 0x0a, 0x03, 0x70, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x50, 0x72, - 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x44, 0x6f, - 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x03, 0x70, 0x6e, 0x64, 0x12, 0x39, 0x0a, 0x03, 0x6f, 0x6e, 0x64, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, - 0x6e, 0x64, 0x2e, 0x4f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x64, 0x4e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, - 0x03, 0x6f, 0x6e, 0x64, 0x22, 0xb4, 0x01, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x46, 0x6c, 0x61, 0x74, - 0x74, 0x65, 0x6e, 0x65, 0x64, 0x4f, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x12, 0x33, 0x0a, 0x03, 0x70, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x21, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x50, 0x72, 0x69, 0x6e, - 0x63, 0x69, 0x70, 0x61, 0x6c, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x44, 0x6f, 0x6d, 0x61, - 0x69, 0x6e, 0x52, 0x03, 0x70, 0x6e, 0x64, 0x12, 0x42, 0x0a, 0x03, 0x6f, 0x6e, 0x64, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, - 0x2e, 0x46, 0x6c, 0x61, 0x74, 0x74, 0x65, 0x6e, 0x65, 0x64, 0x4f, 0x72, 0x63, 0x68, 0x65, 0x73, - 0x74, 0x72, 0x61, 0x74, 0x65, 0x64, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, - 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x03, 0x6f, 0x6e, 0x64, 0x22, 0x9c, 0x01, 0x0a, 0x0e, - 0x47, 0x65, 0x74, 0x53, 0x62, 0x69, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, + 0x74, 0x61, 0x6d, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x04, 0x63, 0x75, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x69, 0x64, 0x22, 0x6a, 0x0a, 0x0e, 0x47, 0x65, + 0x74, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6e, + 0x65, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x6e, 0x65, 0x69, 0x64, + 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x70, 0x61, 0x74, 0x68, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x70, 0x69, 0x64, 0x22, 0x97, 0x01, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4d, 0x6e, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x33, 0x0a, 0x03, 0x70, 0x6e, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, + 0x2e, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x03, 0x70, 0x6e, 0x64, 0x12, 0x32, 0x0a, 0x03, + 0x6d, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x6f, 0x73, 0x64, + 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x4e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x03, 0x6d, 0x6e, 0x65, + 0x22, 0x9b, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x4d, 0x6e, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x33, 0x0a, 0x03, 0x70, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x50, + 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x44, + 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x03, 0x70, 0x6e, 0x64, 0x12, 0x32, 0x0a, 0x03, 0x6d, 0x6e, + 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, + 0x70, 0x6e, 0x64, 0x2e, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x4e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x03, 0x6d, 0x6e, 0x65, 0x22, 0xad, + 0x01, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x46, 0x6c, 0x61, 0x74, 0x74, 0x65, 0x6e, 0x65, 0x64, 0x4d, + 0x6e, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x33, 0x0a, 0x03, 0x70, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x03, 0x70, 0x6e, - 0x64, 0x12, 0x37, 0x0a, 0x03, 0x73, 0x62, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, - 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x62, 0x6f, 0x75, 0x6e, - 0x64, 0x2e, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x49, 0x6e, 0x74, 0x65, - 0x72, 0x66, 0x61, 0x63, 0x65, 0x52, 0x03, 0x73, 0x62, 0x69, 0x22, 0xa0, 0x01, 0x0a, 0x12, 0x47, - 0x65, 0x74, 0x53, 0x62, 0x69, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x64, 0x12, 0x3b, 0x0a, 0x03, 0x6d, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, + 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x46, 0x6c, 0x61, 0x74, 0x74, + 0x65, 0x6e, 0x65, 0x64, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x4e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x03, 0x6d, 0x6e, 0x65, 0x22, 0x9c, + 0x01, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x53, 0x62, 0x69, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x33, 0x0a, 0x03, 0x70, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, - 0x03, 0x70, 0x6e, 0x64, 0x12, 0x37, 0x0a, 0x03, 0x73, 0x62, 0x69, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x03, 0x70, 0x6e, 0x64, 0x12, 0x37, 0x0a, 0x03, 0x73, 0x62, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x49, - 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x52, 0x03, 0x73, 0x62, 0x69, 0x22, 0x90, 0x01, - 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, - 0x33, 0x0a, 0x03, 0x70, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, - 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, - 0x61, 0x6c, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, - 0x03, 0x70, 0x6e, 0x64, 0x12, 0x2a, 0x0a, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6e, 0x6d, 0x69, 0x2e, 0x4e, 0x6f, 0x74, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, - 0x22, 0x91, 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x12, 0x33, 0x0a, 0x03, 0x70, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x50, 0x72, - 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x44, 0x6f, - 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x03, 0x70, 0x6e, 0x64, 0x12, 0x29, 0x0a, 0x06, 0x63, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x73, 0x64, - 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x06, 0x63, 0x68, - 0x61, 0x6e, 0x67, 0x65, 0x22, 0x95, 0x01, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, - 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, - 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x33, 0x0a, 0x03, - 0x70, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x73, 0x64, - 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x4e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x03, 0x70, 0x6e, - 0x64, 0x12, 0x29, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x43, 0x68, - 0x61, 0x6e, 0x67, 0x65, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x22, 0x5e, 0x0a, 0x16, - 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, - 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xa7, 0x01, 0x0a, - 0x1c, 0x4f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x64, 0x4e, 0x65, 0x74, - 0x77, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x52, 0x03, 0x73, 0x62, 0x69, 0x22, 0xa0, 0x01, + 0x0a, 0x12, 0x47, 0x65, 0x74, 0x53, 0x62, 0x69, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x12, 0x33, 0x0a, 0x03, 0x70, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x21, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x50, 0x72, 0x69, 0x6e, + 0x63, 0x69, 0x70, 0x61, 0x6c, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x44, 0x6f, 0x6d, 0x61, + 0x69, 0x6e, 0x52, 0x03, 0x70, 0x6e, 0x64, 0x12, 0x37, 0x0a, 0x03, 0x73, 0x62, 0x69, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x73, 0x6f, 0x75, + 0x74, 0x68, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x62, 0x6f, 0x75, + 0x6e, 0x64, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x52, 0x03, 0x73, 0x62, 0x69, + 0x22, 0xa3, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x12, 0x33, 0x0a, 0x03, 0x70, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x21, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x50, 0x72, 0x69, 0x6e, + 0x63, 0x69, 0x70, 0x61, 0x6c, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x44, 0x6f, 0x6d, 0x61, + 0x69, 0x6e, 0x52, 0x03, 0x70, 0x6e, 0x64, 0x12, 0x3d, 0x0a, 0x10, 0x6d, 0x6e, 0x65, 0x5f, 0x6e, + 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6e, 0x6d, 0x69, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x37, 0x0a, - 0x03, 0x73, 0x62, 0x69, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x73, - 0x64, 0x6e, 0x2e, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x53, 0x6f, - 0x75, 0x74, 0x68, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, - 0x65, 0x52, 0x03, 0x73, 0x62, 0x69, 0x22, 0x5d, 0x0a, 0x25, 0x46, 0x6c, 0x61, 0x74, 0x74, 0x65, - 0x6e, 0x65, 0x64, 0x4f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x64, 0x4e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x62, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x73, 0x62, 0x69, 0x22, 0x80, 0x01, 0x0a, 0x06, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x10, 0x0a, 0x03, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x61, - 0x67, 0x65, 0x12, 0x2c, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x43, 0x68, - 0x61, 0x6e, 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x12, 0x26, 0x0a, 0x04, 0x64, 0x69, 0x66, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, - 0x2e, 0x67, 0x6e, 0x6d, 0x69, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x04, 0x64, 0x69, 0x66, 0x66, 0x22, 0x68, 0x0a, 0x11, 0x53, 0x65, 0x74, 0x4f, - 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, - 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x23, 0x0a, 0x03, 0x6f, - 0x6e, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, - 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x65, 0x74, 0x4f, 0x6e, 0x64, 0x52, 0x03, 0x6f, 0x6e, 0x64, - 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, - 0x69, 0x64, 0x22, 0x68, 0x0a, 0x11, 0x53, 0x65, 0x74, 0x53, 0x62, 0x69, 0x4c, 0x69, 0x73, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x23, 0x0a, 0x03, 0x73, 0x62, 0x69, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, - 0x65, 0x74, 0x53, 0x62, 0x69, 0x52, 0x03, 0x73, 0x62, 0x69, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, - 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x69, 0x64, 0x22, 0x74, 0x0a, 0x14, - 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x6d, 0x6e, 0x65, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x91, 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x43, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x33, 0x0a, 0x03, 0x70, 0x6e, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, + 0x70, 0x6e, 0x64, 0x2e, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x4e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x03, 0x70, 0x6e, 0x64, 0x12, + 0x29, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x11, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x43, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x22, 0x95, 0x01, 0x0a, 0x15, 0x47, + 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x12, 0x2c, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, - 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, - 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, - 0x69, 0x64, 0x22, 0x85, 0x01, 0x0a, 0x12, 0x53, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x4c, 0x69, - 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x3f, 0x0a, 0x0e, 0x63, 0x68, 0x61, 0x6e, 0x67, - 0x65, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x18, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x43, 0x68, 0x61, 0x6e, - 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0d, 0x63, 0x68, 0x61, 0x6e, 0x67, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x69, 0x64, 0x22, 0x7b, 0x0a, 0x0d, 0x43, 0x68, - 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x64, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x12, 0x12, 0x0a, - 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, - 0x68, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x2e, 0x0a, 0x06, 0x61, 0x70, 0x69, 0x5f, 0x6f, - 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, - 0x70, 0x6e, 0x64, 0x2e, 0x41, 0x70, 0x69, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x05, 0x61, 0x70, 0x69, 0x4f, 0x70, 0x22, 0xc9, 0x01, 0x0a, 0x06, 0x53, 0x65, 0x74, 0x4f, - 0x6e, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x37, 0x0a, 0x03, - 0x73, 0x62, 0x69, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x73, 0x64, - 0x6e, 0x2e, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x53, 0x6f, 0x75, - 0x74, 0x68, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, - 0x52, 0x03, 0x73, 0x62, 0x69, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x65, 0x76, 0x69, - 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x4b, 0x0a, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, - 0x6f, 0x72, 0x74, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x20, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, - 0x72, 0x74, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x0f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x22, 0x37, 0x0a, 0x06, 0x53, 0x65, 0x74, 0x53, 0x62, 0x69, 0x12, 0x2d, 0x0a, - 0x08, 0x73, 0x62, 0x69, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x12, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x62, 0x69, 0x54, - 0x79, 0x70, 0x65, 0x52, 0x07, 0x73, 0x62, 0x69, 0x54, 0x79, 0x70, 0x65, 0x22, 0x45, 0x0a, 0x09, - 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x75, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x75, 0x69, 0x64, 0x12, 0x24, 0x0a, - 0x02, 0x6f, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x73, 0x64, - 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x02, 0x6f, 0x70, 0x22, 0x66, 0x0a, 0x0b, 0x53, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x29, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x93, 0x01, 0x0a, 0x12, - 0x53, 0x65, 0x74, 0x4f, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, + 0x6d, 0x70, 0x12, 0x33, 0x0a, 0x03, 0x70, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x21, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x50, 0x72, 0x69, 0x6e, + 0x63, 0x69, 0x70, 0x61, 0x6c, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x44, 0x6f, 0x6d, 0x61, + 0x69, 0x6e, 0x52, 0x03, 0x70, 0x6e, 0x64, 0x12, 0x29, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, + 0x70, 0x6e, 0x64, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x22, 0x5e, 0x0a, 0x16, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x4e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x22, 0xb3, 0x01, 0x0a, 0x15, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x4e, 0x65, + 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x3d, 0x0a, 0x10, 0x6d, 0x6e, 0x65, 0x5f, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6e, 0x6d, + 0x69, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0f, + 0x6d, 0x6e, 0x65, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x37, 0x0a, 0x03, 0x73, 0x62, 0x69, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, + 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x2e, + 0x53, 0x6f, 0x75, 0x74, 0x68, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, + 0x61, 0x63, 0x65, 0x52, 0x03, 0x73, 0x62, 0x69, 0x22, 0x56, 0x0a, 0x1e, 0x46, 0x6c, 0x61, 0x74, + 0x74, 0x65, 0x6e, 0x65, 0x64, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x4e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, + 0x0a, 0x03, 0x73, 0x62, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x62, 0x69, + 0x22, 0x80, 0x01, 0x0a, 0x06, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x61, + 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x61, 0x67, 0x65, 0x12, 0x2c, 0x0a, + 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x67, + 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x64, + 0x69, 0x66, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6e, 0x6d, 0x69, + 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x64, + 0x69, 0x66, 0x66, 0x22, 0x68, 0x0a, 0x11, 0x53, 0x65, 0x74, 0x4d, 0x6e, 0x65, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x23, 0x0a, 0x03, 0x6d, 0x6e, 0x65, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, + 0x53, 0x65, 0x74, 0x4d, 0x6e, 0x65, 0x52, 0x03, 0x6d, 0x6e, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x70, + 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x69, 0x64, 0x22, 0x68, 0x0a, + 0x11, 0x53, 0x65, 0x74, 0x53, 0x62, 0x69, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x12, 0x29, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x34, 0x0a, 0x09, 0x72, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, - 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x65, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x73, 0x22, 0x96, 0x01, 0x0a, 0x15, 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4c, + 0x12, 0x23, 0x0a, 0x03, 0x73, 0x62, 0x69, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, + 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x65, 0x74, 0x53, 0x62, 0x69, + 0x52, 0x03, 0x73, 0x62, 0x69, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x70, 0x69, 0x64, 0x22, 0x74, 0x0a, 0x14, 0x53, 0x65, 0x74, 0x43, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2c, 0x0a, + 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, + 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x70, + 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x69, 0x64, 0x22, 0x85, 0x01, + 0x0a, 0x12, 0x53, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x12, 0x3f, 0x0a, 0x0e, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x72, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x73, + 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x52, 0x0d, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x70, 0x69, 0x64, 0x22, 0x7f, 0x0a, 0x0d, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6e, 0x65, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x6e, 0x65, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x2e, 0x0a, 0x06, 0x61, 0x70, 0x69, 0x5f, 0x6f, 0x70, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, + 0x6e, 0x64, 0x2e, 0x41, 0x70, 0x69, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x05, 0x61, 0x70, 0x69, 0x4f, 0x70, 0x22, 0xc3, 0x01, 0x0a, 0x06, 0x53, 0x65, 0x74, 0x4d, 0x6e, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x37, 0x0a, 0x03, 0x73, + 0x62, 0x69, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, + 0x2e, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x53, 0x6f, 0x75, 0x74, + 0x68, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x52, + 0x03, 0x73, 0x62, 0x69, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x6e, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x6e, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x4b, 0x0a, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x6f, 0x73, 0x64, + 0x6e, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x54, 0x72, 0x61, 0x6e, + 0x73, 0x70, 0x6f, 0x72, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x74, 0x72, 0x61, + 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x37, 0x0a, 0x06, + 0x53, 0x65, 0x74, 0x53, 0x62, 0x69, 0x12, 0x2d, 0x0a, 0x08, 0x73, 0x62, 0x69, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, + 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x62, 0x69, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x73, 0x62, + 0x69, 0x54, 0x79, 0x70, 0x65, 0x22, 0x45, 0x0a, 0x09, 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x63, 0x75, 0x69, 0x64, 0x12, 0x24, 0x0a, 0x02, 0x6f, 0x70, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x4f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x02, 0x6f, 0x70, 0x22, 0x66, 0x0a, 0x0b, + 0x53, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x29, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x73, 0x64, + 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x22, 0x93, 0x01, 0x0a, 0x12, 0x53, 0x65, 0x74, 0x4d, 0x6e, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x29, 0x0a, 0x06, 0x73, 0x74, 0x61, @@ -3090,14 +3081,33 @@ var file_gosdn_pnd_pnd_proto_rawDesc = []byte{ 0x61, 0x74, 0x75, 0x73, 0x12, 0x34, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, - 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x22, 0x5c, 0x0a, 0x11, 0x53, 0x65, - 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x29, 0x0a, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, - 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x93, 0x01, 0x0a, 0x12, 0x53, 0x65, 0x74, - 0x53, 0x62, 0x69, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x22, 0x96, 0x01, 0x0a, 0x15, 0x53, + 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x12, 0x29, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x34, 0x0a, + 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x65, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x73, 0x22, 0x5c, 0x0a, 0x11, 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x29, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, + 0x6e, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x22, 0x93, 0x01, 0x0a, 0x12, 0x53, 0x65, 0x74, 0x53, 0x62, 0x69, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x29, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, + 0x6e, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x34, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, + 0x2e, 0x53, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x22, 0x94, 0x01, 0x0a, 0x13, 0x53, 0x65, 0x74, 0x50, + 0x61, 0x74, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x29, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, @@ -3105,226 +3115,218 @@ var file_gosdn_pnd_pnd_proto_rawDesc = []byte{ 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x34, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x22, 0x94, - 0x01, 0x0a, 0x13, 0x53, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x12, 0x29, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, - 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, - 0x34, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, - 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x22, 0x54, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, - 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x69, 0x64, 0x22, 0x5c, 0x0a, 0x11, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x29, - 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, - 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x8f, 0x01, 0x0a, 0x14, 0x53, 0x75, - 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x22, 0x58, + 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x12, 0x10, 0x0a, 0x03, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, - 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x70, 0x69, 0x64, 0x12, 0x35, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x74, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, - 0x64, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, - 0x73, 0x74, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x80, 0x01, 0x0a, 0x10, - 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, - 0x12, 0x3b, 0x0a, 0x0c, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, - 0x6e, 0x64, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x0c, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2f, 0x0a, - 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x67, 0x6f, - 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x22, 0x83, - 0x01, 0x0a, 0x0c, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, - 0x61, 0x74, 0x68, 0x12, 0x36, 0x0a, 0x0b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x6d, 0x6f, - 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, - 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d, 0x6f, 0x64, 0x65, 0x52, - 0x0a, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x73, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x49, 0x6e, 0x74, 0x65, - 0x72, 0x76, 0x61, 0x6c, 0x22, 0x8c, 0x01, 0x0a, 0x15, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, - 0x62, 0x65, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, - 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x29, 0x0a, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x67, - 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2a, 0x0a, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, - 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6e, 0x6d, 0x69, 0x2e, 0x4e, - 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x64, 0x65, 0x76, - 0x69, 0x63, 0x65, 0x2a, 0x9c, 0x01, 0x0a, 0x0b, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x74, - 0x61, 0x74, 0x65, 0x12, 0x1c, 0x0a, 0x18, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x5f, 0x53, 0x54, - 0x41, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, - 0x00, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, - 0x45, 0x5f, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x43, - 0x48, 0x41, 0x4e, 0x47, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, - 0x49, 0x54, 0x54, 0x45, 0x44, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x43, 0x48, 0x41, 0x4e, 0x47, - 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x45, - 0x44, 0x10, 0x03, 0x12, 0x1d, 0x0a, 0x19, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x5f, 0x53, 0x54, - 0x41, 0x54, 0x45, 0x5f, 0x49, 0x4e, 0x43, 0x4f, 0x4e, 0x53, 0x49, 0x53, 0x54, 0x45, 0x4e, 0x54, - 0x10, 0x04, 0x2a, 0x7c, 0x0a, 0x0c, 0x41, 0x70, 0x69, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x19, 0x41, 0x50, 0x49, 0x5f, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, - 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, - 0x00, 0x12, 0x18, 0x0a, 0x14, 0x41, 0x50, 0x49, 0x5f, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, - 0x4f, 0x4e, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x01, 0x12, 0x19, 0x0a, 0x15, 0x41, - 0x50, 0x49, 0x5f, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x50, - 0x4c, 0x41, 0x43, 0x45, 0x10, 0x02, 0x12, 0x18, 0x0a, 0x14, 0x41, 0x50, 0x49, 0x5f, 0x4f, 0x50, - 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x03, - 0x2a, 0x6d, 0x0a, 0x07, 0x53, 0x62, 0x69, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x53, - 0x42, 0x49, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, - 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x53, 0x42, 0x49, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x4f, 0x50, 0x45, 0x4e, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, 0x10, 0x01, 0x12, 0x1a, - 0x0a, 0x16, 0x53, 0x42, 0x49, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x41, - 0x49, 0x4e, 0x45, 0x52, 0x49, 0x53, 0x45, 0x44, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x42, - 0x49, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x10, 0x03, 0x2a, - 0x69, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x15, - 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x4f, 0x50, 0x45, 0x52, 0x41, - 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x10, 0x01, 0x12, 0x14, 0x0a, - 0x10, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x49, - 0x54, 0x10, 0x02, 0x12, 0x15, 0x0a, 0x11, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, - 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x10, 0x03, 0x2a, 0x41, 0x0a, 0x06, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, - 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, - 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x4f, 0x4b, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x53, - 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x02, 0x2a, 0x8b, 0x01, - 0x0a, 0x10, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, - 0x64, 0x65, 0x12, 0x21, 0x0a, 0x1d, 0x53, 0x55, 0x42, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x49, - 0x4f, 0x4e, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, - 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x53, 0x55, 0x42, 0x53, 0x43, 0x52, 0x49, - 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x4f, 0x4e, 0x43, 0x45, 0x10, - 0x01, 0x12, 0x1c, 0x0a, 0x18, 0x53, 0x55, 0x42, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x49, 0x4f, - 0x4e, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x53, 0x54, 0x52, 0x45, 0x41, 0x4d, 0x10, 0x02, 0x12, - 0x1a, 0x0a, 0x16, 0x53, 0x55, 0x42, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, - 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x50, 0x4f, 0x4c, 0x4c, 0x10, 0x03, 0x2a, 0x7c, 0x0a, 0x0a, 0x53, - 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x53, 0x54, 0x52, - 0x45, 0x41, 0x4d, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, - 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x1a, 0x53, 0x54, 0x52, 0x45, 0x41, 0x4d, - 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x44, 0x45, 0x46, - 0x49, 0x4e, 0x45, 0x44, 0x10, 0x01, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x54, 0x52, 0x45, 0x41, 0x4d, - 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x4f, 0x4e, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x10, - 0x02, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x52, 0x45, 0x41, 0x4d, 0x5f, 0x4d, 0x4f, 0x44, 0x45, - 0x5f, 0x53, 0x41, 0x4d, 0x50, 0x4c, 0x45, 0x10, 0x03, 0x32, 0xb1, 0x0b, 0x0a, 0x0a, 0x50, 0x6e, - 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x49, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x4f, - 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, - 0x6e, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, - 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x75, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x46, 0x6c, 0x61, 0x74, 0x74, 0x65, - 0x6e, 0x65, 0x64, 0x4f, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x73, - 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x6e, 0x64, 0x4c, 0x69, 0x73, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, - 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x6c, 0x61, 0x74, 0x74, 0x65, 0x6e, 0x65, - 0x64, 0x4f, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, 0x2f, 0x70, 0x6e, 0x64, 0x73, 0x2f, - 0x7b, 0x70, 0x69, 0x64, 0x7d, 0x2f, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x5c, 0x0a, 0x06, 0x47, 0x65, - 0x74, 0x4f, 0x6e, 0x64, 0x12, 0x18, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, - 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, - 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x6e, - 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x17, 0x12, 0x15, 0x2f, 0x70, 0x6e, 0x64, 0x73, 0x2f, 0x7b, 0x70, 0x69, 0x64, 0x7d, 0x2f, 0x6f, - 0x6e, 0x64, 0x2f, 0x7b, 0x64, 0x69, 0x64, 0x7d, 0x12, 0x66, 0x0a, 0x0a, 0x53, 0x65, 0x74, 0x4f, - 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, - 0x6e, 0x64, 0x2e, 0x53, 0x65, 0x74, 0x4f, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, - 0x2e, 0x53, 0x65, 0x74, 0x4f, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x3a, 0x01, 0x2a, 0x22, 0x10, - 0x2f, 0x70, 0x6e, 0x64, 0x73, 0x2f, 0x7b, 0x70, 0x69, 0x64, 0x7d, 0x2f, 0x6f, 0x6e, 0x64, 0x73, - 0x12, 0x63, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x53, 0x62, 0x69, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1c, - 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x62, - 0x69, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, - 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x62, 0x69, 0x4c, - 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x12, 0x12, 0x10, 0x2f, 0x70, 0x6e, 0x64, 0x73, 0x2f, 0x7b, 0x70, 0x69, 0x64, 0x7d, - 0x2f, 0x73, 0x62, 0x69, 0x73, 0x12, 0x5d, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x53, 0x62, 0x69, 0x12, - 0x18, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x53, - 0x62, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x6f, 0x73, 0x64, - 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x62, 0x69, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, 0x70, - 0x6e, 0x64, 0x73, 0x2f, 0x7b, 0x70, 0x69, 0x64, 0x7d, 0x2f, 0x73, 0x62, 0x69, 0x73, 0x2f, 0x7b, - 0x73, 0x69, 0x64, 0x7d, 0x12, 0x66, 0x0a, 0x0a, 0x53, 0x65, 0x74, 0x53, 0x62, 0x69, 0x4c, 0x69, - 0x73, 0x74, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, - 0x65, 0x74, 0x53, 0x62, 0x69, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1d, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x65, 0x74, - 0x53, 0x62, 0x69, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x3a, 0x01, 0x2a, 0x22, 0x10, 0x2f, 0x70, 0x6e, 0x64, - 0x73, 0x2f, 0x7b, 0x70, 0x69, 0x64, 0x7d, 0x2f, 0x73, 0x62, 0x69, 0x73, 0x12, 0x6f, 0x0a, 0x0d, - 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1f, 0x2e, + 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, 0x22, 0x5c, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x4d, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, + 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x29, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x67, 0x6f, + 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x93, 0x01, 0x0a, 0x14, 0x53, 0x75, 0x62, 0x73, 0x63, + 0x72, 0x69, 0x62, 0x65, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x14, 0x0a, + 0x05, 0x6d, 0x6e, 0x65, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x6e, + 0x65, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x70, 0x69, 0x64, 0x12, 0x35, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, + 0x6e, 0x64, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x80, 0x01, 0x0a, + 0x10, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, + 0x74, 0x12, 0x3b, 0x0a, 0x0c, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, + 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x0c, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2f, + 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x67, + 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x22, + 0x83, 0x01, 0x0a, 0x0c, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x70, 0x61, 0x74, 0x68, 0x12, 0x36, 0x0a, 0x0b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x6d, + 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x67, 0x6f, 0x73, 0x64, + 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d, 0x6f, 0x64, 0x65, + 0x52, 0x0a, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x27, 0x0a, 0x0f, + 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x49, 0x6e, 0x74, + 0x65, 0x72, 0x76, 0x61, 0x6c, 0x22, 0x9f, 0x01, 0x0a, 0x15, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, + 0x69, 0x62, 0x65, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x29, 0x0a, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, + 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x3d, 0x0a, 0x10, 0x6d, 0x6e, 0x65, 0x5f, + 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6e, 0x6d, 0x69, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x6d, 0x6e, 0x65, 0x4e, 0x6f, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x9c, 0x01, 0x0a, 0x0b, 0x43, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1c, 0x0a, 0x18, 0x43, 0x48, 0x41, 0x4e, 0x47, + 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, + 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x5f, + 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, + 0x1a, 0x0a, 0x16, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, + 0x43, 0x4f, 0x4d, 0x4d, 0x49, 0x54, 0x54, 0x45, 0x44, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x43, + 0x48, 0x41, 0x4e, 0x47, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x46, + 0x49, 0x52, 0x4d, 0x45, 0x44, 0x10, 0x03, 0x12, 0x1d, 0x0a, 0x19, 0x43, 0x48, 0x41, 0x4e, 0x47, + 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x49, 0x4e, 0x43, 0x4f, 0x4e, 0x53, 0x49, 0x53, + 0x54, 0x45, 0x4e, 0x54, 0x10, 0x04, 0x2a, 0x7c, 0x0a, 0x0c, 0x41, 0x70, 0x69, 0x4f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x19, 0x41, 0x50, 0x49, 0x5f, 0x4f, 0x50, + 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, + 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, 0x41, 0x50, 0x49, 0x5f, 0x4f, 0x50, 0x45, + 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x01, 0x12, + 0x19, 0x0a, 0x15, 0x41, 0x50, 0x49, 0x5f, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, + 0x5f, 0x52, 0x45, 0x50, 0x4c, 0x41, 0x43, 0x45, 0x10, 0x02, 0x12, 0x18, 0x0a, 0x14, 0x41, 0x50, + 0x49, 0x5f, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x44, 0x45, 0x4c, 0x45, + 0x54, 0x45, 0x10, 0x03, 0x2a, 0x6d, 0x0a, 0x07, 0x53, 0x62, 0x69, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x18, 0x0a, 0x14, 0x53, 0x42, 0x49, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x53, 0x42, 0x49, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x50, 0x45, 0x4e, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, + 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x53, 0x42, 0x49, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, + 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x49, 0x53, 0x45, 0x44, 0x10, 0x02, 0x12, 0x13, + 0x0a, 0x0f, 0x53, 0x42, 0x49, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x50, 0x4c, 0x55, 0x47, 0x49, + 0x4e, 0x10, 0x03, 0x2a, 0x69, 0x0a, 0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x19, 0x0a, 0x15, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x4f, + 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x10, + 0x01, 0x12, 0x14, 0x0a, 0x10, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x43, + 0x4f, 0x4d, 0x4d, 0x49, 0x54, 0x10, 0x02, 0x12, 0x15, 0x0a, 0x11, 0x4f, 0x50, 0x45, 0x52, 0x41, + 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x10, 0x03, 0x2a, 0x41, + 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, + 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, + 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x4f, 0x4b, 0x10, 0x01, 0x12, + 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, + 0x02, 0x2a, 0x8b, 0x01, 0x0a, 0x10, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x21, 0x0a, 0x1d, 0x53, 0x55, 0x42, 0x53, 0x43, 0x52, + 0x49, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x53, 0x55, 0x42, + 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x4f, + 0x4e, 0x43, 0x45, 0x10, 0x01, 0x12, 0x1c, 0x0a, 0x18, 0x53, 0x55, 0x42, 0x53, 0x43, 0x52, 0x49, + 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x53, 0x54, 0x52, 0x45, 0x41, + 0x4d, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x53, 0x55, 0x42, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, + 0x49, 0x4f, 0x4e, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x50, 0x4f, 0x4c, 0x4c, 0x10, 0x03, 0x2a, + 0x7c, 0x0a, 0x0a, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x1b, 0x0a, + 0x17, 0x53, 0x54, 0x52, 0x45, 0x41, 0x4d, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x53, + 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x1a, 0x53, 0x54, + 0x52, 0x45, 0x41, 0x4d, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, + 0x5f, 0x44, 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x10, 0x01, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x54, + 0x52, 0x45, 0x41, 0x4d, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x4f, 0x4e, 0x5f, 0x43, 0x48, 0x41, + 0x4e, 0x47, 0x45, 0x10, 0x02, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x52, 0x45, 0x41, 0x4d, 0x5f, + 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x53, 0x41, 0x4d, 0x50, 0x4c, 0x45, 0x10, 0x03, 0x32, 0xb7, 0x0b, + 0x0a, 0x0a, 0x50, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x49, 0x0a, 0x0a, + 0x47, 0x65, 0x74, 0x4d, 0x6e, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x73, + 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x6e, 0x65, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, + 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x6e, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x75, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x46, 0x6c, + 0x61, 0x74, 0x74, 0x65, 0x6e, 0x65, 0x64, 0x4d, 0x6e, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1c, + 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x6e, + 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x67, + 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x6c, 0x61, 0x74, + 0x74, 0x65, 0x6e, 0x65, 0x64, 0x4d, 0x6e, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, 0x2f, 0x70, + 0x6e, 0x64, 0x73, 0x2f, 0x7b, 0x70, 0x69, 0x64, 0x7d, 0x2f, 0x6d, 0x6e, 0x65, 0x73, 0x12, 0x5e, + 0x0a, 0x06, 0x47, 0x65, 0x74, 0x4d, 0x6e, 0x65, 0x12, 0x18, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, + 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x47, + 0x65, 0x74, 0x4d, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x12, 0x17, 0x2f, 0x70, 0x6e, 0x64, 0x73, 0x2f, 0x7b, 0x70, 0x69, + 0x64, 0x7d, 0x2f, 0x6d, 0x6e, 0x65, 0x2f, 0x7b, 0x6d, 0x6e, 0x65, 0x69, 0x64, 0x7d, 0x12, 0x66, + 0x0a, 0x0a, 0x53, 0x65, 0x74, 0x4d, 0x6e, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1c, 0x2e, 0x67, + 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x6e, 0x65, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x6f, 0x73, + 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x6e, 0x65, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x15, 0x3a, 0x01, 0x2a, 0x22, 0x10, 0x2f, 0x70, 0x6e, 0x64, 0x73, 0x2f, 0x7b, 0x70, 0x69, 0x64, + 0x7d, 0x2f, 0x6d, 0x6e, 0x65, 0x73, 0x12, 0x63, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x53, 0x62, 0x69, + 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, + 0x2e, 0x47, 0x65, 0x74, 0x53, 0x62, 0x69, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x47, + 0x65, 0x74, 0x53, 0x62, 0x69, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, 0x2f, 0x70, 0x6e, 0x64, 0x73, + 0x2f, 0x7b, 0x70, 0x69, 0x64, 0x7d, 0x2f, 0x73, 0x62, 0x69, 0x73, 0x12, 0x5d, 0x0a, 0x06, 0x47, + 0x65, 0x74, 0x53, 0x62, 0x69, 0x12, 0x18, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, + 0x64, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x62, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x19, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x53, + 0x62, 0x69, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x18, 0x12, 0x16, 0x2f, 0x70, 0x6e, 0x64, 0x73, 0x2f, 0x7b, 0x70, 0x69, 0x64, 0x7d, 0x2f, + 0x73, 0x62, 0x69, 0x73, 0x2f, 0x7b, 0x73, 0x69, 0x64, 0x7d, 0x12, 0x66, 0x0a, 0x0a, 0x53, 0x65, + 0x74, 0x53, 0x62, 0x69, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, + 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x65, 0x74, 0x53, 0x62, 0x69, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, + 0x6e, 0x64, 0x2e, 0x53, 0x65, 0x74, 0x53, 0x62, 0x69, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x3a, 0x01, 0x2a, + 0x22, 0x10, 0x2f, 0x70, 0x6e, 0x64, 0x73, 0x2f, 0x7b, 0x70, 0x69, 0x64, 0x7d, 0x2f, 0x73, 0x62, + 0x69, 0x73, 0x12, 0x6f, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4c, + 0x69, 0x73, 0x74, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, + 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, + 0x2e, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x12, 0x13, + 0x2f, 0x70, 0x6e, 0x64, 0x73, 0x2f, 0x7b, 0x70, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x73, 0x12, 0x6a, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x12, 0x1b, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x47, 0x65, 0x74, + 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, - 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x68, - 0x61, 0x6e, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x12, 0x13, 0x2f, 0x70, 0x6e, 0x64, 0x73, 0x2f, - 0x7b, 0x70, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x6a, 0x0a, - 0x09, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x1b, 0x2e, 0x67, 0x6f, 0x73, - 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, - 0x70, 0x6e, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, - 0x70, 0x6e, 0x64, 0x73, 0x2f, 0x7b, 0x70, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x67, - 0x65, 0x73, 0x2f, 0x7b, 0x63, 0x75, 0x69, 0x64, 0x7d, 0x12, 0x72, 0x0a, 0x0d, 0x53, 0x65, 0x74, - 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x73, - 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, - 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x67, 0x6f, - 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, - 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x3a, 0x01, 0x2a, 0x22, 0x13, 0x2f, 0x70, 0x6e, 0x64, 0x73, 0x2f, - 0x7b, 0x70, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x6d, 0x0a, - 0x07, 0x47, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x12, 0x19, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, - 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, - 0x47, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x12, 0x23, 0x2f, 0x70, 0x6e, 0x64, 0x73, 0x2f, 0x7b, - 0x70, 0x69, 0x64, 0x7d, 0x2f, 0x6f, 0x6e, 0x64, 0x73, 0x2f, 0x7b, 0x64, 0x69, 0x64, 0x7d, 0x2f, - 0x70, 0x61, 0x74, 0x68, 0x73, 0x2f, 0x7b, 0x70, 0x61, 0x74, 0x68, 0x7d, 0x12, 0x6f, 0x0a, 0x0b, - 0x53, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1d, 0x2e, 0x67, 0x6f, - 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x4c, - 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, 0x6f, 0x73, - 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x4c, 0x69, - 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x1b, 0x3a, 0x01, 0x2a, 0x22, 0x16, 0x2f, 0x70, 0x6e, 0x64, 0x73, 0x2f, 0x7b, 0x70, 0x69, - 0x64, 0x7d, 0x2f, 0x6f, 0x6e, 0x64, 0x73, 0x2f, 0x70, 0x61, 0x74, 0x68, 0x73, 0x12, 0x66, 0x0a, - 0x09, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x6e, 0x64, 0x12, 0x1b, 0x2e, 0x67, 0x6f, 0x73, - 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x6e, 0x64, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, - 0x70, 0x6e, 0x64, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x6e, 0x64, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x2a, 0x16, 0x2f, - 0x70, 0x6e, 0x64, 0x73, 0x2f, 0x7b, 0x70, 0x69, 0x64, 0x7d, 0x2f, 0x6f, 0x6e, 0x64, 0x73, 0x2f, - 0x7b, 0x64, 0x69, 0x64, 0x7d, 0x12, 0x56, 0x0a, 0x0d, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, - 0x62, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, - 0x6e, 0x64, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x50, 0x61, 0x74, 0x68, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, - 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x50, 0x61, 0x74, - 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x42, 0xae, 0x02, - 0x5a, 0x2d, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x66, 0x62, 0x69, 0x2e, 0x68, 0x2d, 0x64, 0x61, 0x2e, - 0x64, 0x65, 0x2f, 0x64, 0x61, 0x6e, 0x65, 0x74, 0x2f, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2f, 0x70, 0x6e, 0x64, 0x92, - 0x41, 0xfb, 0x01, 0x12, 0xf8, 0x01, 0x0a, 0x10, 0x67, 0x6f, 0x53, 0x44, 0x4e, 0x20, 0x4e, 0x6f, - 0x72, 0x74, 0x68, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x4d, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, - 0x6f, 0x6c, 0x20, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x47, 0x6f, 0x20, - 0x63, 0x6f, 0x64, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x6f, 0x53, - 0x44, 0x4e, 0x20, 0x6e, 0x6f, 0x72, 0x74, 0x68, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x49, 0x6e, - 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x22, 0x3e, 0x0a, 0x18, 0x67, 0x6f, 0x53, 0x44, 0x4e, - 0x20, 0x4e, 0x6f, 0x72, 0x74, 0x68, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x70, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x12, 0x22, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x63, 0x6f, 0x64, - 0x65, 0x2e, 0x66, 0x62, 0x69, 0x2e, 0x68, 0x2d, 0x64, 0x61, 0x2e, 0x64, 0x65, 0x2f, 0x64, 0x61, - 0x6e, 0x65, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2a, 0x50, 0x0a, 0x14, 0x42, 0x53, 0x44, 0x20, 0x33, - 0x2d, 0x43, 0x6c, 0x61, 0x75, 0x73, 0x65, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x12, - 0x38, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x66, 0x62, - 0x69, 0x2e, 0x68, 0x2d, 0x64, 0x61, 0x2e, 0x64, 0x65, 0x2f, 0x64, 0x61, 0x6e, 0x65, 0x74, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x2d, 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, - 0x72, 0x2f, 0x4c, 0x49, 0x43, 0x45, 0x4e, 0x53, 0x45, 0x32, 0x03, 0x30, 0x2e, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x70, 0x6e, 0x64, 0x73, 0x2f, 0x7b, 0x70, 0x69, 0x64, 0x7d, + 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x2f, 0x7b, 0x63, 0x75, 0x69, 0x64, 0x7d, 0x12, + 0x72, 0x0a, 0x0d, 0x53, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, + 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x65, 0x74, + 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x20, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x65, + 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x3a, 0x01, 0x2a, 0x22, 0x13, + 0x2f, 0x70, 0x6e, 0x64, 0x73, 0x2f, 0x7b, 0x70, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x73, 0x12, 0x6f, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x12, 0x19, + 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, + 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x67, 0x6f, 0x73, 0x64, + 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, + 0x70, 0x6e, 0x64, 0x73, 0x2f, 0x7b, 0x70, 0x69, 0x64, 0x7d, 0x2f, 0x6d, 0x6e, 0x65, 0x73, 0x2f, + 0x7b, 0x6d, 0x6e, 0x65, 0x69, 0x64, 0x7d, 0x2f, 0x70, 0x61, 0x74, 0x68, 0x73, 0x2f, 0x7b, 0x70, + 0x61, 0x74, 0x68, 0x7d, 0x12, 0x6f, 0x0a, 0x0b, 0x53, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x4c, + 0x69, 0x73, 0x74, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, + 0x53, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, + 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x3a, 0x01, 0x2a, 0x22, 0x16, 0x2f, + 0x70, 0x6e, 0x64, 0x73, 0x2f, 0x7b, 0x70, 0x69, 0x64, 0x7d, 0x2f, 0x6d, 0x6e, 0x65, 0x73, 0x2f, + 0x70, 0x61, 0x74, 0x68, 0x73, 0x12, 0x68, 0x0a, 0x09, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, + 0x6e, 0x65, 0x12, 0x1b, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1c, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x4d, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x20, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x2a, 0x18, 0x2f, 0x70, 0x6e, 0x64, 0x73, 0x2f, 0x7b, 0x70, 0x69, + 0x64, 0x7d, 0x2f, 0x6d, 0x6e, 0x65, 0x73, 0x2f, 0x7b, 0x6d, 0x6e, 0x65, 0x69, 0x64, 0x7d, 0x12, + 0x56, 0x0a, 0x0d, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x50, 0x61, 0x74, 0x68, + 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x75, 0x62, + 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x20, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x70, 0x6e, 0x64, 0x2e, 0x53, 0x75, + 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x42, 0xae, 0x02, 0x5a, 0x2d, 0x63, 0x6f, 0x64, 0x65, + 0x2e, 0x66, 0x62, 0x69, 0x2e, 0x68, 0x2d, 0x64, 0x61, 0x2e, 0x64, 0x65, 0x2f, 0x64, 0x61, 0x6e, + 0x65, 0x74, 0x2f, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, + 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2f, 0x70, 0x6e, 0x64, 0x92, 0x41, 0xfb, 0x01, 0x12, 0xf8, 0x01, + 0x0a, 0x10, 0x67, 0x6f, 0x53, 0x44, 0x4e, 0x20, 0x4e, 0x6f, 0x72, 0x74, 0x68, 0x62, 0x6f, 0x75, + 0x6e, 0x64, 0x12, 0x4d, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x20, 0x42, 0x75, 0x66, + 0x66, 0x65, 0x72, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x47, 0x6f, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x66, + 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x6f, 0x53, 0x44, 0x4e, 0x20, 0x6e, 0x6f, 0x72, + 0x74, 0x68, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, + 0x65, 0x22, 0x3e, 0x0a, 0x18, 0x67, 0x6f, 0x53, 0x44, 0x4e, 0x20, 0x4e, 0x6f, 0x72, 0x74, 0x68, + 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x22, 0x68, + 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x66, 0x62, 0x69, 0x2e, + 0x68, 0x2d, 0x64, 0x61, 0x2e, 0x64, 0x65, 0x2f, 0x64, 0x61, 0x6e, 0x65, 0x74, 0x2f, 0x61, 0x70, + 0x69, 0x2a, 0x50, 0x0a, 0x14, 0x42, 0x53, 0x44, 0x20, 0x33, 0x2d, 0x43, 0x6c, 0x61, 0x75, 0x73, + 0x65, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x68, 0x74, 0x74, 0x70, 0x73, + 0x3a, 0x2f, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x66, 0x62, 0x69, 0x2e, 0x68, 0x2d, 0x64, 0x61, + 0x2e, 0x64, 0x65, 0x2f, 0x64, 0x61, 0x6e, 0x65, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x2d, 0x2f, + 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x2f, 0x4c, 0x49, 0x43, 0x45, + 0x4e, 0x53, 0x45, 0x32, 0x03, 0x30, 0x2e, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3342,89 +3344,89 @@ func file_gosdn_pnd_pnd_proto_rawDescGZIP() []byte { var file_gosdn_pnd_pnd_proto_enumTypes = make([]protoimpl.EnumInfo, 7) var file_gosdn_pnd_pnd_proto_msgTypes = make([]protoimpl.MessageInfo, 39) var file_gosdn_pnd_pnd_proto_goTypes = []interface{}{ - (ChangeState)(0), // 0: gosdn.pnd.ChangeState - (ApiOperation)(0), // 1: gosdn.pnd.ApiOperation - (SbiType)(0), // 2: gosdn.pnd.SbiType - (Operation)(0), // 3: gosdn.pnd.Operation - (Status)(0), // 4: gosdn.pnd.Status - (SubscriptionMode)(0), // 5: gosdn.pnd.SubscriptionMode - (StreamMode)(0), // 6: gosdn.pnd.StreamMode - (*GetOndListRequest)(nil), // 7: gosdn.pnd.GetOndListRequest - (*GetOndRequest)(nil), // 8: gosdn.pnd.GetOndRequest - (*GetSbiListRequest)(nil), // 9: gosdn.pnd.GetSbiListRequest - (*GetSbiRequest)(nil), // 10: gosdn.pnd.GetSbiRequest - (*GetChangeListRequest)(nil), // 11: gosdn.pnd.GetChangeListRequest - (*GetChangeRequest)(nil), // 12: gosdn.pnd.GetChangeRequest - (*GetPathRequest)(nil), // 13: gosdn.pnd.GetPathRequest - (*GetOndResponse)(nil), // 14: gosdn.pnd.GetOndResponse - (*GetOndListResponse)(nil), // 15: gosdn.pnd.GetOndListResponse - (*GetFlattenedOndListResponse)(nil), // 16: gosdn.pnd.GetFlattenedOndListResponse - (*GetSbiResponse)(nil), // 17: gosdn.pnd.GetSbiResponse - (*GetSbiListResponse)(nil), // 18: gosdn.pnd.GetSbiListResponse - (*GetPathResponse)(nil), // 19: gosdn.pnd.GetPathResponse - (*GetChangeResponse)(nil), // 20: gosdn.pnd.GetChangeResponse - (*GetChangeListResponse)(nil), // 21: gosdn.pnd.GetChangeListResponse - (*PrincipalNetworkDomain)(nil), // 22: gosdn.pnd.PrincipalNetworkDomain - (*OrchestratedNetworkingDevice)(nil), // 23: gosdn.pnd.OrchestratedNetworkingDevice - (*FlattenedOrchestratedNetworkingDevice)(nil), // 24: gosdn.pnd.FlattenedOrchestratedNetworkingDevice - (*Change)(nil), // 25: gosdn.pnd.Change - (*SetOndListRequest)(nil), // 26: gosdn.pnd.SetOndListRequest - (*SetSbiListRequest)(nil), // 27: gosdn.pnd.SetSbiListRequest - (*SetChangeListRequest)(nil), // 28: gosdn.pnd.SetChangeListRequest - (*SetPathListRequest)(nil), // 29: gosdn.pnd.SetPathListRequest - (*ChangeRequest)(nil), // 30: gosdn.pnd.ChangeRequest - (*SetOnd)(nil), // 31: gosdn.pnd.SetOnd - (*SetSbi)(nil), // 32: gosdn.pnd.SetSbi - (*SetChange)(nil), // 33: gosdn.pnd.SetChange - (*SetResponse)(nil), // 34: gosdn.pnd.SetResponse - (*SetOndListResponse)(nil), // 35: gosdn.pnd.SetOndListResponse - (*SetChangeListResponse)(nil), // 36: gosdn.pnd.SetChangeListResponse - (*SetChangeResponse)(nil), // 37: gosdn.pnd.SetChangeResponse - (*SetSbiListResponse)(nil), // 38: gosdn.pnd.SetSbiListResponse - (*SetPathListResponse)(nil), // 39: gosdn.pnd.SetPathListResponse - (*DeleteOndRequest)(nil), // 40: gosdn.pnd.DeleteOndRequest - (*DeleteOndResponse)(nil), // 41: gosdn.pnd.DeleteOndResponse - (*SubscribePathRequest)(nil), // 42: gosdn.pnd.SubscribePathRequest - (*SubscriptionList)(nil), // 43: gosdn.pnd.SubscriptionList - (*Subscription)(nil), // 44: gosdn.pnd.Subscription - (*SubscribePathResponse)(nil), // 45: gosdn.pnd.SubscribePathResponse - (*southbound.SouthboundInterface)(nil), // 46: gosdn.southbound.SouthboundInterface - (*gnmi.Notification)(nil), // 47: gnmi.Notification - (*transport.TransportOption)(nil), // 48: gosdn.transport.TransportOption + (ChangeState)(0), // 0: gosdn.pnd.ChangeState + (ApiOperation)(0), // 1: gosdn.pnd.ApiOperation + (SbiType)(0), // 2: gosdn.pnd.SbiType + (Operation)(0), // 3: gosdn.pnd.Operation + (Status)(0), // 4: gosdn.pnd.Status + (SubscriptionMode)(0), // 5: gosdn.pnd.SubscriptionMode + (StreamMode)(0), // 6: gosdn.pnd.StreamMode + (*GetMneListRequest)(nil), // 7: gosdn.pnd.GetMneListRequest + (*GetMneRequest)(nil), // 8: gosdn.pnd.GetMneRequest + (*GetSbiListRequest)(nil), // 9: gosdn.pnd.GetSbiListRequest + (*GetSbiRequest)(nil), // 10: gosdn.pnd.GetSbiRequest + (*GetChangeListRequest)(nil), // 11: gosdn.pnd.GetChangeListRequest + (*GetChangeRequest)(nil), // 12: gosdn.pnd.GetChangeRequest + (*GetPathRequest)(nil), // 13: gosdn.pnd.GetPathRequest + (*GetMneResponse)(nil), // 14: gosdn.pnd.GetMneResponse + (*GetMneListResponse)(nil), // 15: gosdn.pnd.GetMneListResponse + (*GetFlattenedMneListResponse)(nil), // 16: gosdn.pnd.GetFlattenedMneListResponse + (*GetSbiResponse)(nil), // 17: gosdn.pnd.GetSbiResponse + (*GetSbiListResponse)(nil), // 18: gosdn.pnd.GetSbiListResponse + (*GetPathResponse)(nil), // 19: gosdn.pnd.GetPathResponse + (*GetChangeResponse)(nil), // 20: gosdn.pnd.GetChangeResponse + (*GetChangeListResponse)(nil), // 21: gosdn.pnd.GetChangeListResponse + (*PrincipalNetworkDomain)(nil), // 22: gosdn.pnd.PrincipalNetworkDomain + (*ManagedNetworkElement)(nil), // 23: gosdn.pnd.ManagedNetworkElement + (*FlattenedManagedNetworkElement)(nil), // 24: gosdn.pnd.FlattenedManagedNetworkElement + (*Change)(nil), // 25: gosdn.pnd.Change + (*SetMneListRequest)(nil), // 26: gosdn.pnd.SetMneListRequest + (*SetSbiListRequest)(nil), // 27: gosdn.pnd.SetSbiListRequest + (*SetChangeListRequest)(nil), // 28: gosdn.pnd.SetChangeListRequest + (*SetPathListRequest)(nil), // 29: gosdn.pnd.SetPathListRequest + (*ChangeRequest)(nil), // 30: gosdn.pnd.ChangeRequest + (*SetMne)(nil), // 31: gosdn.pnd.SetMne + (*SetSbi)(nil), // 32: gosdn.pnd.SetSbi + (*SetChange)(nil), // 33: gosdn.pnd.SetChange + (*SetResponse)(nil), // 34: gosdn.pnd.SetResponse + (*SetMneListResponse)(nil), // 35: gosdn.pnd.SetMneListResponse + (*SetChangeListResponse)(nil), // 36: gosdn.pnd.SetChangeListResponse + (*SetChangeResponse)(nil), // 37: gosdn.pnd.SetChangeResponse + (*SetSbiListResponse)(nil), // 38: gosdn.pnd.SetSbiListResponse + (*SetPathListResponse)(nil), // 39: gosdn.pnd.SetPathListResponse + (*DeleteMneRequest)(nil), // 40: gosdn.pnd.DeleteMneRequest + (*DeleteMneResponse)(nil), // 41: gosdn.pnd.DeleteMneResponse + (*SubscribePathRequest)(nil), // 42: gosdn.pnd.SubscribePathRequest + (*SubscriptionList)(nil), // 43: gosdn.pnd.SubscriptionList + (*Subscription)(nil), // 44: gosdn.pnd.Subscription + (*SubscribePathResponse)(nil), // 45: gosdn.pnd.SubscribePathResponse + (*southbound.SouthboundInterface)(nil), // 46: gosdn.southbound.SouthboundInterface + (*gnmi.Notification)(nil), // 47: gnmi.Notification + (*transport.TransportOption)(nil), // 48: gosdn.transport.TransportOption } var file_gosdn_pnd_pnd_proto_depIdxs = []int32{ - 22, // 0: gosdn.pnd.GetOndResponse.pnd:type_name -> gosdn.pnd.PrincipalNetworkDomain - 23, // 1: gosdn.pnd.GetOndResponse.ond:type_name -> gosdn.pnd.OrchestratedNetworkingDevice - 22, // 2: gosdn.pnd.GetOndListResponse.pnd:type_name -> gosdn.pnd.PrincipalNetworkDomain - 23, // 3: gosdn.pnd.GetOndListResponse.ond:type_name -> gosdn.pnd.OrchestratedNetworkingDevice - 22, // 4: gosdn.pnd.GetFlattenedOndListResponse.pnd:type_name -> gosdn.pnd.PrincipalNetworkDomain - 24, // 5: gosdn.pnd.GetFlattenedOndListResponse.ond:type_name -> gosdn.pnd.FlattenedOrchestratedNetworkingDevice + 22, // 0: gosdn.pnd.GetMneResponse.pnd:type_name -> gosdn.pnd.PrincipalNetworkDomain + 23, // 1: gosdn.pnd.GetMneResponse.mne:type_name -> gosdn.pnd.ManagedNetworkElement + 22, // 2: gosdn.pnd.GetMneListResponse.pnd:type_name -> gosdn.pnd.PrincipalNetworkDomain + 23, // 3: gosdn.pnd.GetMneListResponse.mne:type_name -> gosdn.pnd.ManagedNetworkElement + 22, // 4: gosdn.pnd.GetFlattenedMneListResponse.pnd:type_name -> gosdn.pnd.PrincipalNetworkDomain + 24, // 5: gosdn.pnd.GetFlattenedMneListResponse.mne:type_name -> gosdn.pnd.FlattenedManagedNetworkElement 22, // 6: gosdn.pnd.GetSbiResponse.pnd:type_name -> gosdn.pnd.PrincipalNetworkDomain 46, // 7: gosdn.pnd.GetSbiResponse.sbi:type_name -> gosdn.southbound.SouthboundInterface 22, // 8: gosdn.pnd.GetSbiListResponse.pnd:type_name -> gosdn.pnd.PrincipalNetworkDomain 46, // 9: gosdn.pnd.GetSbiListResponse.sbi:type_name -> gosdn.southbound.SouthboundInterface 22, // 10: gosdn.pnd.GetPathResponse.pnd:type_name -> gosdn.pnd.PrincipalNetworkDomain - 47, // 11: gosdn.pnd.GetPathResponse.device:type_name -> gnmi.Notification + 47, // 11: gosdn.pnd.GetPathResponse.mne_notification:type_name -> gnmi.Notification 22, // 12: gosdn.pnd.GetChangeResponse.pnd:type_name -> gosdn.pnd.PrincipalNetworkDomain 25, // 13: gosdn.pnd.GetChangeResponse.change:type_name -> gosdn.pnd.Change 22, // 14: gosdn.pnd.GetChangeListResponse.pnd:type_name -> gosdn.pnd.PrincipalNetworkDomain 25, // 15: gosdn.pnd.GetChangeListResponse.change:type_name -> gosdn.pnd.Change - 47, // 16: gosdn.pnd.OrchestratedNetworkingDevice.device:type_name -> gnmi.Notification - 46, // 17: gosdn.pnd.OrchestratedNetworkingDevice.sbi:type_name -> gosdn.southbound.SouthboundInterface + 47, // 16: gosdn.pnd.ManagedNetworkElement.mne_notification:type_name -> gnmi.Notification + 46, // 17: gosdn.pnd.ManagedNetworkElement.sbi:type_name -> gosdn.southbound.SouthboundInterface 0, // 18: gosdn.pnd.Change.state:type_name -> gosdn.pnd.ChangeState 47, // 19: gosdn.pnd.Change.diff:type_name -> gnmi.Notification - 31, // 20: gosdn.pnd.SetOndListRequest.ond:type_name -> gosdn.pnd.SetOnd + 31, // 20: gosdn.pnd.SetMneListRequest.mne:type_name -> gosdn.pnd.SetMne 32, // 21: gosdn.pnd.SetSbiListRequest.sbi:type_name -> gosdn.pnd.SetSbi 33, // 22: gosdn.pnd.SetChangeListRequest.change:type_name -> gosdn.pnd.SetChange 30, // 23: gosdn.pnd.SetPathListRequest.change_request:type_name -> gosdn.pnd.ChangeRequest 1, // 24: gosdn.pnd.ChangeRequest.api_op:type_name -> gosdn.pnd.ApiOperation - 46, // 25: gosdn.pnd.SetOnd.sbi:type_name -> gosdn.southbound.SouthboundInterface - 48, // 26: gosdn.pnd.SetOnd.transport_option:type_name -> gosdn.transport.TransportOption + 46, // 25: gosdn.pnd.SetMne.sbi:type_name -> gosdn.southbound.SouthboundInterface + 48, // 26: gosdn.pnd.SetMne.transport_option:type_name -> gosdn.transport.TransportOption 2, // 27: gosdn.pnd.SetSbi.sbi_type:type_name -> gosdn.pnd.SbiType 3, // 28: gosdn.pnd.SetChange.op:type_name -> gosdn.pnd.Operation 4, // 29: gosdn.pnd.SetResponse.status:type_name -> gosdn.pnd.Status - 4, // 30: gosdn.pnd.SetOndListResponse.status:type_name -> gosdn.pnd.Status - 34, // 31: gosdn.pnd.SetOndListResponse.responses:type_name -> gosdn.pnd.SetResponse + 4, // 30: gosdn.pnd.SetMneListResponse.status:type_name -> gosdn.pnd.Status + 34, // 31: gosdn.pnd.SetMneListResponse.responses:type_name -> gosdn.pnd.SetResponse 4, // 32: gosdn.pnd.SetChangeListResponse.status:type_name -> gosdn.pnd.Status 34, // 33: gosdn.pnd.SetChangeListResponse.responses:type_name -> gosdn.pnd.SetResponse 4, // 34: gosdn.pnd.SetChangeResponse.status:type_name -> gosdn.pnd.Status @@ -3432,17 +3434,17 @@ var file_gosdn_pnd_pnd_proto_depIdxs = []int32{ 34, // 36: gosdn.pnd.SetSbiListResponse.responses:type_name -> gosdn.pnd.SetResponse 4, // 37: gosdn.pnd.SetPathListResponse.status:type_name -> gosdn.pnd.Status 34, // 38: gosdn.pnd.SetPathListResponse.responses:type_name -> gosdn.pnd.SetResponse - 4, // 39: gosdn.pnd.DeleteOndResponse.status:type_name -> gosdn.pnd.Status + 4, // 39: gosdn.pnd.DeleteMneResponse.status:type_name -> gosdn.pnd.Status 43, // 40: gosdn.pnd.SubscribePathRequest.sublist:type_name -> gosdn.pnd.SubscriptionList 44, // 41: gosdn.pnd.SubscriptionList.subscription:type_name -> gosdn.pnd.Subscription 5, // 42: gosdn.pnd.SubscriptionList.mode:type_name -> gosdn.pnd.SubscriptionMode 6, // 43: gosdn.pnd.Subscription.stream_mode:type_name -> gosdn.pnd.StreamMode 4, // 44: gosdn.pnd.SubscribePathResponse.status:type_name -> gosdn.pnd.Status - 47, // 45: gosdn.pnd.SubscribePathResponse.device:type_name -> gnmi.Notification - 7, // 46: gosdn.pnd.PndService.GetOndList:input_type -> gosdn.pnd.GetOndListRequest - 7, // 47: gosdn.pnd.PndService.GetFlattenedOndList:input_type -> gosdn.pnd.GetOndListRequest - 8, // 48: gosdn.pnd.PndService.GetOnd:input_type -> gosdn.pnd.GetOndRequest - 26, // 49: gosdn.pnd.PndService.SetOndList:input_type -> gosdn.pnd.SetOndListRequest + 47, // 45: gosdn.pnd.SubscribePathResponse.mne_notification:type_name -> gnmi.Notification + 7, // 46: gosdn.pnd.PndService.GetMneList:input_type -> gosdn.pnd.GetMneListRequest + 7, // 47: gosdn.pnd.PndService.GetFlattenedMneList:input_type -> gosdn.pnd.GetMneListRequest + 8, // 48: gosdn.pnd.PndService.GetMne:input_type -> gosdn.pnd.GetMneRequest + 26, // 49: gosdn.pnd.PndService.SetMneList:input_type -> gosdn.pnd.SetMneListRequest 9, // 50: gosdn.pnd.PndService.GetSbiList:input_type -> gosdn.pnd.GetSbiListRequest 10, // 51: gosdn.pnd.PndService.GetSbi:input_type -> gosdn.pnd.GetSbiRequest 27, // 52: gosdn.pnd.PndService.SetSbiList:input_type -> gosdn.pnd.SetSbiListRequest @@ -3451,12 +3453,12 @@ var file_gosdn_pnd_pnd_proto_depIdxs = []int32{ 28, // 55: gosdn.pnd.PndService.SetChangeList:input_type -> gosdn.pnd.SetChangeListRequest 13, // 56: gosdn.pnd.PndService.GetPath:input_type -> gosdn.pnd.GetPathRequest 29, // 57: gosdn.pnd.PndService.SetPathList:input_type -> gosdn.pnd.SetPathListRequest - 40, // 58: gosdn.pnd.PndService.DeleteOnd:input_type -> gosdn.pnd.DeleteOndRequest + 40, // 58: gosdn.pnd.PndService.DeleteMne:input_type -> gosdn.pnd.DeleteMneRequest 42, // 59: gosdn.pnd.PndService.SubscribePath:input_type -> gosdn.pnd.SubscribePathRequest - 15, // 60: gosdn.pnd.PndService.GetOndList:output_type -> gosdn.pnd.GetOndListResponse - 16, // 61: gosdn.pnd.PndService.GetFlattenedOndList:output_type -> gosdn.pnd.GetFlattenedOndListResponse - 14, // 62: gosdn.pnd.PndService.GetOnd:output_type -> gosdn.pnd.GetOndResponse - 35, // 63: gosdn.pnd.PndService.SetOndList:output_type -> gosdn.pnd.SetOndListResponse + 15, // 60: gosdn.pnd.PndService.GetMneList:output_type -> gosdn.pnd.GetMneListResponse + 16, // 61: gosdn.pnd.PndService.GetFlattenedMneList:output_type -> gosdn.pnd.GetFlattenedMneListResponse + 14, // 62: gosdn.pnd.PndService.GetMne:output_type -> gosdn.pnd.GetMneResponse + 35, // 63: gosdn.pnd.PndService.SetMneList:output_type -> gosdn.pnd.SetMneListResponse 18, // 64: gosdn.pnd.PndService.GetSbiList:output_type -> gosdn.pnd.GetSbiListResponse 17, // 65: gosdn.pnd.PndService.GetSbi:output_type -> gosdn.pnd.GetSbiResponse 38, // 66: gosdn.pnd.PndService.SetSbiList:output_type -> gosdn.pnd.SetSbiListResponse @@ -3465,7 +3467,7 @@ var file_gosdn_pnd_pnd_proto_depIdxs = []int32{ 36, // 69: gosdn.pnd.PndService.SetChangeList:output_type -> gosdn.pnd.SetChangeListResponse 19, // 70: gosdn.pnd.PndService.GetPath:output_type -> gosdn.pnd.GetPathResponse 39, // 71: gosdn.pnd.PndService.SetPathList:output_type -> gosdn.pnd.SetPathListResponse - 41, // 72: gosdn.pnd.PndService.DeleteOnd:output_type -> gosdn.pnd.DeleteOndResponse + 41, // 72: gosdn.pnd.PndService.DeleteMne:output_type -> gosdn.pnd.DeleteMneResponse 45, // 73: gosdn.pnd.PndService.SubscribePath:output_type -> gosdn.pnd.SubscribePathResponse 60, // [60:74] is the sub-list for method output_type 46, // [46:60] is the sub-list for method input_type @@ -3481,7 +3483,7 @@ func file_gosdn_pnd_pnd_proto_init() { } if !protoimpl.UnsafeEnabled { file_gosdn_pnd_pnd_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetOndListRequest); i { + switch v := v.(*GetMneListRequest); i { case 0: return &v.state case 1: @@ -3493,7 +3495,7 @@ func file_gosdn_pnd_pnd_proto_init() { } } file_gosdn_pnd_pnd_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetOndRequest); i { + switch v := v.(*GetMneRequest); i { case 0: return &v.state case 1: @@ -3565,7 +3567,7 @@ func file_gosdn_pnd_pnd_proto_init() { } } file_gosdn_pnd_pnd_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetOndResponse); i { + switch v := v.(*GetMneResponse); i { case 0: return &v.state case 1: @@ -3577,7 +3579,7 @@ func file_gosdn_pnd_pnd_proto_init() { } } file_gosdn_pnd_pnd_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetOndListResponse); i { + switch v := v.(*GetMneListResponse); i { case 0: return &v.state case 1: @@ -3589,7 +3591,7 @@ func file_gosdn_pnd_pnd_proto_init() { } } file_gosdn_pnd_pnd_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetFlattenedOndListResponse); i { + switch v := v.(*GetFlattenedMneListResponse); i { case 0: return &v.state case 1: @@ -3673,7 +3675,7 @@ func file_gosdn_pnd_pnd_proto_init() { } } file_gosdn_pnd_pnd_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OrchestratedNetworkingDevice); i { + switch v := v.(*ManagedNetworkElement); i { case 0: return &v.state case 1: @@ -3685,7 +3687,7 @@ func file_gosdn_pnd_pnd_proto_init() { } } file_gosdn_pnd_pnd_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FlattenedOrchestratedNetworkingDevice); i { + switch v := v.(*FlattenedManagedNetworkElement); i { case 0: return &v.state case 1: @@ -3709,7 +3711,7 @@ func file_gosdn_pnd_pnd_proto_init() { } } file_gosdn_pnd_pnd_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetOndListRequest); i { + switch v := v.(*SetMneListRequest); i { case 0: return &v.state case 1: @@ -3769,7 +3771,7 @@ func file_gosdn_pnd_pnd_proto_init() { } } file_gosdn_pnd_pnd_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetOnd); i { + switch v := v.(*SetMne); i { case 0: return &v.state case 1: @@ -3817,7 +3819,7 @@ func file_gosdn_pnd_pnd_proto_init() { } } file_gosdn_pnd_pnd_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetOndListResponse); i { + switch v := v.(*SetMneListResponse); i { case 0: return &v.state case 1: @@ -3877,7 +3879,7 @@ func file_gosdn_pnd_pnd_proto_init() { } } file_gosdn_pnd_pnd_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteOndRequest); i { + switch v := v.(*DeleteMneRequest); i { case 0: return &v.state case 1: @@ -3889,7 +3891,7 @@ func file_gosdn_pnd_pnd_proto_init() { } } file_gosdn_pnd_pnd_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteOndResponse); i { + switch v := v.(*DeleteMneResponse); i { case 0: return &v.state case 1: diff --git a/api/go/gosdn/pnd/pnd.pb.gw.go b/api/go/gosdn/pnd/pnd.pb.gw.go index 9695a17b9ecf15cd6c83991039ae36bf4fd12f53..e5e2f606336dc1e5a0e6a91096757aaecbb6fbda 100644 --- a/api/go/gosdn/pnd/pnd.pb.gw.go +++ b/api/go/gosdn/pnd/pnd.pb.gw.go @@ -32,11 +32,11 @@ var _ = utilities.NewDoubleArray var _ = metadata.Join var ( - filter_PndService_GetFlattenedOndList_0 = &utilities.DoubleArray{Encoding: map[string]int{"pid": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} + filter_PndService_GetFlattenedMneList_0 = &utilities.DoubleArray{Encoding: map[string]int{"pid": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} ) -func request_PndService_GetFlattenedOndList_0(ctx context.Context, marshaler runtime.Marshaler, client PndServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetOndListRequest +func request_PndService_GetFlattenedMneList_0(ctx context.Context, marshaler runtime.Marshaler, client PndServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetMneListRequest var metadata runtime.ServerMetadata var ( @@ -59,17 +59,17 @@ func request_PndService_GetFlattenedOndList_0(ctx context.Context, marshaler run if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_PndService_GetFlattenedOndList_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_PndService_GetFlattenedMneList_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.GetFlattenedOndList(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.GetFlattenedMneList(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_PndService_GetFlattenedOndList_0(ctx context.Context, marshaler runtime.Marshaler, server PndServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetOndListRequest +func local_request_PndService_GetFlattenedMneList_0(ctx context.Context, marshaler runtime.Marshaler, server PndServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetMneListRequest var metadata runtime.ServerMetadata var ( @@ -92,21 +92,21 @@ func local_request_PndService_GetFlattenedOndList_0(ctx context.Context, marshal if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_PndService_GetFlattenedOndList_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_PndService_GetFlattenedMneList_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.GetFlattenedOndList(ctx, &protoReq) + msg, err := server.GetFlattenedMneList(ctx, &protoReq) return msg, metadata, err } var ( - filter_PndService_GetOnd_0 = &utilities.DoubleArray{Encoding: map[string]int{"pid": 0, "did": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} + filter_PndService_GetMne_0 = &utilities.DoubleArray{Encoding: map[string]int{"pid": 0, "mneid": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} ) -func request_PndService_GetOnd_0(ctx context.Context, marshaler runtime.Marshaler, client PndServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetOndRequest +func request_PndService_GetMne_0(ctx context.Context, marshaler runtime.Marshaler, client PndServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetMneRequest var metadata runtime.ServerMetadata var ( @@ -126,30 +126,30 @@ func request_PndService_GetOnd_0(ctx context.Context, marshaler runtime.Marshale return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pid", err) } - val, ok = pathParams["did"] + val, ok = pathParams["mneid"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "did") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "mneid") } - protoReq.Did, err = runtime.String(val) + protoReq.Mneid, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "did", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "mneid", err) } if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_PndService_GetOnd_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_PndService_GetMne_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.GetOnd(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.GetMne(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_PndService_GetOnd_0(ctx context.Context, marshaler runtime.Marshaler, server PndServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetOndRequest +func local_request_PndService_GetMne_0(ctx context.Context, marshaler runtime.Marshaler, server PndServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetMneRequest var metadata runtime.ServerMetadata var ( @@ -169,30 +169,30 @@ func local_request_PndService_GetOnd_0(ctx context.Context, marshaler runtime.Ma return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pid", err) } - val, ok = pathParams["did"] + val, ok = pathParams["mneid"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "did") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "mneid") } - protoReq.Did, err = runtime.String(val) + protoReq.Mneid, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "did", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "mneid", err) } if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_PndService_GetOnd_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_PndService_GetMne_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.GetOnd(ctx, &protoReq) + msg, err := server.GetMne(ctx, &protoReq) return msg, metadata, err } -func request_PndService_SetOndList_0(ctx context.Context, marshaler runtime.Marshaler, client PndServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SetOndListRequest +func request_PndService_SetMneList_0(ctx context.Context, marshaler runtime.Marshaler, client PndServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SetMneListRequest var metadata runtime.ServerMetadata newReader, berr := utilities.IOReaderFactory(req.Body) @@ -220,13 +220,13 @@ func request_PndService_SetOndList_0(ctx context.Context, marshaler runtime.Mars return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pid", err) } - msg, err := client.SetOndList(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.SetMneList(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_PndService_SetOndList_0(ctx context.Context, marshaler runtime.Marshaler, server PndServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SetOndListRequest +func local_request_PndService_SetMneList_0(ctx context.Context, marshaler runtime.Marshaler, server PndServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SetMneListRequest var metadata runtime.ServerMetadata newReader, berr := utilities.IOReaderFactory(req.Body) @@ -254,7 +254,7 @@ func local_request_PndService_SetOndList_0(ctx context.Context, marshaler runtim return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pid", err) } - msg, err := server.SetOndList(ctx, &protoReq) + msg, err := server.SetMneList(ctx, &protoReq) return msg, metadata, err } @@ -716,7 +716,7 @@ func local_request_PndService_SetChangeList_0(ctx context.Context, marshaler run } var ( - filter_PndService_GetPath_0 = &utilities.DoubleArray{Encoding: map[string]int{"pid": 0, "did": 1, "path": 2}, Base: []int{1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 1, 1, 2, 3, 4}} + filter_PndService_GetPath_0 = &utilities.DoubleArray{Encoding: map[string]int{"pid": 0, "mneid": 1, "path": 2}, Base: []int{1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 1, 1, 2, 3, 4}} ) func request_PndService_GetPath_0(ctx context.Context, marshaler runtime.Marshaler, client PndServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -740,14 +740,14 @@ func request_PndService_GetPath_0(ctx context.Context, marshaler runtime.Marshal return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pid", err) } - val, ok = pathParams["did"] + val, ok = pathParams["mneid"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "did") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "mneid") } - protoReq.Did, err = runtime.String(val) + protoReq.Mneid, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "did", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "mneid", err) } val, ok = pathParams["path"] @@ -793,14 +793,14 @@ func local_request_PndService_GetPath_0(ctx context.Context, marshaler runtime.M return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pid", err) } - val, ok = pathParams["did"] + val, ok = pathParams["mneid"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "did") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "mneid") } - protoReq.Did, err = runtime.String(val) + protoReq.Mneid, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "did", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "mneid", err) } val, ok = pathParams["path"] @@ -894,11 +894,11 @@ func local_request_PndService_SetPathList_0(ctx context.Context, marshaler runti } var ( - filter_PndService_DeleteOnd_0 = &utilities.DoubleArray{Encoding: map[string]int{"pid": 0, "did": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} + filter_PndService_DeleteMne_0 = &utilities.DoubleArray{Encoding: map[string]int{"pid": 0, "mneid": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} ) -func request_PndService_DeleteOnd_0(ctx context.Context, marshaler runtime.Marshaler, client PndServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteOndRequest +func request_PndService_DeleteMne_0(ctx context.Context, marshaler runtime.Marshaler, client PndServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteMneRequest var metadata runtime.ServerMetadata var ( @@ -918,30 +918,30 @@ func request_PndService_DeleteOnd_0(ctx context.Context, marshaler runtime.Marsh return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pid", err) } - val, ok = pathParams["did"] + val, ok = pathParams["mneid"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "did") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "mneid") } - protoReq.Did, err = runtime.String(val) + protoReq.Mneid, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "did", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "mneid", err) } if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_PndService_DeleteOnd_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_PndService_DeleteMne_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.DeleteOnd(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.DeleteMne(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_PndService_DeleteOnd_0(ctx context.Context, marshaler runtime.Marshaler, server PndServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq DeleteOndRequest +func local_request_PndService_DeleteMne_0(ctx context.Context, marshaler runtime.Marshaler, server PndServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteMneRequest var metadata runtime.ServerMetadata var ( @@ -961,24 +961,24 @@ func local_request_PndService_DeleteOnd_0(ctx context.Context, marshaler runtime return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pid", err) } - val, ok = pathParams["did"] + val, ok = pathParams["mneid"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "did") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "mneid") } - protoReq.Did, err = runtime.String(val) + protoReq.Mneid, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "did", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "mneid", err) } if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_PndService_DeleteOnd_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_PndService_DeleteMne_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.DeleteOnd(ctx, &protoReq) + msg, err := server.DeleteMne(ctx, &protoReq) return msg, metadata, err } @@ -989,18 +989,18 @@ func local_request_PndService_DeleteOnd_0(ctx context.Context, marshaler runtime // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterPndServiceHandlerFromEndpoint instead. func RegisterPndServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PndServiceServer) error { - mux.Handle("GET", pattern_PndService_GetFlattenedOndList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_PndService_GetFlattenedMneList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.pnd.PndService/GetFlattenedOndList", runtime.WithHTTPPathPattern("/pnds/{pid}/onds")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.pnd.PndService/GetFlattenedMneList", runtime.WithHTTPPathPattern("/pnds/{pid}/mnes")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_PndService_GetFlattenedOndList_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_PndService_GetFlattenedMneList_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -1008,22 +1008,22 @@ func RegisterPndServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, return } - forward_PndService_GetFlattenedOndList_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_PndService_GetFlattenedMneList_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_PndService_GetOnd_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_PndService_GetMne_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.pnd.PndService/GetOnd", runtime.WithHTTPPathPattern("/pnds/{pid}/ond/{did}")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.pnd.PndService/GetMne", runtime.WithHTTPPathPattern("/pnds/{pid}/mne/{mneid}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_PndService_GetOnd_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_PndService_GetMne_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -1031,22 +1031,22 @@ func RegisterPndServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, return } - forward_PndService_GetOnd_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_PndService_GetMne_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("POST", pattern_PndService_SetOndList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_PndService_SetMneList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.pnd.PndService/SetOndList", runtime.WithHTTPPathPattern("/pnds/{pid}/onds")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.pnd.PndService/SetMneList", runtime.WithHTTPPathPattern("/pnds/{pid}/mnes")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_PndService_SetOndList_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_PndService_SetMneList_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -1054,7 +1054,7 @@ func RegisterPndServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, return } - forward_PndService_SetOndList_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_PndService_SetMneList_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -1202,7 +1202,7 @@ func RegisterPndServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.pnd.PndService/GetPath", runtime.WithHTTPPathPattern("/pnds/{pid}/onds/{did}/paths/{path}")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.pnd.PndService/GetPath", runtime.WithHTTPPathPattern("/pnds/{pid}/mnes/{mneid}/paths/{path}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1225,7 +1225,7 @@ func RegisterPndServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.pnd.PndService/SetPathList", runtime.WithHTTPPathPattern("/pnds/{pid}/onds/paths")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.pnd.PndService/SetPathList", runtime.WithHTTPPathPattern("/pnds/{pid}/mnes/paths")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1242,18 +1242,18 @@ func RegisterPndServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, }) - mux.Handle("DELETE", pattern_PndService_DeleteOnd_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("DELETE", pattern_PndService_DeleteMne_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.pnd.PndService/DeleteOnd", runtime.WithHTTPPathPattern("/pnds/{pid}/onds/{did}")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/gosdn.pnd.PndService/DeleteMne", runtime.WithHTTPPathPattern("/pnds/{pid}/mnes/{mneid}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_PndService_DeleteOnd_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_PndService_DeleteMne_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -1261,7 +1261,7 @@ func RegisterPndServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, return } - forward_PndService_DeleteOnd_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_PndService_DeleteMne_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -1306,63 +1306,63 @@ func RegisterPndServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn // "PndServiceClient" to call the correct interceptors. func RegisterPndServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PndServiceClient) error { - mux.Handle("GET", pattern_PndService_GetFlattenedOndList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_PndService_GetFlattenedMneList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.pnd.PndService/GetFlattenedOndList", runtime.WithHTTPPathPattern("/pnds/{pid}/onds")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.pnd.PndService/GetFlattenedMneList", runtime.WithHTTPPathPattern("/pnds/{pid}/mnes")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_PndService_GetFlattenedOndList_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_PndService_GetFlattenedMneList_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_PndService_GetFlattenedOndList_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_PndService_GetFlattenedMneList_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_PndService_GetOnd_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_PndService_GetMne_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.pnd.PndService/GetOnd", runtime.WithHTTPPathPattern("/pnds/{pid}/ond/{did}")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.pnd.PndService/GetMne", runtime.WithHTTPPathPattern("/pnds/{pid}/mne/{mneid}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_PndService_GetOnd_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_PndService_GetMne_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_PndService_GetOnd_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_PndService_GetMne_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("POST", pattern_PndService_SetOndList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_PndService_SetMneList_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.pnd.PndService/SetOndList", runtime.WithHTTPPathPattern("/pnds/{pid}/onds")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.pnd.PndService/SetMneList", runtime.WithHTTPPathPattern("/pnds/{pid}/mnes")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_PndService_SetOndList_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_PndService_SetMneList_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_PndService_SetOndList_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_PndService_SetMneList_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -1490,7 +1490,7 @@ func RegisterPndServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.pnd.PndService/GetPath", runtime.WithHTTPPathPattern("/pnds/{pid}/onds/{did}/paths/{path}")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.pnd.PndService/GetPath", runtime.WithHTTPPathPattern("/pnds/{pid}/mnes/{mneid}/paths/{path}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1510,7 +1510,7 @@ func RegisterPndServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.pnd.PndService/SetPathList", runtime.WithHTTPPathPattern("/pnds/{pid}/onds/paths")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.pnd.PndService/SetPathList", runtime.WithHTTPPathPattern("/pnds/{pid}/mnes/paths")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1526,23 +1526,23 @@ func RegisterPndServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, }) - mux.Handle("DELETE", pattern_PndService_DeleteOnd_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("DELETE", pattern_PndService_DeleteMne_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.pnd.PndService/DeleteOnd", runtime.WithHTTPPathPattern("/pnds/{pid}/onds/{did}")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/gosdn.pnd.PndService/DeleteMne", runtime.WithHTTPPathPattern("/pnds/{pid}/mnes/{mneid}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_PndService_DeleteOnd_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_PndService_DeleteMne_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_PndService_DeleteOnd_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_PndService_DeleteMne_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -1550,11 +1550,11 @@ func RegisterPndServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, } var ( - pattern_PndService_GetFlattenedOndList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 2, 2}, []string{"pnds", "pid", "onds"}, "")) + pattern_PndService_GetFlattenedMneList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 2, 2}, []string{"pnds", "pid", "mnes"}, "")) - pattern_PndService_GetOnd_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"pnds", "pid", "ond", "did"}, "")) + pattern_PndService_GetMne_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"pnds", "pid", "mne", "mneid"}, "")) - pattern_PndService_SetOndList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 2, 2}, []string{"pnds", "pid", "onds"}, "")) + pattern_PndService_SetMneList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 2, 2}, []string{"pnds", "pid", "mnes"}, "")) pattern_PndService_GetSbiList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 2, 2}, []string{"pnds", "pid", "sbis"}, "")) @@ -1568,19 +1568,19 @@ var ( pattern_PndService_SetChangeList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 2, 2}, []string{"pnds", "pid", "changes"}, "")) - pattern_PndService_GetPath_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"pnds", "pid", "onds", "did", "paths", "path"}, "")) + pattern_PndService_GetPath_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"pnds", "pid", "mnes", "mneid", "paths", "path"}, "")) - pattern_PndService_SetPathList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 2, 2, 2, 3}, []string{"pnds", "pid", "onds", "paths"}, "")) + pattern_PndService_SetPathList_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 2, 2, 2, 3}, []string{"pnds", "pid", "mnes", "paths"}, "")) - pattern_PndService_DeleteOnd_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"pnds", "pid", "onds", "did"}, "")) + pattern_PndService_DeleteMne_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"pnds", "pid", "mnes", "mneid"}, "")) ) var ( - forward_PndService_GetFlattenedOndList_0 = runtime.ForwardResponseMessage + forward_PndService_GetFlattenedMneList_0 = runtime.ForwardResponseMessage - forward_PndService_GetOnd_0 = runtime.ForwardResponseMessage + forward_PndService_GetMne_0 = runtime.ForwardResponseMessage - forward_PndService_SetOndList_0 = runtime.ForwardResponseMessage + forward_PndService_SetMneList_0 = runtime.ForwardResponseMessage forward_PndService_GetSbiList_0 = runtime.ForwardResponseMessage @@ -1598,5 +1598,5 @@ var ( forward_PndService_SetPathList_0 = runtime.ForwardResponseMessage - forward_PndService_DeleteOnd_0 = runtime.ForwardResponseMessage + forward_PndService_DeleteMne_0 = runtime.ForwardResponseMessage ) diff --git a/api/go/gosdn/pnd/pnd_grpc.pb.go b/api/go/gosdn/pnd/pnd_grpc.pb.go index 977456c2a3623a5bb813d926f967e811e0298add..0a76d4fe506274046a276c84e8089fda2df85d47 100644 --- a/api/go/gosdn/pnd/pnd_grpc.pb.go +++ b/api/go/gosdn/pnd/pnd_grpc.pb.go @@ -18,22 +18,22 @@ const _ = grpc.SupportPackageIsVersion7 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type PndServiceClient interface { - // Allows to request all Orchestrated Networking Devices (OND) which are + // Allows to request all Managed Network Elements (MNE) which are // managed by a specific Principal Network Domain. - // Full ONDs are provided, which also includes the OND config as gNMI + // Full MNEs are provided, which also includes the MNE config as gNMI // notification. - GetOndList(ctx context.Context, in *GetOndListRequest, opts ...grpc.CallOption) (*GetOndListResponse, error) - // Allows to request all Orchestrated Networking Devices (OND) which are + GetMneList(ctx context.Context, in *GetMneListRequest, opts ...grpc.CallOption) (*GetMneListResponse, error) + // Allows to request all Managed Network Elements (MNE) which are // managed by a specific Principal Network Domain. - // Flattened ONDs are provided, which does not include the OND config as gNMI + // Flattened MNEs are provided, which does not include the MNE config as gNMI // notification. - GetFlattenedOndList(ctx context.Context, in *GetOndListRequest, opts ...grpc.CallOption) (*GetFlattenedOndListResponse, error) - // Allows to request a specific Orchestrated Networking Device which is managed by a + GetFlattenedMneList(ctx context.Context, in *GetMneListRequest, opts ...grpc.CallOption) (*GetFlattenedMneListResponse, error) + // Allows to request a specific Managed Network Element which is managed by a // specific Principal Network Domain. - GetOnd(ctx context.Context, in *GetOndRequest, opts ...grpc.CallOption) (*GetOndResponse, error) - // Allows add multiple Orchestrated Networking Devices to be managed by a + GetMne(ctx context.Context, in *GetMneRequest, opts ...grpc.CallOption) (*GetMneResponse, error) + // Allows to add multiple Managed Network Elements to be managed by a // specific Principal Network Domain. - SetOndList(ctx context.Context, in *SetOndListRequest, opts ...grpc.CallOption) (*SetOndListResponse, error) + SetMneList(ctx context.Context, in *SetMneListRequest, opts ...grpc.CallOption) (*SetMneListResponse, error) // Allows to request all Southbound Interfaces a specific Principal Network // Domain supports. GetSbiList(ctx context.Context, in *GetSbiListRequest, opts ...grpc.CallOption) (*GetSbiListResponse, error) @@ -49,16 +49,16 @@ type PndServiceClient interface { GetChange(ctx context.Context, in *GetChangeRequest, opts ...grpc.CallOption) (*GetChangeResponse, error) // Allows to operate on multiple Changes registered for a specific Principal Network Domain. SetChangeList(ctx context.Context, in *SetChangeListRequest, opts ...grpc.CallOption) (*SetChangeListResponse, error) - // Allows to request a specific Path of a Orchestrated Networking Device, + // Allows to request a specific Path of a Managed Network Element, // managed by a specific Principal Network Domain. GetPath(ctx context.Context, in *GetPathRequest, opts ...grpc.CallOption) (*GetPathResponse, error) - // Allows to set a specific Path of a Orchestrated Networking Device, + // Allows to set a specific Path of a Managed Network Element, // managed by a specific Principal Network Domain. SetPathList(ctx context.Context, in *SetPathListRequest, opts ...grpc.CallOption) (*SetPathListResponse, error) - // Allows to delete a specific Orchestrated Networking Device which is managed by a + // Allows to delete a specific Managed Network Element which is managed by a // specific Principal Network Domain. - DeleteOnd(ctx context.Context, in *DeleteOndRequest, opts ...grpc.CallOption) (*DeleteOndResponse, error) - // Allows to subscribe to multiple paths of an Orchestrated Networking Device which is + DeleteMne(ctx context.Context, in *DeleteMneRequest, opts ...grpc.CallOption) (*DeleteMneResponse, error) + // Allows to subscribe to multiple paths of a Managed Network Element which is // managed by a specific Principal Network Domain and streams data depending on the subscribe // method. SubscribePath(ctx context.Context, in *SubscribePathRequest, opts ...grpc.CallOption) (PndService_SubscribePathClient, error) @@ -72,36 +72,36 @@ func NewPndServiceClient(cc grpc.ClientConnInterface) PndServiceClient { return &pndServiceClient{cc} } -func (c *pndServiceClient) GetOndList(ctx context.Context, in *GetOndListRequest, opts ...grpc.CallOption) (*GetOndListResponse, error) { - out := new(GetOndListResponse) - err := c.cc.Invoke(ctx, "/gosdn.pnd.PndService/GetOndList", in, out, opts...) +func (c *pndServiceClient) GetMneList(ctx context.Context, in *GetMneListRequest, opts ...grpc.CallOption) (*GetMneListResponse, error) { + out := new(GetMneListResponse) + err := c.cc.Invoke(ctx, "/gosdn.pnd.PndService/GetMneList", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *pndServiceClient) GetFlattenedOndList(ctx context.Context, in *GetOndListRequest, opts ...grpc.CallOption) (*GetFlattenedOndListResponse, error) { - out := new(GetFlattenedOndListResponse) - err := c.cc.Invoke(ctx, "/gosdn.pnd.PndService/GetFlattenedOndList", in, out, opts...) +func (c *pndServiceClient) GetFlattenedMneList(ctx context.Context, in *GetMneListRequest, opts ...grpc.CallOption) (*GetFlattenedMneListResponse, error) { + out := new(GetFlattenedMneListResponse) + err := c.cc.Invoke(ctx, "/gosdn.pnd.PndService/GetFlattenedMneList", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *pndServiceClient) GetOnd(ctx context.Context, in *GetOndRequest, opts ...grpc.CallOption) (*GetOndResponse, error) { - out := new(GetOndResponse) - err := c.cc.Invoke(ctx, "/gosdn.pnd.PndService/GetOnd", in, out, opts...) +func (c *pndServiceClient) GetMne(ctx context.Context, in *GetMneRequest, opts ...grpc.CallOption) (*GetMneResponse, error) { + out := new(GetMneResponse) + err := c.cc.Invoke(ctx, "/gosdn.pnd.PndService/GetMne", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *pndServiceClient) SetOndList(ctx context.Context, in *SetOndListRequest, opts ...grpc.CallOption) (*SetOndListResponse, error) { - out := new(SetOndListResponse) - err := c.cc.Invoke(ctx, "/gosdn.pnd.PndService/SetOndList", in, out, opts...) +func (c *pndServiceClient) SetMneList(ctx context.Context, in *SetMneListRequest, opts ...grpc.CallOption) (*SetMneListResponse, error) { + out := new(SetMneListResponse) + err := c.cc.Invoke(ctx, "/gosdn.pnd.PndService/SetMneList", in, out, opts...) if err != nil { return nil, err } @@ -180,9 +180,9 @@ func (c *pndServiceClient) SetPathList(ctx context.Context, in *SetPathListReque return out, nil } -func (c *pndServiceClient) DeleteOnd(ctx context.Context, in *DeleteOndRequest, opts ...grpc.CallOption) (*DeleteOndResponse, error) { - out := new(DeleteOndResponse) - err := c.cc.Invoke(ctx, "/gosdn.pnd.PndService/DeleteOnd", in, out, opts...) +func (c *pndServiceClient) DeleteMne(ctx context.Context, in *DeleteMneRequest, opts ...grpc.CallOption) (*DeleteMneResponse, error) { + out := new(DeleteMneResponse) + err := c.cc.Invoke(ctx, "/gosdn.pnd.PndService/DeleteMne", in, out, opts...) if err != nil { return nil, err } @@ -225,22 +225,22 @@ func (x *pndServiceSubscribePathClient) Recv() (*SubscribePathResponse, error) { // All implementations must embed UnimplementedPndServiceServer // for forward compatibility type PndServiceServer interface { - // Allows to request all Orchestrated Networking Devices (OND) which are + // Allows to request all Managed Network Elements (MNE) which are // managed by a specific Principal Network Domain. - // Full ONDs are provided, which also includes the OND config as gNMI + // Full MNEs are provided, which also includes the MNE config as gNMI // notification. - GetOndList(context.Context, *GetOndListRequest) (*GetOndListResponse, error) - // Allows to request all Orchestrated Networking Devices (OND) which are + GetMneList(context.Context, *GetMneListRequest) (*GetMneListResponse, error) + // Allows to request all Managed Network Elements (MNE) which are // managed by a specific Principal Network Domain. - // Flattened ONDs are provided, which does not include the OND config as gNMI + // Flattened MNEs are provided, which does not include the MNE config as gNMI // notification. - GetFlattenedOndList(context.Context, *GetOndListRequest) (*GetFlattenedOndListResponse, error) - // Allows to request a specific Orchestrated Networking Device which is managed by a + GetFlattenedMneList(context.Context, *GetMneListRequest) (*GetFlattenedMneListResponse, error) + // Allows to request a specific Managed Network Element which is managed by a // specific Principal Network Domain. - GetOnd(context.Context, *GetOndRequest) (*GetOndResponse, error) - // Allows add multiple Orchestrated Networking Devices to be managed by a + GetMne(context.Context, *GetMneRequest) (*GetMneResponse, error) + // Allows to add multiple Managed Network Elements to be managed by a // specific Principal Network Domain. - SetOndList(context.Context, *SetOndListRequest) (*SetOndListResponse, error) + SetMneList(context.Context, *SetMneListRequest) (*SetMneListResponse, error) // Allows to request all Southbound Interfaces a specific Principal Network // Domain supports. GetSbiList(context.Context, *GetSbiListRequest) (*GetSbiListResponse, error) @@ -256,16 +256,16 @@ type PndServiceServer interface { GetChange(context.Context, *GetChangeRequest) (*GetChangeResponse, error) // Allows to operate on multiple Changes registered for a specific Principal Network Domain. SetChangeList(context.Context, *SetChangeListRequest) (*SetChangeListResponse, error) - // Allows to request a specific Path of a Orchestrated Networking Device, + // Allows to request a specific Path of a Managed Network Element, // managed by a specific Principal Network Domain. GetPath(context.Context, *GetPathRequest) (*GetPathResponse, error) - // Allows to set a specific Path of a Orchestrated Networking Device, + // Allows to set a specific Path of a Managed Network Element, // managed by a specific Principal Network Domain. SetPathList(context.Context, *SetPathListRequest) (*SetPathListResponse, error) - // Allows to delete a specific Orchestrated Networking Device which is managed by a + // Allows to delete a specific Managed Network Element which is managed by a // specific Principal Network Domain. - DeleteOnd(context.Context, *DeleteOndRequest) (*DeleteOndResponse, error) - // Allows to subscribe to multiple paths of an Orchestrated Networking Device which is + DeleteMne(context.Context, *DeleteMneRequest) (*DeleteMneResponse, error) + // Allows to subscribe to multiple paths of a Managed Network Element which is // managed by a specific Principal Network Domain and streams data depending on the subscribe // method. SubscribePath(*SubscribePathRequest, PndService_SubscribePathServer) error @@ -276,17 +276,17 @@ type PndServiceServer interface { type UnimplementedPndServiceServer struct { } -func (UnimplementedPndServiceServer) GetOndList(context.Context, *GetOndListRequest) (*GetOndListResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetOndList not implemented") +func (UnimplementedPndServiceServer) GetMneList(context.Context, *GetMneListRequest) (*GetMneListResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMneList not implemented") } -func (UnimplementedPndServiceServer) GetFlattenedOndList(context.Context, *GetOndListRequest) (*GetFlattenedOndListResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetFlattenedOndList not implemented") +func (UnimplementedPndServiceServer) GetFlattenedMneList(context.Context, *GetMneListRequest) (*GetFlattenedMneListResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetFlattenedMneList not implemented") } -func (UnimplementedPndServiceServer) GetOnd(context.Context, *GetOndRequest) (*GetOndResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetOnd not implemented") +func (UnimplementedPndServiceServer) GetMne(context.Context, *GetMneRequest) (*GetMneResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMne not implemented") } -func (UnimplementedPndServiceServer) SetOndList(context.Context, *SetOndListRequest) (*SetOndListResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SetOndList not implemented") +func (UnimplementedPndServiceServer) SetMneList(context.Context, *SetMneListRequest) (*SetMneListResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetMneList not implemented") } func (UnimplementedPndServiceServer) GetSbiList(context.Context, *GetSbiListRequest) (*GetSbiListResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetSbiList not implemented") @@ -312,8 +312,8 @@ func (UnimplementedPndServiceServer) GetPath(context.Context, *GetPathRequest) ( func (UnimplementedPndServiceServer) SetPathList(context.Context, *SetPathListRequest) (*SetPathListResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SetPathList not implemented") } -func (UnimplementedPndServiceServer) DeleteOnd(context.Context, *DeleteOndRequest) (*DeleteOndResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteOnd not implemented") +func (UnimplementedPndServiceServer) DeleteMne(context.Context, *DeleteMneRequest) (*DeleteMneResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteMne not implemented") } func (UnimplementedPndServiceServer) SubscribePath(*SubscribePathRequest, PndService_SubscribePathServer) error { return status.Errorf(codes.Unimplemented, "method SubscribePath not implemented") @@ -331,74 +331,74 @@ func RegisterPndServiceServer(s grpc.ServiceRegistrar, srv PndServiceServer) { s.RegisterService(&PndService_ServiceDesc, srv) } -func _PndService_GetOndList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetOndListRequest) +func _PndService_GetMneList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetMneListRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(PndServiceServer).GetOndList(ctx, in) + return srv.(PndServiceServer).GetMneList(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/gosdn.pnd.PndService/GetOndList", + FullMethod: "/gosdn.pnd.PndService/GetMneList", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PndServiceServer).GetOndList(ctx, req.(*GetOndListRequest)) + return srv.(PndServiceServer).GetMneList(ctx, req.(*GetMneListRequest)) } return interceptor(ctx, in, info, handler) } -func _PndService_GetFlattenedOndList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetOndListRequest) +func _PndService_GetFlattenedMneList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetMneListRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(PndServiceServer).GetFlattenedOndList(ctx, in) + return srv.(PndServiceServer).GetFlattenedMneList(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/gosdn.pnd.PndService/GetFlattenedOndList", + FullMethod: "/gosdn.pnd.PndService/GetFlattenedMneList", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PndServiceServer).GetFlattenedOndList(ctx, req.(*GetOndListRequest)) + return srv.(PndServiceServer).GetFlattenedMneList(ctx, req.(*GetMneListRequest)) } return interceptor(ctx, in, info, handler) } -func _PndService_GetOnd_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetOndRequest) +func _PndService_GetMne_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetMneRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(PndServiceServer).GetOnd(ctx, in) + return srv.(PndServiceServer).GetMne(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/gosdn.pnd.PndService/GetOnd", + FullMethod: "/gosdn.pnd.PndService/GetMne", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PndServiceServer).GetOnd(ctx, req.(*GetOndRequest)) + return srv.(PndServiceServer).GetMne(ctx, req.(*GetMneRequest)) } return interceptor(ctx, in, info, handler) } -func _PndService_SetOndList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetOndListRequest) +func _PndService_SetMneList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetMneListRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(PndServiceServer).SetOndList(ctx, in) + return srv.(PndServiceServer).SetMneList(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/gosdn.pnd.PndService/SetOndList", + FullMethod: "/gosdn.pnd.PndService/SetMneList", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PndServiceServer).SetOndList(ctx, req.(*SetOndListRequest)) + return srv.(PndServiceServer).SetMneList(ctx, req.(*SetMneListRequest)) } return interceptor(ctx, in, info, handler) } @@ -547,20 +547,20 @@ func _PndService_SetPathList_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } -func _PndService_DeleteOnd_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteOndRequest) +func _PndService_DeleteMne_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteMneRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(PndServiceServer).DeleteOnd(ctx, in) + return srv.(PndServiceServer).DeleteMne(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/gosdn.pnd.PndService/DeleteOnd", + FullMethod: "/gosdn.pnd.PndService/DeleteMne", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PndServiceServer).DeleteOnd(ctx, req.(*DeleteOndRequest)) + return srv.(PndServiceServer).DeleteMne(ctx, req.(*DeleteMneRequest)) } return interceptor(ctx, in, info, handler) } @@ -594,20 +594,20 @@ var PndService_ServiceDesc = grpc.ServiceDesc{ HandlerType: (*PndServiceServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "GetOndList", - Handler: _PndService_GetOndList_Handler, + MethodName: "GetMneList", + Handler: _PndService_GetMneList_Handler, }, { - MethodName: "GetFlattenedOndList", - Handler: _PndService_GetFlattenedOndList_Handler, + MethodName: "GetFlattenedMneList", + Handler: _PndService_GetFlattenedMneList_Handler, }, { - MethodName: "GetOnd", - Handler: _PndService_GetOnd_Handler, + MethodName: "GetMne", + Handler: _PndService_GetMne_Handler, }, { - MethodName: "SetOndList", - Handler: _PndService_SetOndList_Handler, + MethodName: "SetMneList", + Handler: _PndService_SetMneList_Handler, }, { MethodName: "GetSbiList", @@ -642,8 +642,8 @@ var PndService_ServiceDesc = grpc.ServiceDesc{ Handler: _PndService_SetPathList_Handler, }, { - MethodName: "DeleteOnd", - Handler: _PndService_DeleteOnd_Handler, + MethodName: "DeleteMne", + Handler: _PndService_DeleteMne_Handler, }, }, Streams: []grpc.StreamDesc{ diff --git a/api/openapiv2/gosdn_northbound.swagger.json b/api/openapiv2/gosdn_northbound.swagger.json index b0530b889b4ff543badeaf750604d8049292ded6..1e83ff86a42e2c5caa0874196388e5bccc5a3fc2 100644 --- a/api/openapiv2/gosdn_northbound.swagger.json +++ b/api/openapiv2/gosdn_northbound.swagger.json @@ -39,7 +39,7 @@ "name": "CsbiService" }, { - "name": "DeviceService" + "name": "NetworkElementService" }, { "name": "AuthService" @@ -97,14 +97,15 @@ ] } }, - "/device": { - "get": { - "operationId": "DeviceService_Get", + "/login": { + "post": { + "summary": "Allows a user to login creating a session for further actions.", + "operationId": "AuthService_Login", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/deviceGetDeviceResponse" + "$ref": "#/definitions/rbacLoginResponse" } }, "default": { @@ -116,32 +117,28 @@ }, "parameters": [ { - "name": "timestamp", - "in": "query", - "required": false, - "type": "string", - "format": "int64" - }, - { - "name": "deviceID", - "in": "query", - "required": false, - "type": "string" + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/rbacLoginRequest" + } } ], "tags": [ - "DeviceService" + "AuthService" ] } }, - "/device/all": { - "get": { - "operationId": "DeviceService_GetAll", + "/logout/{username}": { + "post": { + "summary": "Allows a user to log out from an existing session.", + "operationId": "AuthService_Logout", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/deviceGetAllDeviceResponse" + "$ref": "#/definitions/rbacLogoutResponse" } }, "default": { @@ -152,6 +149,12 @@ } }, "parameters": [ + { + "name": "username", + "in": "path", + "required": true, + "type": "string" + }, { "name": "timestamp", "in": "query", @@ -161,18 +164,18 @@ } ], "tags": [ - "DeviceService" + "AuthService" ] } }, - "/device/create": { - "post": { - "operationId": "DeviceService_Add", + "/network-element": { + "get": { + "operationId": "NetworkElementService_Get", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/deviceAddDeviceResponse" + "$ref": "#/definitions/networkelementGetNetworkElementResponse" } }, "default": { @@ -184,27 +187,32 @@ }, "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/deviceAddDeviceRequest" - } + "name": "timestamp", + "in": "query", + "required": false, + "type": "string", + "format": "int64" + }, + { + "name": "networkElementId", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ - "DeviceService" + "NetworkElementService" ] } }, - "/device/update": { - "post": { - "operationId": "DeviceService_Update", + "/network-element/all": { + "get": { + "operationId": "NetworkElementService_GetAll", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/deviceUpdateDeviceResponse" + "$ref": "#/definitions/networkelementGetAllNetworkElementResponse" } }, "default": { @@ -216,28 +224,26 @@ }, "parameters": [ { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/deviceUpdateDeviceRequest" - } + "name": "timestamp", + "in": "query", + "required": false, + "type": "string", + "format": "int64" } ], "tags": [ - "DeviceService" + "NetworkElementService" ] } }, - "/login": { + "/network-element/create": { "post": { - "summary": "Allows a user to login creating a session for further actions.", - "operationId": "AuthService_Login", + "operationId": "NetworkElementService_Add", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/rbacLoginResponse" + "$ref": "#/definitions/networkelementAddNetworkElementResponse" } }, "default": { @@ -253,24 +259,23 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/rbacLoginRequest" + "$ref": "#/definitions/networkelementAddNetworkElementRequest" } } ], "tags": [ - "AuthService" + "NetworkElementService" ] } }, - "/logout/{username}": { + "/network-element/update": { "post": { - "summary": "Allows a user to log out from an existing session.", - "operationId": "AuthService_Logout", + "operationId": "NetworkElementService_Update", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/rbacLogoutResponse" + "$ref": "#/definitions/networkelementUpdateNetworkElementResponse" } }, "default": { @@ -282,21 +287,16 @@ }, "parameters": [ { - "name": "username", - "in": "path", + "name": "body", + "in": "body", "required": true, - "type": "string" - }, - { - "name": "timestamp", - "in": "query", - "required": false, - "type": "string", - "format": "int64" + "schema": { + "$ref": "#/definitions/networkelementUpdateNetworkElementRequest" + } } ], "tags": [ - "AuthService" + "NetworkElementService" ] } }, @@ -575,15 +575,15 @@ ] } }, - "/pnds/{pid}/ond/{did}": { + "/pnds/{pid}/mne/{mneid}": { "get": { - "summary": "Allows to request a specific Orchestrated Networking Device which is managed by a\nspecific Principal Network Domain.", - "operationId": "PndService_GetOnd", + "summary": "Allows to request a specific Managed Network Element which is managed by a\nspecific Principal Network Domain.", + "operationId": "PndService_GetMne", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/pndGetOndResponse" + "$ref": "#/definitions/pndGetMneResponse" } }, "default": { @@ -601,7 +601,7 @@ "type": "string" }, { - "name": "did", + "name": "mneid", "in": "path", "required": true, "type": "string" @@ -619,15 +619,15 @@ ] } }, - "/pnds/{pid}/onds": { + "/pnds/{pid}/mnes": { "get": { - "summary": "Allows to request all Orchestrated Networking Devices (OND) which are\nmanaged by a specific Principal Network Domain.\nFlattened ONDs are provided, which does not include the OND config as gNMI\nnotification.", - "operationId": "PndService_GetFlattenedOndList", + "summary": "Allows to request all Managed Network Elements (MNE) which are\nmanaged by a specific Principal Network Domain.\nFlattened MNEs are provided, which does not include the MNE config as gNMI\nnotification.", + "operationId": "PndService_GetFlattenedMneList", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/pndGetFlattenedOndListResponse" + "$ref": "#/definitions/pndGetFlattenedMneListResponse" } }, "default": { @@ -657,13 +657,13 @@ ] }, "post": { - "summary": "Allows add multiple Orchestrated Networking Devices to be managed by a\nspecific Principal Network Domain.", - "operationId": "PndService_SetOndList", + "summary": "Allows to add multiple Managed Network Elements to be managed by a\nspecific Principal Network Domain.", + "operationId": "PndService_SetMneList", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/pndSetOndListResponse" + "$ref": "#/definitions/pndSetMneListResponse" } }, "default": { @@ -691,10 +691,10 @@ "type": "string", "format": "int64" }, - "ond": { + "mne": { "type": "array", "items": { - "$ref": "#/definitions/pndSetOnd" + "$ref": "#/definitions/pndSetMne" } } } @@ -706,9 +706,9 @@ ] } }, - "/pnds/{pid}/onds/paths": { + "/pnds/{pid}/mnes/paths": { "post": { - "summary": "Allows to set a specific Path of a Orchestrated Networking Device,\nmanaged by a specific Principal Network Domain.", + "summary": "Allows to set a specific Path of a Managed Network Element,\nmanaged by a specific Principal Network Domain.", "operationId": "PndService_SetPathList", "responses": { "200": { @@ -757,15 +757,15 @@ ] } }, - "/pnds/{pid}/onds/{did}": { + "/pnds/{pid}/mnes/{mneid}": { "delete": { - "summary": "Allows to delete a specific Orchestrated Networking Device which is managed by a\nspecific Principal Network Domain.", - "operationId": "PndService_DeleteOnd", + "summary": "Allows to delete a specific Managed Network Element which is managed by a\nspecific Principal Network Domain.", + "operationId": "PndService_DeleteMne", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/pndDeleteOndResponse" + "$ref": "#/definitions/pndDeleteMneResponse" } }, "default": { @@ -783,7 +783,7 @@ "type": "string" }, { - "name": "did", + "name": "mneid", "in": "path", "required": true, "type": "string" @@ -801,9 +801,9 @@ ] } }, - "/pnds/{pid}/onds/{did}/paths/{path}": { + "/pnds/{pid}/mnes/{mneid}/paths/{path}": { "get": { - "summary": "Allows to request a specific Path of a Orchestrated Networking Device,\nmanaged by a specific Principal Network Domain.", + "summary": "Allows to request a specific Path of a Managed Network Element,\nmanaged by a specific Principal Network Domain.", "operationId": "PndService_GetPath", "responses": { "200": { @@ -827,7 +827,7 @@ "type": "string" }, { - "name": "did", + "name": "mneid", "in": "path", "required": true, "type": "string" @@ -1892,127 +1892,6 @@ } } }, - "deviceAddDeviceConfiguration": { - "type": "object", - "properties": { - "address": { - "type": "string" - }, - "sbi": { - "$ref": "#/definitions/southboundSouthboundInterface" - }, - "deviceName": { - "type": "string" - }, - "transportOption": { - "$ref": "#/definitions/transportTransportOption" - } - } - }, - "deviceAddDeviceRequest": { - "type": "object", - "properties": { - "timestamp": { - "type": "string", - "format": "int64" - }, - "device": { - "$ref": "#/definitions/deviceAddDeviceConfiguration" - }, - "pid": { - "type": "string" - } - } - }, - "deviceAddDeviceResponse": { - "type": "object", - "properties": { - "timestamp": { - "type": "string", - "format": "int64" - }, - "status": { - "$ref": "#/definitions/gosdndeviceStatus" - }, - "deviceId": { - "type": "string" - } - } - }, - "deviceDevice": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "model": { - "type": "string" - }, - "transportAddress": { - "type": "string" - } - } - }, - "deviceGetAllDeviceResponse": { - "type": "object", - "properties": { - "timestamp": { - "type": "string", - "format": "int64" - }, - "status": { - "$ref": "#/definitions/gosdndeviceStatus" - }, - "device": { - "type": "array", - "items": { - "$ref": "#/definitions/deviceDevice" - } - } - } - }, - "deviceGetDeviceResponse": { - "type": "object", - "properties": { - "timestamp": { - "type": "string", - "format": "int64" - }, - "status": { - "$ref": "#/definitions/gosdndeviceStatus" - }, - "device": { - "$ref": "#/definitions/deviceDevice" - } - } - }, - "deviceUpdateDeviceRequest": { - "type": "object", - "properties": { - "timestamp": { - "type": "string", - "format": "int64" - }, - "device": { - "$ref": "#/definitions/deviceDevice" - } - } - }, - "deviceUpdateDeviceResponse": { - "type": "object", - "properties": { - "timestamp": { - "type": "string", - "format": "int64" - }, - "status": { - "$ref": "#/definitions/gosdndeviceStatus" - } - } - }, "fakeBoolList": { "type": "object", "properties": { @@ -3087,7 +2966,7 @@ ], "default": "STATE_UNSPECIFIED" }, - "gosdndeviceStatus": { + "gosdnnetworkelementStatus": { "type": "string", "enum": [ "STATUS_UNSPECIFIED", @@ -3240,6 +3119,127 @@ ], "default": "STATUS_UNSPECIFIED" }, + "networkelementAddNetworkElementConfiguration": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "sbi": { + "$ref": "#/definitions/southboundSouthboundInterface" + }, + "networkElementName": { + "type": "string" + }, + "transportOption": { + "$ref": "#/definitions/transportTransportOption" + } + } + }, + "networkelementAddNetworkElementRequest": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "int64" + }, + "networkElement": { + "$ref": "#/definitions/networkelementAddNetworkElementConfiguration" + }, + "pid": { + "type": "string" + } + } + }, + "networkelementAddNetworkElementResponse": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "int64" + }, + "status": { + "$ref": "#/definitions/gosdnnetworkelementStatus" + }, + "networkElementId": { + "type": "string" + } + } + }, + "networkelementGetAllNetworkElementResponse": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "int64" + }, + "status": { + "$ref": "#/definitions/gosdnnetworkelementStatus" + }, + "networkElement": { + "type": "array", + "items": { + "$ref": "#/definitions/networkelementNetworkElement" + } + } + } + }, + "networkelementGetNetworkElementResponse": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "int64" + }, + "status": { + "$ref": "#/definitions/gosdnnetworkelementStatus" + }, + "networkElement": { + "$ref": "#/definitions/networkelementNetworkElement" + } + } + }, + "networkelementNetworkElement": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "model": { + "type": "string" + }, + "transportAddress": { + "type": "string" + } + } + }, + "networkelementUpdateNetworkElementRequest": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "int64" + }, + "networkElement": { + "$ref": "#/definitions/networkelementNetworkElement" + } + } + }, + "networkelementUpdateNetworkElementResponse": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "int64" + }, + "status": { + "$ref": "#/definitions/gosdnnetworkelementStatus" + } + } + }, "pndApiOperation": { "type": "string", "enum": [ @@ -3271,7 +3271,7 @@ "pndChangeRequest": { "type": "object", "properties": { - "did": { + "mneid": { "type": "string" }, "path": { @@ -3297,7 +3297,7 @@ ], "default": "CHANGE_STATE_UNSPECIFIED" }, - "pndDeleteOndResponse": { + "pndDeleteMneResponse": { "type": "object", "properties": { "timestamp": { @@ -3309,7 +3309,7 @@ } } }, - "pndFlattenedOrchestratedNetworkingDevice": { + "pndFlattenedManagedNetworkElement": { "type": "object", "properties": { "id": { @@ -3361,7 +3361,7 @@ } } }, - "pndGetFlattenedOndListResponse": { + "pndGetFlattenedMneListResponse": { "type": "object", "properties": { "timestamp": { @@ -3372,15 +3372,15 @@ "$ref": "#/definitions/pndPrincipalNetworkDomain", "description": "TODO: Check if this is really needed. Perhaps a reference to the PND's ID\nis also sufficient." }, - "ond": { + "mne": { "type": "array", "items": { - "$ref": "#/definitions/pndFlattenedOrchestratedNetworkingDevice" + "$ref": "#/definitions/pndFlattenedManagedNetworkElement" } } } }, - "pndGetOndListResponse": { + "pndGetMneListResponse": { "type": "object", "properties": { "timestamp": { @@ -3391,15 +3391,15 @@ "$ref": "#/definitions/pndPrincipalNetworkDomain", "description": "TODO: Check if this is really needed. Perhaps a reference to the PND's ID\nis also sufficient." }, - "ond": { + "mne": { "type": "array", "items": { - "$ref": "#/definitions/pndOrchestratedNetworkingDevice" + "$ref": "#/definitions/pndManagedNetworkElement" } } } }, - "pndGetOndResponse": { + "pndGetMneResponse": { "type": "object", "properties": { "timestamp": { @@ -3410,8 +3410,8 @@ "$ref": "#/definitions/pndPrincipalNetworkDomain", "description": "TODO: Check if this is really needed. Perhaps a reference to the PND's ID\nis also sufficient." }, - "ond": { - "$ref": "#/definitions/pndOrchestratedNetworkingDevice" + "mne": { + "$ref": "#/definitions/pndManagedNetworkElement" } } }, @@ -3426,7 +3426,7 @@ "$ref": "#/definitions/pndPrincipalNetworkDomain", "description": "TODO: Check if this is really needed. Perhaps a reference to the PND's ID\nis also sufficient." }, - "device": { + "mneNotification": { "type": "array", "items": { "$ref": "#/definitions/gnmiNotification" @@ -3469,7 +3469,7 @@ } } }, - "pndOrchestratedNetworkingDevice": { + "pndManagedNetworkElement": { "type": "object", "properties": { "id": { @@ -3478,7 +3478,7 @@ "name": { "type": "string" }, - "device": { + "mneNotification": { "type": "array", "items": { "$ref": "#/definitions/gnmiNotification" @@ -3542,7 +3542,7 @@ } } }, - "pndSetOnd": { + "pndSetMne": { "type": "object", "properties": { "address": { @@ -3551,7 +3551,7 @@ "sbi": { "$ref": "#/definitions/southboundSouthboundInterface" }, - "deviceName": { + "mneName": { "type": "string" }, "transportOption": { @@ -3559,7 +3559,7 @@ } } }, - "pndSetOndListResponse": { + "pndSetMneListResponse": { "type": "object", "properties": { "timestamp": { @@ -3641,7 +3641,7 @@ "status": { "$ref": "#/definitions/gosdnpndStatus" }, - "device": { + "mneNotification": { "type": "array", "items": { "$ref": "#/definitions/gnmiNotification" diff --git a/api/proto/gosdn/device/device.proto b/api/proto/gosdn/device/device.proto deleted file mode 100644 index a54738aa23c7be74b7ef87292e1f307f8bd3aaf2..0000000000000000000000000000000000000000 --- a/api/proto/gosdn/device/device.proto +++ /dev/null @@ -1,122 +0,0 @@ -syntax = "proto3"; - -package gosdn.device; - -import "google/api/annotations.proto"; -import "google/protobuf/descriptor.proto"; -import "protoc-gen-openapiv2/options/annotations.proto"; -import "github.com/openconfig/gnmi/proto/gnmi/gnmi.proto"; - -import "gosdn/pnd/pnd.proto"; -import "gosdn/transport/transport.proto"; -import "gosdn/southbound/southbound.proto"; - -option go_package = "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/device"; - -service DeviceService { - rpc Add(AddDeviceRequest) returns (AddDeviceResponse) { - option (google.api.http) = { - post: "/device/create" - body: "*" - }; - } - - rpc Get(GetDeviceRequest) returns (GetDeviceResponse) { - option (google.api.http) = { - get: "/device" - }; - } - - rpc GetAll(GetAllDeviceRequest) returns (GetAllDeviceResponse) { - option (google.api.http) = { - get: "/device/all" - }; - } - - rpc Update(UpdateDeviceRequest) returns (UpdateDeviceResponse) { - option (google.api.http) = { - post: "/device/update" - body: "*" - }; - } - - // TODO: not implemented yet! - // rpc Delete(DeleteDeviceRequest) returns (DeleteDeviceRequest) { - // option (google.api.http) = { - // delete: "/device" - // }; - // } -} - -enum Status { - STATUS_UNSPECIFIED = 0; - STATUS_OK = 1; - STATUS_ERROR = 2; -} - -message Device { - string id = 1; - string name = 2; - string model = 3; - string transportAddress = 4; -} - -message AddDeviceConfiguration { - string address = 1; - .gosdn.southbound.SouthboundInterface sbi = 2; - string device_name = 3; - .gosdn.transport.TransportOption transport_option = 4; -} - -message AddDeviceRequest { - int64 timestamp = 1; - AddDeviceConfiguration device = 2; - string pid = 3; -} - -message AddDeviceResponse { - int64 timestamp = 1; - Status status = 2; - string deviceId = 3; -} - -message GetDeviceRequest { - int64 timestamp = 1; - string deviceID = 2; -} - -message GetDeviceResponse { - int64 timestamp = 1; - Status status = 2; - Device device = 3; -} - -message GetAllDeviceRequest { - int64 timestamp = 1; -} - -message GetAllDeviceResponse { - int64 timestamp = 1; - Status status = 2; - repeated Device device = 3; -} - -message UpdateDeviceRequest { - int64 timestamp = 1; - Device device = 2; -} - -message UpdateDeviceResponse { - int64 timestamp = 1; - Status status = 2; -} - -message DeleteDeviceRequest { - int64 timestamp = 1; - string deviceID = 2; -} - -message DeleteDeviceResponse { - int64 timestamp = 1; - Status status = 2; -} diff --git a/api/proto/gosdn/networkelement/networkelement.proto b/api/proto/gosdn/networkelement/networkelement.proto new file mode 100644 index 0000000000000000000000000000000000000000..6885b8b587e2458d2fac53b0cc5660ad683d592f --- /dev/null +++ b/api/proto/gosdn/networkelement/networkelement.proto @@ -0,0 +1,122 @@ +syntax = "proto3"; + +package gosdn.networkelement; + +import "google/api/annotations.proto"; +import "google/protobuf/descriptor.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; +import "github.com/openconfig/gnmi/proto/gnmi/gnmi.proto"; + +import "gosdn/pnd/pnd.proto"; +import "gosdn/transport/transport.proto"; +import "gosdn/southbound/southbound.proto"; + +option go_package = "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/networkelement"; + +service NetworkElementService { + rpc Add(AddNetworkElementRequest) returns (AddNetworkElementResponse) { + option (google.api.http) = { + post: "/network-element/create" + body: "*" + }; + } + + rpc Get(GetNetworkElementRequest) returns (GetNetworkElementResponse) { + option (google.api.http) = { + get: "/network-element" + }; + } + + rpc GetAll(GetAllNetworkElementRequest) returns (GetAllNetworkElementResponse) { + option (google.api.http) = { + get: "/network-element/all" + }; + } + + rpc Update(UpdateNetworkElementRequest) returns (UpdateNetworkElementResponse) { + option (google.api.http) = { + post: "/network-element/update" + body: "*" + }; + } + + // TODO: not implemented yet! + // rpc Delete(DeleteNetworkElementRequest) returns (DeleteNetworkElementRequest) { + // option (google.api.http) = { + // delete: "/network-element" + // }; + // } +} + +enum Status { + STATUS_UNSPECIFIED = 0; + STATUS_OK = 1; + STATUS_ERROR = 2; +} + +message NetworkElement { + string id = 1; + string name = 2; + string model = 3; + string transport_address = 4; +} + +message AddNetworkElementConfiguration { + string address = 1; + .gosdn.southbound.SouthboundInterface sbi = 2; + string network_element_name = 3; + .gosdn.transport.TransportOption transport_option = 4; +} + +message AddNetworkElementRequest { + int64 timestamp = 1; + AddNetworkElementConfiguration network_element = 2; + string pid = 3; +} + +message AddNetworkElementResponse { + int64 timestamp = 1; + Status status = 2; + string network_element_id = 3; +} + +message GetNetworkElementRequest { + int64 timestamp = 1; + string network_element_id = 2; +} + +message GetNetworkElementResponse { + int64 timestamp = 1; + Status status = 2; + NetworkElement network_element = 3; +} + +message GetAllNetworkElementRequest { + int64 timestamp = 1; +} + +message GetAllNetworkElementResponse { + int64 timestamp = 1; + Status status = 2; + repeated NetworkElement network_element = 3; +} + +message UpdateNetworkElementRequest { + int64 timestamp = 1; + NetworkElement network_element = 2; +} + +message UpdateNetworkElementResponse { + int64 timestamp = 1; + Status status = 2; +} + +message DeleteNetworkElementRequest { + int64 timestamp = 1; + string network_element_id = 2; +} + +message DeleteNetworkElementResponse { + int64 timestamp = 1; + Status status = 2; +} diff --git a/api/proto/gosdn/pnd/pnd.proto b/api/proto/gosdn/pnd/pnd.proto index eda964a0ca610b825f9c82ddf4e7d704cbcbd1a5..8f8ae50b0d65f9b2f6dacaaf0f30537071c18433 100644 --- a/api/proto/gosdn/pnd/pnd.proto +++ b/api/proto/gosdn/pnd/pnd.proto @@ -29,33 +29,33 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { }; service PndService { - // Allows to request all Orchestrated Networking Devices (OND) which are + // Allows to request all Managed Network Elements (MNE) which are // managed by a specific Principal Network Domain. - // Full ONDs are provided, which also includes the OND config as gNMI + // Full MNEs are provided, which also includes the MNE config as gNMI // notification. - rpc GetOndList(GetOndListRequest) returns (GetOndListResponse); + rpc GetMneList(GetMneListRequest) returns (GetMneListResponse); - // Allows to request all Orchestrated Networking Devices (OND) which are + // Allows to request all Managed Network Elements (MNE) which are // managed by a specific Principal Network Domain. - // Flattened ONDs are provided, which does not include the OND config as gNMI + // Flattened MNEs are provided, which does not include the MNE config as gNMI // notification. - rpc GetFlattenedOndList(GetOndListRequest) returns (GetFlattenedOndListResponse) { + rpc GetFlattenedMneList(GetMneListRequest) returns (GetFlattenedMneListResponse) { option (google.api.http) = { - get: "/pnds/{pid}/onds" + get: "/pnds/{pid}/mnes" }; } - // Allows to request a specific Orchestrated Networking Device which is managed by a + // Allows to request a specific Managed Network Element which is managed by a // specific Principal Network Domain. - rpc GetOnd(GetOndRequest) returns (GetOndResponse) { + rpc GetMne(GetMneRequest) returns (GetMneResponse) { option (google.api.http) = { - get: "/pnds/{pid}/ond/{did}" + get: "/pnds/{pid}/mne/{mneid}" }; } - // Allows add multiple Orchestrated Networking Devices to be managed by a + // Allows to add multiple Managed Network Elements to be managed by a // specific Principal Network Domain. - rpc SetOndList(SetOndListRequest) returns (SetOndListResponse) { + rpc SetMneList(SetMneListRequest) returns (SetMneListResponse) { option (google.api.http) = { - post: "/pnds/{pid}/onds" + post: "/pnds/{pid}/mnes" body: "*" }; } @@ -100,42 +100,42 @@ service PndService { body: "*" }; } - // Allows to request a specific Path of a Orchestrated Networking Device, + // Allows to request a specific Path of a Managed Network Element, // managed by a specific Principal Network Domain. rpc GetPath(GetPathRequest) returns (GetPathResponse) { option (google.api.http) = { - get: "/pnds/{pid}/onds/{did}/paths/{path}" + get: "/pnds/{pid}/mnes/{mneid}/paths/{path}" }; } - // Allows to set a specific Path of a Orchestrated Networking Device, + // Allows to set a specific Path of a Managed Network Element, // managed by a specific Principal Network Domain. rpc SetPathList(SetPathListRequest) returns (SetPathListResponse) { option (google.api.http) = { - post: "/pnds/{pid}/onds/paths" + post: "/pnds/{pid}/mnes/paths" body: "*" }; } - // Allows to delete a specific Orchestrated Networking Device which is managed by a + // Allows to delete a specific Managed Network Element which is managed by a // specific Principal Network Domain. - rpc DeleteOnd(DeleteOndRequest) returns (DeleteOndResponse) { + rpc DeleteMne(DeleteMneRequest) returns (DeleteMneResponse) { option (google.api.http) = { - delete: "/pnds/{pid}/onds/{did}" + delete: "/pnds/{pid}/mnes/{mneid}" }; } - // Allows to subscribe to multiple paths of an Orchestrated Networking Device which is + // Allows to subscribe to multiple paths of a Managed Network Element which is // managed by a specific Principal Network Domain and streams data depending on the subscribe // method. rpc SubscribePath(SubscribePathRequest) returns (stream SubscribePathResponse) {}; } -message GetOndListRequest { +message GetMneListRequest { int64 timestamp = 1; // Timestamp in nanoseconds since Epoch. string pid = 2; } -message GetOndRequest { +message GetMneRequest { int64 timestamp = 1; // Timestamp in nanoseconds since Epoch. - string did = 2; + string mneid = 2; string pid = 3; } @@ -163,33 +163,33 @@ message GetChangeRequest { message GetPathRequest { int64 timestamp = 1; // Timestamp in nanoseconds since Epoch. - string did = 2; + string mneid = 2; string path = 3; string pid = 4; } -message GetOndResponse { +message GetMneResponse { 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; - OrchestratedNetworkingDevice ond = 3; + ManagedNetworkElement mne = 3; } -message GetOndListResponse { +message GetMneListResponse { 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; + repeated ManagedNetworkElement mne = 3; } -message GetFlattenedOndListResponse { +message GetFlattenedMneListResponse { 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 FlattenedOrchestratedNetworkingDevice ond = 3; + repeated FlattenedManagedNetworkElement mne = 3; } message GetSbiResponse { @@ -213,7 +213,7 @@ message GetPathResponse { // TODO: Check if this is really needed. Perhaps a reference to the PND's ID // is also sufficient. PrincipalNetworkDomain pnd = 2; - repeated gnmi.Notification device = 3; + repeated gnmi.Notification mne_notification = 3; } message GetChangeResponse { @@ -238,14 +238,14 @@ message PrincipalNetworkDomain { string description = 3; } -message OrchestratedNetworkingDevice { +message ManagedNetworkElement { string id = 1; string name = 2; - repeated gnmi.Notification device = 3; + repeated gnmi.Notification mne_notification = 3; .gosdn.southbound.SouthboundInterface sbi = 4; } -message FlattenedOrchestratedNetworkingDevice { +message FlattenedManagedNetworkElement { string id = 1; string name = 2; string sbi = 3; @@ -266,9 +266,9 @@ message Change { gnmi.Notification diff = 4; } -message SetOndListRequest { +message SetMneListRequest { int64 timestamp = 1; // Timestamp in nanoseconds since Epoch. - repeated SetOnd ond = 2; + repeated SetMne mne = 2; string pid = 3; } @@ -292,7 +292,7 @@ message SetPathListRequest { //TODO: rename message ChangeRequest { - string did = 1; + string mneid = 1; string path = 2; string value = 3; ApiOperation api_op = 4; @@ -305,10 +305,10 @@ enum ApiOperation { API_OPERATION_DELETE = 3; } -message SetOnd { +message SetMne { string address = 1; .gosdn.southbound.SouthboundInterface sbi = 2; - string device_name = 3; + string mne_name = 3; .gosdn.transport.TransportOption transport_option = 4; } @@ -341,7 +341,7 @@ message SetResponse{ Status status = 3; } -message SetOndListResponse{ +message SetMneListResponse{ int64 timestamp = 1; // Timestamp in nanoseconds since Epoch. Status status = 2; repeated SetResponse responses = 3; @@ -370,13 +370,13 @@ message SetPathListResponse{ repeated SetResponse responses = 3; } -message DeleteOndRequest { +message DeleteMneRequest { int64 timestamp = 1; // Timestamp in nanoseconds since Epoch. string pid = 2; - string did = 3; + string mneid = 3; } -message DeleteOndResponse { +message DeleteMneResponse { int64 timestamp = 1; // Timestamp in nanoseconds since Epoch. Status status = 2; } @@ -389,7 +389,7 @@ enum Status { message SubscribePathRequest { int64 timestamp = 1; // Timestamp in nanoseconds since Epoch. - string did = 2; + string mneid = 2; string pid = 3; SubscriptionList sublist = 4; } @@ -411,7 +411,7 @@ enum SubscriptionMode { message Subscription { string path = 1; StreamMode stream_mode = 2; - uint64 sample_interval = 3; // ns between samples in SAMPLE mode. + uint64 sample_interval = 3; // time in ns between samples in SAMPLE mode. } enum StreamMode { @@ -425,5 +425,5 @@ enum StreamMode { message SubscribePathResponse { int64 timestamp = 1; // Timestamp in nanoseconds since Epoch. Status status = 2; - repeated gnmi.Notification device = 3; + repeated gnmi.Notification mne_notification = 3; } diff --git a/application-framework/event/topics.go b/application-framework/event/topics.go index b8b46c041737016023390f7cdd370ef955c89913..1b63cefea93884c34c90ffda48809050b7d5d391 100644 --- a/application-framework/event/topics.go +++ b/application-framework/event/topics.go @@ -8,8 +8,8 @@ const ( User Topic = iota // Role is the role topic. Role - // Device is the device topic. - Device + // ManagedNetworkElement is the network element topic. + ManagedNetworkElement // Link is the link topic. Link // RoutingTable is the routingTable topic. @@ -22,8 +22,8 @@ func (t Topic) String() string { return "user" case Role: return "role" - case Device: - return "device" + case ManagedNetworkElement: + return "managedNetworkElement" case Link: return "link" case RoutingTable: diff --git a/application-framework/models/model-handling.go b/application-framework/models/model-handling.go index aee1b5f8c65cc2a1f7173e3dedd467ec0964f859..016406cedcb8c465fd31ff12cc80b3aade1ff9d6 100644 --- a/application-framework/models/model-handling.go +++ b/application-framework/models/model-handling.go @@ -20,7 +20,7 @@ func getYgotEmitJSONConfig() *ygot.EmitJSONConfig { }} } -// GetModelAsString returns the YANG model of a device as string. +// GetModelAsString returns the YANG model of a network element as string. func GetModelAsString(model ygot.GoStruct) (string, error) { modelAsString, err := ygot.EmitJSON(model, getYgotEmitJSONConfig()) if err != nil { diff --git a/applications/arista-routing-engine/app.go b/applications/arista-routing-engine/app.go index 839081786f74c3b34c836a1fd01fee54cd0ad3ea..78bce8b9de55b64dbef33c9769dd83172e9f280c 100644 --- a/applications/arista-routing-engine/app.go +++ b/applications/arista-routing-engine/app.go @@ -8,7 +8,7 @@ import ( "syscall" "time" - "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/device" + "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/networkelement" "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/topology" "code.fbi.h-da.de/danet/gosdn/application-framework/event" @@ -69,7 +69,7 @@ func (a *Application) LinksCallback(event *event.Event) { fmt.Printf("Links Event Callback: %+v \n", event) ctx := context.Background() - deviceServer := device.NewDeviceServiceClient(a.grpcClientConn) + networkElementServer := networkelement.NewNetworkElementServiceClient(a.grpcClientConn) topologyServer := topology.NewTopologyServiceClient(a.grpcClientConn) getTopologyRequest := &topology.GetTopologyRequest{ @@ -86,8 +86,8 @@ func (a *Application) LinksCallback(event *event.Event) { for _, link := range links { fmt.Printf("[APP] Link: %+v", link) - adjustNodePortsToMatchConfiguration(deviceServer, link.SourceNode, link.SourcePort) - adjustNodePortsToMatchConfiguration(deviceServer, link.TargetNode, link.TargetPort) + adjustNodePortsToMatchConfiguration(networkElementServer, link.SourceNode, link.SourcePort) + adjustNodePortsToMatchConfiguration(networkElementServer, link.TargetNode, link.TargetPort) } } @@ -96,7 +96,7 @@ func (a *Application) RoutesCallback(event *event.Event) { fmt.Printf("Routes Event Callback: %+v \n", event) ctx := context.Background() - deviceServer := device.NewDeviceServiceClient(a.grpcClientConn) + networkElementServer := networkelement.NewNetworkElementServiceClient(a.grpcClientConn) routesServer := topology.NewRoutingTableServiceClient(a.grpcClientConn) getRoutingTablesRequest := &topology.GetRoutesRequest{ @@ -113,7 +113,7 @@ func (a *Application) RoutesCallback(event *event.Event) { nodeID := node.NodeID for _, nodeRoute := range node.Routes { - adjustNodeRoutesToMatchConfiguration(deviceServer, nodeID, nodeRoute) + adjustNodeRoutesToMatchConfiguration(networkElementServer, nodeID, nodeRoute) } } } diff --git a/applications/arista-routing-engine/main.go b/applications/arista-routing-engine/main.go index caa3030cbdf66423ac93e7280195165077222bb0..7963c24ebbf47f475742c360b90036d66f08ea57 100644 --- a/applications/arista-routing-engine/main.go +++ b/applications/arista-routing-engine/main.go @@ -17,7 +17,7 @@ func main() { eventServiceLinks, err := event.NewEventService( queueCredentials, - []event.Topic{event.Link, event.RoutingTable}, + []event.Topic{event.Link, event.Link}, ) if err != nil { logrus.Errorf("failed to create event service. %v", err) diff --git a/applications/arista-routing-engine/network-element.go b/applications/arista-routing-engine/network-element.go index cef128d57a41a36ccd37dfa4b33af34460e7539f..c11ba1287d34a4084c4b5d1a3dc041905e0992fb 100644 --- a/applications/arista-routing-engine/network-element.go +++ b/applications/arista-routing-engine/network-element.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/device" + mnepb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/networkelement" "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/topology" "code.fbi.h-da.de/danet/gosdn/application-framework/models" "code.fbi.h-da.de/danet/gosdn/models/generated/arista" @@ -14,21 +14,21 @@ import ( "github.com/openconfig/ygot/ygot" ) -// Device is a device. -type Device struct { - // UUID represents the Devices UUID +// NetworkElement is a network element. +type NetworkElement struct { + // UUID represents the network element's UUID UUID uuid.UUID - // Name is the device's human readable Name + // Name is the network element's human readable Name Name string - // Device embeds a ygot.GoStruct containing the device details + // Model embeds a ygot.GoStruct containing the network element details Model arista.Device } -// NewDevice creates a new device. -func NewDevice(id uuid.UUID, name string, deviceModel string) *Device { - d := &Device{ +// NewNetworkElement creates a new network element. +func NewNetworkElement(id uuid.UUID, name string, networkelementModel string) *NetworkElement { + mne := &NetworkElement{ UUID: id, Model: arista.Device{}, Name: name, @@ -40,117 +40,117 @@ func NewDevice(id uuid.UUID, name string, deviceModel string) *Device { panic(err) } - // Use unmarshall from the devices SBI to unmarshall ygot json in go struct. - err = models.Unmarshal([]byte(deviceModel), path, &d.Model) + // Use unmarshall from the network element's SBI to unmarshall ygot json in go struct. + err = models.Unmarshal([]byte(networkelementModel), path, &mne.Model) if err != nil { panic(err) } - return d + return mne } -func adjustNodePortsToMatchConfiguration(deviceServer device.DeviceServiceClient, node *topology.Node, port *topology.Port) { +func adjustNodePortsToMatchConfiguration(networkElementServer mnepb.NetworkElementServiceClient, node *topology.Node, port *topology.Port) { nodeUUID := uuid.MustParse(node.Id) adjustInterfacesOfNetworkElement( - deviceServer, + networkElementServer, nodeUUID, port, ) } -func adjustInterfacesOfNetworkElement(deviceServer device.DeviceServiceClient, elementUUID uuid.UUID, portConfiguration *topology.Port) { +func adjustInterfacesOfNetworkElement(networkElementServer mnepb.NetworkElementServiceClient, elementUUID uuid.UUID, portConfiguration *topology.Port) { ctx := context.Background() - request := &device.GetDeviceRequest{ - Timestamp: time.Now().UnixNano(), - DeviceID: elementUUID.String(), + request := &mnepb.GetNetworkElementRequest{ + Timestamp: time.Now().UnixNano(), + NetworkElementId: elementUUID.String(), } - response, err := deviceServer.Get(ctx, request) + response, err := networkElementServer.Get(ctx, request) if err != nil { fmt.Printf("Error %+v\n ", err) return } - fmt.Printf("[APP] ID: %v, Device: %+v \n", response.Device.Id, response.Device) + fmt.Printf("[APP] ID: %v, NetworkElement: %+v \n", response.NetworkElement.Id, response.NetworkElement) - d := NewDevice(uuid.MustParse(response.Device.Id), response.Device.Name, response.Device.Model) + mne := NewNetworkElement(uuid.MustParse(response.NetworkElement.Id), response.NetworkElement.Name, response.NetworkElement.Model) - fmt.Printf("[APP] Device.Hostname %s \n", *d.Model.System.Config.Hostname) + fmt.Printf("[APP] NetworkElement.Hostname %s \n", *mne.Model.System.Config.Hostname) - err = enableRouting(&d.Model) + err = enableRouting(&mne.Model) if err != nil { panic(err) } setIPOnInterface( - &d.Model, + &mne.Model, portConfiguration.Name, portConfiguration.Configuration.Ip, int(portConfiguration.Configuration.PrefixLength), ) - modelAsString, err := models.GetModelAsString(&d.Model) + modelAsString, err := models.GetModelAsString(&mne.Model) if err != nil { panic(err) } - requestUpdate := &device.UpdateDeviceRequest{ + requestUpdate := &mnepb.UpdateNetworkElementRequest{ Timestamp: time.Now().UnixNano(), - Device: &device.Device{ - Id: d.UUID.String(), - Name: d.Name, + NetworkElement: &mnepb.NetworkElement{ + Id: mne.UUID.String(), + Name: mne.Name, Model: modelAsString, }, } - updateResponse, err := deviceServer.Update(ctx, requestUpdate) + updateResponse, err := networkElementServer.Update(ctx, requestUpdate) if err != nil { panic(err) } - fmt.Printf("[APP] Update Device %s response: %+v", d.UUID.String(), updateResponse) + fmt.Printf("[APP] Update NetworkElement %s response: %+v", mne.UUID.String(), updateResponse) } -func adjustNodeRoutesToMatchConfiguration(deviceServer device.DeviceServiceClient, nodeID string, route *topology.Route) { +func adjustNodeRoutesToMatchConfiguration(networkElementServer mnepb.NetworkElementServiceClient, nodeID string, route *topology.Route) { ctx := context.Background() - request := &device.GetDeviceRequest{ - Timestamp: time.Now().UnixNano(), - DeviceID: nodeID, + request := &mnepb.GetNetworkElementRequest{ + Timestamp: time.Now().UnixNano(), + NetworkElementId: nodeID, } - response, err := deviceServer.Get(ctx, request) + response, err := networkElementServer.Get(ctx, request) if err != nil { fmt.Printf("Error %+v\n ", err) return } - fmt.Printf("[APP] ID: %v, Device: %+v \n", response.Device.Id, response.Device) + fmt.Printf("[APP] ID: %v, NetworkElement: %+v \n", response.NetworkElement.Id, response.NetworkElement) - d := NewDevice(uuid.MustParse(response.Device.Id), response.Device.Name, response.Device.Model) + mne := NewNetworkElement(uuid.MustParse(response.NetworkElement.Id), response.NetworkElement.Name, response.NetworkElement.Model) - fmt.Printf("[APP] Device.Hostname %s \n", *d.Model.System.Config.Hostname) + fmt.Printf("[APP] NetworkElement.Hostname %s \n", *mne.Model.System.Config.Hostname) - setRoutingTable(&d.Model, route.TargetIPRange, route.NextHopIP) + setRoutingTable(&mne.Model, route.TargetIPRange, route.NextHopIP) - modelAsString, err := models.GetModelAsString(&d.Model) + modelAsString, err := models.GetModelAsString(&mne.Model) if err != nil { panic(err) } - requestUpdate := &device.UpdateDeviceRequest{ + requestUpdate := &mnepb.UpdateNetworkElementRequest{ Timestamp: time.Now().UnixNano(), - Device: &device.Device{ - Id: d.UUID.String(), - Name: d.Name, + NetworkElement: &mnepb.NetworkElement{ + Id: mne.UUID.String(), + Name: mne.Name, Model: modelAsString, }, } - updateResponse, err := deviceServer.Update(ctx, requestUpdate) + updateResponse, err := networkElementServer.Update(ctx, requestUpdate) if err != nil { panic(err) } - fmt.Printf("[APP] Update Device %s response: %+v", d.UUID.String(), updateResponse) + fmt.Printf("[APP] Update NetworkElement %s response: %+v", mne.UUID.String(), updateResponse) } diff --git a/applications/hostname-checker/app.go b/applications/hostname-checker/app.go index 01d6867c79fcb2920c1f4c683b5a9a4e832b2960..b2107e08536e5ac9d50730c15b88e4fcc3825f90 100644 --- a/applications/hostname-checker/app.go +++ b/applications/hostname-checker/app.go @@ -8,11 +8,11 @@ import ( "syscall" "time" - "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/device" - "github.com/google/uuid" "github.com/openconfig/ygot/ygot" + "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/networkelement" + "code.fbi.h-da.de/danet/gosdn/application-framework/event" "code.fbi.h-da.de/danet/gosdn/application-framework/models" "google.golang.org/grpc" @@ -61,22 +61,22 @@ func (a *Application) Run() { func (a *Application) callback(event *event.Event) { ctx := context.Background() - deviceServer := device.NewDeviceServiceClient(a.grpcClientConn) + networkElementServer := networkelement.NewNetworkElementServiceClient(a.grpcClientConn) - request := &device.GetDeviceRequest{ - Timestamp: time.Now().UnixNano(), - DeviceID: event.EntityID.String(), + request := &networkelement.GetNetworkElementRequest{ + Timestamp: time.Now().UnixNano(), + NetworkElementId: event.EntityID.String(), } - response, err := deviceServer.Get(ctx, request) + response, err := networkElementServer.Get(ctx, request) if err != nil { fmt.Printf("Error %+v\n ", err) return } - fmt.Printf("\n[APP] Device-ID: %v, Device-Name: %+v \n", response.Device.Id, response.Device.Name) + fmt.Printf("\n[APP] Device-ID: %v, NetworkElement-Name: %+v \n", response.NetworkElement.Id, response.NetworkElement.Name) - d := NewDevice(uuid.MustParse(response.Device.Id), response.Device.Name) + d := NewDevice(uuid.MustParse(response.NetworkElement.Id), response.NetworkElement.Name) // Create 'root' path to be able to load the whole model from the store. path, err := ygot.StringToPath("/", ygot.StructuredPath) @@ -85,7 +85,7 @@ func (a *Application) callback(event *event.Event) { } // Use unmarshall from the devices SBI to unmarshall ygot json in go struct. - err = models.Unmarshal([]byte(response.Device.Model), path, &d.Model) + err = models.Unmarshal([]byte(response.NetworkElement.Model), path, &d.Model) if err != nil { panic(err) } @@ -103,16 +103,16 @@ func (a *Application) callback(event *event.Event) { panic(err) } - requestUpdate := &device.UpdateDeviceRequest{ + requestUpdate := &networkelement.UpdateNetworkElementRequest{ Timestamp: time.Now().UnixNano(), - Device: &device.Device{ + NetworkElement: &networkelement.NetworkElement{ Id: d.UUID.String(), Name: d.Name, Model: modelAsString, }, } - updateResponse, err := deviceServer.Update(ctx, requestUpdate) + updateResponse, err := networkElementServer.Update(ctx, requestUpdate) if err != nil { panic(err) } diff --git a/applications/hostname-checker/main.go b/applications/hostname-checker/main.go index d68ebc9807316c01db9d3e0fc486613d49554c40..53c3e462e2012a3361148b41525cde678fa97292 100644 --- a/applications/hostname-checker/main.go +++ b/applications/hostname-checker/main.go @@ -17,7 +17,7 @@ func main() { eventService, err := event.NewEventService( queueCredentials, - []event.Topic{event.Device}, + []event.Topic{event.ManagedNetworkElement}, ) if err != nil { logrus.Errorf("failed to create event service. %v", err) diff --git a/applications/venv-manager/venv-manager/venv-manager.go b/applications/venv-manager/venv-manager/venv-manager.go index fd550db42c79c4a6108d88fb75edd31dff1987e5..64a283c9669464a8977f8130314d3e998daeefb7 100644 --- a/applications/venv-manager/venv-manager/venv-manager.go +++ b/applications/venv-manager/venv-manager/venv-manager.go @@ -9,7 +9,7 @@ import ( "time" corePb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/core" - devicePb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/device" + networkelementPb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/networkelement" pndPb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/pnd" topologyPb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/topology" "code.fbi.h-da.de/danet/gosdn/applications/venv-manager/containerlab" @@ -190,11 +190,11 @@ func (v *VenvManager) parseTopologyDataIntoStructs(topologyData *topologyPb.GetT return &topology, nil } -func (v *VenvManager) loadDeviceModelPathsIntoGosdn(ctx context.Context, conn *grpc.ClientConn, nodes *[]node.Node) error { +func (v *VenvManager) loadNetworkElementModelPathsIntoGosdn(ctx context.Context, conn *grpc.ClientConn, nodes *[]node.Node) error { pndService := pndPb.NewPndServiceClient(conn) for _, node := range *nodes { - _, err := pndService.GetPath(ctx, &pndPb.GetPathRequest{Did: node.ID, Pid: v.pnd, Path: "lldp"}) + _, err := pndService.GetPath(ctx, &pndPb.GetPathRequest{Mneid: node.ID, Pid: v.pnd, Path: "lldp"}) if err != nil { return err } @@ -219,27 +219,27 @@ func (v *VenvManager) getAndAddMoreData(topologyData *topology.GoSdnTopology) (* } // just to load model data into goSDN to have newest data available for get request - err = v.loadDeviceModelPathsIntoGosdn(ctx, conn, &topologyData.Nodes) + err = v.loadNetworkElementModelPathsIntoGosdn(ctx, conn, &topologyData.Nodes) if err != nil { return nil, err } - deviceService := devicePb.NewDeviceServiceClient(conn) + networkElementService := networkelementPb.NewNetworkElementServiceClient(conn) for iterator, node := range topologyData.Nodes { - getDeviceResponse, _ := deviceService.Get(ctx, &devicePb.GetDeviceRequest{DeviceID: node.ID}) + getNetworkElementResponse, _ := networkElementService.Get(ctx, &networkelementPb.GetNetworkElementRequest{NetworkElementId: node.ID}) if err != nil { return nil, err } var marshalledYangData openconfig.Device - err = yangparser.Unmarshal([]byte(getDeviceResponse.Device.Model), path, &marshalledYangData) + err = yangparser.Unmarshal([]byte(getNetworkElementResponse.NetworkElement.Model), path, &marshalledYangData) if err != nil { return nil, err } - mgmntAddress := strings.Split(getDeviceResponse.Device.TransportAddress, ":") + mgmntAddress := strings.Split(getNetworkElementResponse.NetworkElement.TransportAddress, ":") topologyData.Nodes[iterator].MgmtIpv4 = mgmntAddress[0] topologyData.Nodes[iterator].YangData = marshalledYangData topologyData.Nodes[iterator].FillAllFields(v.containerRegistryURL) diff --git a/cli/README.md b/cli/README.md index 5c9ca2052f14bc899918588d478d4f5c34252e24..82a7a0e737313cf91aa14d9ef7332b5a2cbc3d06 100644 --- a/cli/README.md +++ b/cli/README.md @@ -1,6 +1,6 @@ # goSDN Command Line Interface -The goSDN CLI allows for management of the goSDN controller, and through it direct management of network devices. +The goSDN CLI allows for management of the goSDN controller, and through it direct management of network elements. *** ## Command tree overview: @@ -12,7 +12,7 @@ The goSDN CLI allows for management of the goSDN controller, and through it dire + `commit` + `confirm` + `list (alias ls)` - + `device (alias dev)` + + `networkElement (alias mne)` + `create` + `delete` + `get` @@ -46,19 +46,19 @@ Command help is available via the --help flag for each command, or via the `gosd To initialize the CLI for a locally running goSDN controller: `gosdnc login --controller 127.0.0.1:55055 --u name --p password` -#### Device +#### Network element -To create a device on the controller: -`gosdnc dev create -a 192.168.2.51:6030 --name='dev1'` +To create a network element on the controller: +`gosdnc mne create -a 192.168.2.51:6030 --name='dev1'` -To get the device UUIDs: -`gosdnc device list` or `gosdnc dev ls` +To get the network element UUIDs: +`gosdnc mne list` or `gosdnc mne ls` -To get a path directly from a device: -`gosdnc dev get *appropriate UUID here* /system/config/hostname` +To get a path directly from a network element: +`gosdnc mne get *appropriate UUID here* /system/config/hostname` -To update a path directly on a device: -`gosdnc dev set *appropriate UUID here* /system/config/hostname test-hostname` +To update a path directly on a network element: +`gosdnc mne set *appropriate UUID here* /system/config/hostname test-hostname` #### Changes diff --git a/cli/adapter/PndAdapter.go b/cli/adapter/PndAdapter.go index 89947898b994059b0027254a918de78b737b4511..305869cda7aaef001935ef5ac8383b79d17aa621 100644 --- a/cli/adapter/PndAdapter.go +++ b/cli/adapter/PndAdapter.go @@ -45,10 +45,10 @@ func (p *PndAdapter) RemoveSbi(uuid.UUID) error { return &customerrs.NotYetImplementedError{} } -// AddDevice adds a new device to the controller. The device name is optional. +// AddNetworkElement adds a new device to the controller. The device name is optional. // If no name is provided a name will be generated upon device creation. -func (p *PndAdapter) AddDevice(ctx context.Context, name string, opts *tpb.TransportOption, sid uuid.UUID) (*ppb.SetOndListResponse, error) { - resp, err := api.AddDevice(ctx, p.endpoint, name, opts, sid, p.ID()) +func (p *PndAdapter) AddNetworkElement(ctx context.Context, name string, opts *tpb.TransportOption, sid uuid.UUID) (*ppb.SetMneListResponse, error) { + resp, err := api.AddNetworkElement(ctx, p.endpoint, name, opts, sid, p.ID()) if err != nil { return nil, err } @@ -64,30 +64,30 @@ func (p *PndAdapter) GetSbiSchemaTree(ctx context.Context, sid uuid.UUID) (map[s return resp, nil } -// GetDevice requests one or multiple devices belonging to a given +// GetNetworkElement requests one or multiple devices belonging to a given // PrincipalNetworkDomain from the controller. -func (p *PndAdapter) GetDevice(ctx context.Context, identifier string) (*ppb.GetOndResponse, error) { - resp, err := api.GetDevice(ctx, p.endpoint, p.id.String(), identifier) +func (p *PndAdapter) GetNetworkElement(ctx context.Context, identifier string) (*ppb.GetMneResponse, error) { + resp, err := api.GetNetworkElement(ctx, p.endpoint, p.id.String(), identifier) if err != nil { return nil, err } return resp, nil } -// GetFlattenedDevices requests all devices belonging to the PrincipalNetworkDomain +// GetFlattenedNetworkElements requests all devices belonging to the PrincipalNetworkDomain // attached to this adapter. The requested devices also contain their config // information as gNMI notifications. -func (p *PndAdapter) GetFlattenedDevices(ctx context.Context) (*ppb.GetFlattenedOndListResponse, error) { - resp, err := api.GetFlattenedDevices(ctx, p.endpoint, p.id.String()) +func (p *PndAdapter) GetFlattenedNetworkElements(ctx context.Context) (*ppb.GetFlattenedMneListResponse, error) { + resp, err := api.GetFlattenedNetworkElements(ctx, p.endpoint, p.id.String()) if err != nil { return nil, err } return resp, nil } -// RemoveDevice removes a device from the controller. -func (p *PndAdapter) RemoveDevice(ctx context.Context, did uuid.UUID) (*ppb.DeleteOndResponse, error) { - resp, err := api.DeleteDevice(ctx, p.endpoint, p.id.String(), did.String()) +// RemoveNetworkElement removes a device from the controller. +func (p *PndAdapter) RemoveNetworkElement(ctx context.Context, did uuid.UUID) (*ppb.DeleteMneResponse, error) { + resp, err := api.DeleteNetworkElement(ctx, p.endpoint, p.id.String(), did.String()) if err != nil { return nil, err } @@ -103,10 +103,10 @@ func (p *PndAdapter) RemovePnd(ctx context.Context, pid uuid.UUID) (*core.Delete return resp, nil } -// ChangeOND sends an API call to the controller requesting the creation of +// ChangeMNE sends an API call to the controller requesting the creation of // a change from the provided Operation, path and value. The Change is marked // as Pending and times out after the specified timeout period. -func (p *PndAdapter) ChangeOND(ctx context.Context, duid uuid.UUID, operation ppb.ApiOperation, path string, value ...string) (*ppb.SetPathListResponse, error) { +func (p *PndAdapter) ChangeMNE(ctx context.Context, duid uuid.UUID, operation ppb.ApiOperation, path string, value ...string) (*ppb.SetPathListResponse, error) { var v string if len(value) != 0 { v = value[0] @@ -128,9 +128,9 @@ func (p *PndAdapter) Request(ctx context.Context, did uuid.UUID, path string) (* return resp, nil } -// SubscribeONDPath sends an API call to the controller requesting to subscribe +// SubscribeMNEPath sends an API call to the controller requesting to subscribe // to a specific path of a specifc device. -func (p *PndAdapter) SubscribeONDPath(ctx context.Context, did uuid.UUID, slist *ppb.SubscriptionList) (ppb.PndService_SubscribePathClient, error) { +func (p *PndAdapter) SubscribeMNEPath(ctx context.Context, did uuid.UUID, slist *ppb.SubscriptionList) (ppb.PndService_SubscribePathClient, error) { resp, err := api.SubscribePath(ctx, p.endpoint, p.id.String(), did.String(), slist) if err != nil { return nil, err @@ -141,18 +141,18 @@ func (p *PndAdapter) SubscribeONDPath(ctx context.Context, did uuid.UUID, slist // RequestAll sends an API call to the controller requesting the specified path // for all registered devices. Not yet implemented. func (p *PndAdapter) RequestAll(ctx context.Context, path string) ([]proto.Message, error) { - resp, err := api.GetFlattenedDevices(ctx, p.Endpoint(), p.ID().String()) + resp, err := api.GetFlattenedNetworkElements(ctx, p.Endpoint(), p.ID().String()) if err != nil { return []proto.Message{}, err } - reqResult := make([]proto.Message, len(resp.Ond)) + reqResult := make([]proto.Message, len(resp.Mne)) g := new(errgroup.Group) - for i, ond := range resp.Ond { - i, ond := i, ond + for i, mne := range resp.Mne { + i, mne := i, mne // TODO: probably the controller should do this; this would result in a // single request from CLI side. g.Go(func() error { - resp, err := api.GetPath(ctx, p.endpoint, p.id.String(), ond.GetId(), path) + resp, err := api.GetPath(ctx, p.endpoint, p.id.String(), mne.GetId(), path) if err != nil { return err } @@ -168,9 +168,9 @@ func (p *PndAdapter) RequestAll(ctx context.Context, path string) ([]proto.Messa return reqResult, nil } -// ContainsDevice sends an API call to the controller checking if a device +// ContainsNetworkElement sends an API call to the controller checking if a device // with the given UUID is present. Not implemented, always returns false. -func (p *PndAdapter) ContainsDevice(uuid.UUID) bool { +func (p *PndAdapter) ContainsNetworkElement(uuid.UUID) bool { return false } diff --git a/cli/adapter/PndAdapter_test.go b/cli/adapter/PndAdapter_test.go index 2c49e7804c452cab296fbd9ff5405042213deff0..c4e3ebefed4649f384a09cddd2e761c2f4712512 100644 --- a/cli/adapter/PndAdapter_test.go +++ b/cli/adapter/PndAdapter_test.go @@ -5,10 +5,10 @@ import ( "reflect" "testing" + mnepb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/networkelement" ppb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/pnd" tpb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/transport" "code.fbi.h-da.de/danet/gosdn/controller/interfaces/change" - "code.fbi.h-da.de/danet/gosdn/controller/interfaces/device" "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkdomain" "code.fbi.h-da.de/danet/gosdn/controller/interfaces/southbound" "code.fbi.h-da.de/danet/gosdn/controller/interfaces/store" @@ -100,7 +100,7 @@ func TestPndAdapter_RemoveSbi(t *testing.T) { } } -func TestPndAdapter_AddDevice(t *testing.T) { +func TestPndAdapter_AddNetworkElement(t *testing.T) { type fields struct { id uuid.UUID endpoint string @@ -124,14 +124,14 @@ func TestPndAdapter_AddDevice(t *testing.T) { id: tt.fields.id, endpoint: tt.fields.endpoint, } - if _, err := p.AddDevice(context.TODO(), tt.args.name, tt.args.opts, tt.args.sid); (err != nil) != tt.wantErr { - t.Errorf("PndAdapter.AddDevice() error = %v, wantErr %v", err, tt.wantErr) + if _, err := p.AddNetworkElement(context.TODO(), tt.args.name, tt.args.opts, tt.args.sid); (err != nil) != tt.wantErr { + t.Errorf("PndAdapter.AddNetworkElement() error = %v, wantErr %v", err, tt.wantErr) } }) } } -func TestPndAdapter_GetDevice(t *testing.T) { +func TestPndAdapter_GetNetworkElement(t *testing.T) { type fields struct { id uuid.UUID endpoint string @@ -143,7 +143,7 @@ func TestPndAdapter_GetDevice(t *testing.T) { name string fields fields args args - want device.Device + want *mnepb.NetworkElement wantErr bool }{ // TODO: Add test cases. @@ -154,25 +154,25 @@ func TestPndAdapter_GetDevice(t *testing.T) { id: tt.fields.id, endpoint: tt.fields.endpoint, } - got, err := p.GetDevice(context.TODO(), tt.args.identifier) + got, err := p.GetNetworkElement(context.TODO(), tt.args.identifier) if (err != nil) != tt.wantErr { - t.Errorf("PndAdapter.GetDevice() error = %v, wantErr %v", err, tt.wantErr) + t.Errorf("PndAdapter.GetNetworkElement() error = %v, wantErr %v", err, tt.wantErr) return } if !reflect.DeepEqual(got, tt.want) { - t.Errorf("PndAdapter.GetDevice() = %v, want %v", got, tt.want) + t.Errorf("PndAdapter.GetNetworkElement() = %v, want %v", got, tt.want) } }) } } -func TestPndAdapter_RemoveDevice(t *testing.T) { +func TestPndAdapter_RemoveNetworkElement(t *testing.T) { type fields struct { id uuid.UUID endpoint string } type args struct { - did uuid.UUID + mneid uuid.UUID } tests := []struct { name string @@ -188,14 +188,14 @@ func TestPndAdapter_RemoveDevice(t *testing.T) { id: tt.fields.id, endpoint: tt.fields.endpoint, } - if _, err := p.RemoveDevice(context.TODO(), tt.args.did); (err != nil) != tt.wantErr { - t.Errorf("PndAdapter.RemoveDevice() error = %v, wantErr %v", err, tt.wantErr) + if _, err := p.RemoveNetworkElement(context.TODO(), tt.args.mneid); (err != nil) != tt.wantErr { + t.Errorf("PndAdapter.RemoveNetworkElement() error = %v, wantErr %v", err, tt.wantErr) } }) } } -func TestPndAdapter_ChangeOND(t *testing.T) { +func TestPndAdapter_ChangeMNE(t *testing.T) { type fields struct { id uuid.UUID endpoint string @@ -220,9 +220,9 @@ func TestPndAdapter_ChangeOND(t *testing.T) { id: tt.fields.id, endpoint: tt.fields.endpoint, } - _, err := p.ChangeOND(context.TODO(), tt.args.uuid, tt.args.operation, tt.args.path, tt.args.value...) + _, err := p.ChangeMNE(context.TODO(), tt.args.uuid, tt.args.operation, tt.args.path, tt.args.value...) if (err != nil) != tt.wantErr { - t.Errorf("PndAdapter.ChangeOND() error = %v, wantErr %v", err, tt.wantErr) + t.Errorf("PndAdapter.ChangeMNE() error = %v, wantErr %v", err, tt.wantErr) } }) } @@ -234,8 +234,8 @@ func TestPndAdapter_Request(t *testing.T) { endpoint string } type args struct { - did uuid.UUID - path string + mneid uuid.UUID + path string } tests := []struct { name string @@ -251,7 +251,7 @@ func TestPndAdapter_Request(t *testing.T) { id: tt.fields.id, endpoint: tt.fields.endpoint, } - _, err := p.Request(context.TODO(), tt.args.did, tt.args.path) + _, err := p.Request(context.TODO(), tt.args.mneid, tt.args.path) if (err != nil) != tt.wantErr { t.Errorf("PndAdapter.Request() error = %v, wantErr %v", err, tt.wantErr) } @@ -288,7 +288,7 @@ func TestPndAdapter_RequestAll(t *testing.T) { } } -func TestPndAdapter_ContainsDevice(t *testing.T) { +func TestPndAdapter_ContainsNetworkElement(t *testing.T) { type fields struct { id uuid.UUID endpoint string @@ -310,8 +310,8 @@ func TestPndAdapter_ContainsDevice(t *testing.T) { id: tt.fields.id, endpoint: tt.fields.endpoint, } - if got := p.ContainsDevice(tt.args.in0); got != tt.want { - t.Errorf("PndAdapter.ContainsDevice() = %v, want %v", got, tt.want) + if got := p.ContainsNetworkElement(tt.args.in0); got != tt.want { + t.Errorf("PndAdapter.ContainsNetworkElement() = %v, want %v", got, tt.want) } }) } diff --git a/cli/cmd/list.go b/cli/cmd/list.go index 52f916d5dd6fbc632f90a9a90f31f2ab111d6f69..df58a41b77a4908782d3a372b768d79966e635dc 100644 --- a/cli/cmd/list.go +++ b/cli/cmd/list.go @@ -44,8 +44,8 @@ import ( var listCmd = &cobra.Command{ Use: "list", Aliases: []string{"ls"}, - Short: "List all PNDs, SBIs and ONDs on the controller", - Long: `List all PNDs, SBIs and ONDs on the controller.`, + Short: "List all PNDs, SBIs and MNEs on the controller", + Long: `List all PNDs, SBIs and MNEs on the controller.`, RunE: func(cmd *cobra.Command, args []string) error { addr := viper.GetString("controllerApiEndpoint") @@ -54,14 +54,14 @@ var listCmd = &cobra.Command{ return err } for i, pnd := range resp { - ondResp, err := api.GetFlattenedDevices(createContextWithAuthorization(), addr, pnd.GetId()) + mneResp, err := api.GetFlattenedNetworkElements(createContextWithAuthorization(), addr, pnd.GetId()) if err != nil { return err } log.Infof("PND %v: name: %v, uuid: %v", i+1, pnd.Name, pnd.Id) - for k, ond := range ondResp.GetOnd() { - log.Infof(" OND %v: name: %v, uuid: %v", k+1, ond.Name, ond.Id) - log.Infof(" SBI %v: uuid: %v", k+1, ond.GetSbi()) + for k, mne := range mneResp.GetMne() { + log.Infof(" MNE %v: name: %v, uuid: %v", k+1, mne.Name, mne.Id) + log.Infof(" SBI %v: uuid: %v", k+1, mne.GetSbi()) } } return nil diff --git a/cli/cmd/device.go b/cli/cmd/networkElement.go similarity index 75% rename from cli/cmd/device.go rename to cli/cmd/networkElement.go index 41a9cd51c8ee4686039216ce447ba8b30b163345..ac7b06be802eee4dad92160d3f32c2c0b261cabb 100644 --- a/cli/cmd/device.go +++ b/cli/cmd/networkElement.go @@ -41,18 +41,18 @@ var password string //var duid string -// deviceCmd represents the device command. -var deviceCmd = &cobra.Command{ - Use: "device", - Aliases: []string{"dev"}, - Short: "the device (dev) command contains all sub-commands for device management", - Long: `The device (dev) command contains all sub-commands for device management, -both on the controller and device level. It has no functionality in itself. +// networkElementCmd represents the network element command. +var networkElementCmd = &cobra.Command{ + Use: "networkElement", + Aliases: []string{"mne"}, + Short: "the network element (mne) command contains all sub-commands for network element management", + Long: `The network element (mne) command contains all sub-commands for network element management, +both on the controller and network element level. It has no functionality in itself. The sub-commands 'create', 'remove' and 'show' operate on the goSDN controller level and change information there. -To change settings directly on the device, use the 'get', 'set' and 'delete' sub-commands.`, +To change settings directly on the network element, use the 'get', 'set' and 'delete' sub-commands.`, } func init() { - rootCmd.AddCommand(deviceCmd) + rootCmd.AddCommand(networkElementCmd) } diff --git a/cli/cmd/deviceCreate.go b/cli/cmd/networkElementCreate.go similarity index 68% rename from cli/cmd/deviceCreate.go rename to cli/cmd/networkElementCreate.go index 9b064025d9048b92d1d3d35a167f69d409707f74..292ca9b72497d32494031d58e863c91e19a03f5c 100644 --- a/cli/cmd/deviceCreate.go +++ b/cli/cmd/networkElementCreate.go @@ -40,16 +40,16 @@ import ( tpb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/transport" ) -// deviceCreateCmd represents the create command. -var deviceCreateCmd = &cobra.Command{ +// networkElementCreateCmd represents the create command. +var networkElementCreateCmd = &cobra.Command{ Use: "create", - Short: "creates a device on the controller", - Long: `Creates an orchestrated network device on the controller. -Device address must be provided with IP and port,e.g., 192.168.1.1:6030. User credentials need to be provided as parameters + Short: "creates a network element on the controller", + Long: `Creates an orchestrated network network element on the controller. +Network element address must be provided with IP and port,e.g., 192.168.1.1:6030. User credentials need to be provided as parameters if they diverge from the default credentials (user:'admin' and pw:'arista').`, RunE: func(cmd *cobra.Command, args []string) error { - spinner, _ := pterm.DefaultSpinner.Start("Creating new device") + spinner, _ := pterm.DefaultSpinner.Start("Creating new network element") err := checkIPPort(address) if err != nil { spinner.Fail(err) @@ -78,14 +78,14 @@ if they diverge from the default credentials (user:'admin' and pw:'arista').`, return err } - resp, err := pndAdapter.AddDevice(createContextWithAuthorization(), deviceName, opt, sid) + resp, err := pndAdapter.AddNetworkElement(createContextWithAuthorization(), mneName, opt, sid) if err != nil { spinner.Fail(err) return err } for _, r := range resp.GetResponses() { - spinner.Success("Device has been created with ID: ", r.GetId()) + spinner.Success("Network element has been created with ID: ", r.GetId()) } return nil @@ -93,19 +93,19 @@ if they diverge from the default credentials (user:'admin' and pw:'arista').`, PostRun: func(cmd *cobra.Command, args []string) { // Necessary for prompt mode. The flag variables have to be resetted, // since in prompt mode the program keeps running. - deviceName, opcode, address, username, password = "", "", "", "", "" + mneName, opcode, address, username, password = "", "", "", "", "" }, } -var deviceName string +var mneName string var opcode string func init() { - deviceCmd.AddCommand(deviceCreateCmd) + networkElementCmd.AddCommand(networkElementCreateCmd) - deviceCreateCmd.Flags().StringVar(&deviceName, "name", "", "add a device name (optional)") - deviceCreateCmd.Flags().StringVar(&opcode, "type", "", "generation target (csbi or plugin)") - deviceCreateCmd.Flags().StringVarP(&address, "address", "a", "", "address of a gnmi target, e.g. 192.168.1.1:6030") - deviceCreateCmd.Flags().StringVarP(&username, "username", "u", "", "username for a gnmi resource") - deviceCreateCmd.Flags().StringVarP(&password, "password", "p", "", "password for a gnmi resource") + networkElementCreateCmd.Flags().StringVar(&mneName, "name", "", "add a network element name (optional)") + networkElementCreateCmd.Flags().StringVar(&opcode, "type", "", "generation target (csbi or plugin)") + networkElementCreateCmd.Flags().StringVarP(&address, "address", "a", "", "address of a gnmi target, e.g. 192.168.1.1:6030") + networkElementCreateCmd.Flags().StringVarP(&username, "username", "u", "", "username for a gnmi resource") + networkElementCreateCmd.Flags().StringVarP(&password, "password", "p", "", "password for a gnmi resource") } diff --git a/cli/cmd/deviceDelete.go b/cli/cmd/networkElementDelete.go similarity index 77% rename from cli/cmd/deviceDelete.go rename to cli/cmd/networkElementDelete.go index fce779b73711e8e9d210ddf96e360c5e8800894b..134972c4eca504afdb8210dc99c3688ea1636656 100644 --- a/cli/cmd/deviceDelete.go +++ b/cli/cmd/networkElementDelete.go @@ -38,25 +38,25 @@ import ( "github.com/spf13/cobra" ) -// deviceDeleteCmd represents the delete command. -var deviceDeleteCmd = &cobra.Command{ +// networkElementDeleteCmd represents the delete command. +var networkElementDeleteCmd = &cobra.Command{ Use: "delete [uuid] [path]", Args: cobra.ExactArgs(2), - Short: "delete a path on a device", - Long: `Delete a path for a given orchestrated network device. -The device UUID and request path must be specified as a positional arguments.`, + Short: "delete a path on a network element", + Long: `Delete a path for a given orchestrated network network element. +The network element UUID and request path must be specified as a positional arguments.`, RunE: func(cmd *cobra.Command, args []string) error { spinner, _ := pterm.DefaultSpinner.Start("Create a path deletion request.") - did, err := uuid.Parse(args[0]) + mneid, err := uuid.Parse(args[0]) if err != nil { spinner.Fail(err) return err } - resp, err := pndAdapter.ChangeOND( + resp, err := pndAdapter.ChangeMNE( createContextWithAuthorization(), - did, + mneid, ppb.ApiOperation_API_OPERATION_DELETE, args[1], ) @@ -67,9 +67,9 @@ The device UUID and request path must be specified as a positional arguments.`, for _, r := range resp.Responses { if r.Status == ppb.Status_STATUS_OK { - spinner.Success("A change for path deletion for Device: ", did.String(), "has been created -> Change ID: ", r.GetId()) + spinner.Success("A change for path deletion for network element: ", mneid.String(), "has been created -> Change ID: ", r.GetId()) } else { - spinner.Fail("An error occurred while creating a path deletion request for Device with ID: ", r.GetId(), r.GetStatus()) + spinner.Fail("An error occurred while creating a path deletion request for network element with ID: ", r.GetId(), r.GetStatus()) } } return nil @@ -77,5 +77,5 @@ The device UUID and request path must be specified as a positional arguments.`, } func init() { - deviceCmd.AddCommand(deviceDeleteCmd) + networkElementCmd.AddCommand(networkElementDeleteCmd) } diff --git a/cli/cmd/deviceGet.go b/cli/cmd/networkElementGet.go similarity index 85% rename from cli/cmd/deviceGet.go rename to cli/cmd/networkElementGet.go index dc47ec9a2f25b75d5042813fd58e7e08fee357d2..af9a45a3cd6abbf086c08256c8e65a7e0b753a25 100644 --- a/cli/cmd/deviceGet.go +++ b/cli/cmd/networkElementGet.go @@ -39,16 +39,16 @@ import ( "google.golang.org/protobuf/encoding/protojson" ) -// deviceGetCmd represents the get command. -var deviceGetCmd = &cobra.Command{ +// networkElementGetCmd represents the get command. +var networkElementGetCmd = &cobra.Command{ Use: "get [uuid] [path]", Args: cobra.ExactArgs(2), - Short: "gets a path from a specified device on the controller", - Long: `Requests a path from a specified orchestrated network device on the controller. -The device UUID and request path must be specified as a positional arguments.`, + Short: "gets a path from a specified network element on the controller", + Long: `Requests a path from a specified orchestrated network network element on the controller. +The network element UUID and request path must be specified as a positional arguments.`, RunE: func(cmd *cobra.Command, args []string) error { - did, err := uuid.Parse(args[0]) + mneid, err := uuid.Parse(args[0]) if err != nil { pterm.Error.Println(err) return err @@ -56,7 +56,7 @@ The device UUID and request path must be specified as a positional arguments.`, res, err := pndAdapter.Request( createContextWithAuthorization(), - did, + mneid, args[1], ) if err != nil { @@ -64,7 +64,7 @@ The device UUID and request path must be specified as a positional arguments.`, return err } - for _, n := range res.Device { + for _, n := range res.MneNotification { var panel3 string panel1 := pterm.DefaultBox.WithTitle("Timestamp:").Sprint(n.GetTimestamp()) panel2 := pterm.DefaultBox.WithTitle("Requested Path:").Sprint(args[1]) @@ -92,5 +92,5 @@ The device UUID and request path must be specified as a positional arguments.`, } func init() { - deviceCmd.AddCommand(deviceGetCmd) + networkElementCmd.AddCommand(networkElementGetCmd) } diff --git a/cli/cmd/deviceList.go b/cli/cmd/networkElementList.go similarity index 83% rename from cli/cmd/deviceList.go rename to cli/cmd/networkElementList.go index 870332ecb6ed37e15ac4de0bb05113d39e93c893..5da2e9ec35aabbb977c7aacd2f82d107c7a892a4 100644 --- a/cli/cmd/deviceList.go +++ b/cli/cmd/networkElementList.go @@ -37,25 +37,25 @@ import ( "github.com/spf13/cobra" ) -// deviceListCmd represents the listDevice command. -var deviceListCmd = &cobra.Command{ +// networkElementListCmd represents the list command. +var networkElementListCmd = &cobra.Command{ Use: "list", Aliases: []string{"ls"}, - Short: "list all devices in current PND", - Long: "List all orchestrated network devices within the current PND.", + Short: "list all network elements in current PND", + Long: "List all orchestrated network network elements within the current PND.", RunE: func(cmd *cobra.Command, args []string) error { spinner, _ := pterm.DefaultSpinner.Start("Fetching data from controller") - resp, err := pndAdapter.GetFlattenedDevices(createContextWithAuthorization()) + resp, err := pndAdapter.GetFlattenedNetworkElements(createContextWithAuthorization()) if err != nil { spinner.Fail(err) return err } data := pterm.TableData{[]string{"UUID", "Name", "SBI-UUID"}} - for _, dev := range resp.GetOnd() { - data = append(data, []string{dev.GetId(), dev.GetName(), dev.GetSbi()}) + for _, mne := range resp.GetMne() { + data = append(data, []string{mne.GetId(), mne.GetName(), mne.GetSbi()}) } spinner.Success() @@ -70,7 +70,7 @@ var deviceListCmd = &cobra.Command{ } func init() { - deviceCmd.AddCommand(deviceListCmd) + networkElementCmd.AddCommand(networkElementListCmd) // Here you will define your flags and configuration settings. diff --git a/cli/cmd/deviceRemove.go b/cli/cmd/networkElementRemove.go similarity index 74% rename from cli/cmd/deviceRemove.go rename to cli/cmd/networkElementRemove.go index 591ee7ad463faea978e05bed329e43677433a94e..f278b6460793616961e2459108c7228876c1332c 100644 --- a/cli/cmd/deviceRemove.go +++ b/cli/cmd/networkElementRemove.go @@ -38,32 +38,32 @@ import ( "github.com/spf13/cobra" ) -// deviceRemoveCmd represents the remove command. -var deviceRemoveCmd = &cobra.Command{ +// networkElementRemoveCmd represents the remove command. +var networkElementRemoveCmd = &cobra.Command{ Use: "remove [uuid]", Aliases: []string{"rm"}, Args: cobra.ExactArgs(1), - Short: "deletes a device on the controller", - Long: `Deletes an orchestrated network device on the controller. -The device UUID must be specified as a positional argument.`, + Short: "deletes a network element on the controller", + Long: `Deletes an orchestrated network network element on the controller. +The network element UUID must be specified as a positional argument.`, RunE: func(cmd *cobra.Command, args []string) error { - spinner, _ := pterm.DefaultSpinner.Start("Removing device with ID: ", args[0]) - did, err := uuid.Parse(args[0]) + spinner, _ := pterm.DefaultSpinner.Start("Removing network element with ID: ", args[0]) + mneid, err := uuid.Parse(args[0]) if err != nil { spinner.Fail(err) return err } - _, err = pndAdapter.RemoveDevice(createContextWithAuthorization(), did) + _, err = pndAdapter.RemoveNetworkElement(createContextWithAuthorization(), mneid) if err != nil { spinner.Fail(err) return err } - spinner.Success("Device has been deleted, ID: ", did.String()) + spinner.Success("Network element has been deleted, ID: ", mneid.String()) return nil }, } func init() { - deviceCmd.AddCommand(deviceRemoveCmd) + networkElementCmd.AddCommand(networkElementRemoveCmd) } diff --git a/cli/cmd/deviceSet.go b/cli/cmd/networkElementSet.go similarity index 77% rename from cli/cmd/deviceSet.go rename to cli/cmd/networkElementSet.go index 60a7fccb9865d7376c1b5b6f187a782c2d755895..faa0040e0d7c00fefc82b29c5e41a2beabf93a53 100644 --- a/cli/cmd/deviceSet.go +++ b/cli/cmd/networkElementSet.go @@ -44,20 +44,20 @@ var replace bool var file string var forcePush bool -// deviceSetCmd represents the set command. -var deviceSetCmd = &cobra.Command{ +// networkElementSetCmd represents the set command. +var networkElementSetCmd = &cobra.Command{ Use: "set [uuid] [path] [value]", Args: cobra.RangeArgs(2, 3), - Short: "set a value on a device", - Long: `Set a path value for a given orchestrated network device. Only one path and + Short: "set a value on a network element", + Long: `Set a path value for a given orchestrated network network element. Only one path and only one value supported for now. -The device UUID, request path and value must be specified as positional arguments. +The network element UUID, request path and value must be specified as positional arguments. To enable replacing behaviour (destructive!), set the --replace flag."`, RunE: func(cmd *cobra.Command, args []string) error { spinner, _ := pterm.DefaultSpinner.Start("Create a path set request.") - did, err := uuid.Parse(args[0]) + mneid, err := uuid.Parse(args[0]) if err != nil { spinner.Fail(err) } @@ -83,9 +83,9 @@ To enable replacing behaviour (destructive!), set the --replace flag."`, } - resp, err := pndAdapter.ChangeOND( + resp, err := pndAdapter.ChangeMNE( createContextWithAuthorization(), - did, + mneid, operation, args[1], value, @@ -97,7 +97,7 @@ To enable replacing behaviour (destructive!), set the --replace flag."`, } for _, r := range resp.GetResponses() { - spinner.Success("A change for Device: ", did.String(), "has been created -> Change ID: ", r.GetId()) + spinner.Success("A change for Network element: ", mneid.String(), "has been created -> Change ID: ", r.GetId()) if forcePush { executeFunc("change commit " + r.GetId()) executeFunc("change confirm " + r.GetId()) @@ -122,8 +122,8 @@ func fileContentToString(path string) (string, error) { } func init() { - deviceCmd.AddCommand(deviceSetCmd) - deviceSetCmd.Flags().BoolVarP(&replace, "replace", "r", false, "enables replace behaviour") - deviceSetCmd.Flags().StringVar(&file, "file", "", "reference the path to a file containing your changes as JSON") - deviceSetCmd.Flags().BoolVar(&forcePush, "force-push", false, "enables the possibility to instantly push the set without commit/confirm") + networkElementCmd.AddCommand(networkElementSetCmd) + networkElementSetCmd.Flags().BoolVarP(&replace, "replace", "r", false, "enables replace behaviour") + networkElementSetCmd.Flags().StringVar(&file, "file", "", "reference the path to a file containing your changes as JSON") + networkElementSetCmd.Flags().BoolVar(&forcePush, "force-push", false, "enables the possibility to instantly push the set without commit/confirm") } diff --git a/cli/cmd/deviceShow.go b/cli/cmd/networkElementShow.go similarity index 69% rename from cli/cmd/deviceShow.go rename to cli/cmd/networkElementShow.go index 51be7acf7736292f3ed737b002a7f98d24118780..3a71cbf37f9b2c977dfef44defe1cd11486868f9 100644 --- a/cli/cmd/deviceShow.go +++ b/cli/cmd/networkElementShow.go @@ -36,29 +36,29 @@ import ( "github.com/spf13/cobra" ) -// deviceShowCmd represents the show command. -var deviceShowCmd = &cobra.Command{ +// networkElementShowCmd represents the show command. +var networkElementShowCmd = &cobra.Command{ Use: "show", Args: cobra.ExactArgs(1), - Short: "gets single device information from the controller", - Long: `Gets single orchestrated network device information from the controller. -Device UUID or name must be specified as a positional argument. -The device information returned is the information as currently stored in the controller. -The actual device is not queried directly.`, + Short: "gets single network element information from the controller", + Long: `Gets single orchestrated network network element information from the controller. +Network element UUID or name must be specified as a positional argument. +The network element information returned is the information as currently stored in the controller. +The actual network element is not queried directly.`, RunE: func(cmd *cobra.Command, args []string) error { - resp, err := pndAdapter.GetDevice(createContextWithAuthorization(), args[0]) + resp, err := pndAdapter.GetNetworkElement(createContextWithAuthorization(), args[0]) if err != nil { pterm.Error.Println(err) return err } - dev := resp.GetOnd() + mne := resp.GetMne() - panel1 := pterm.DefaultBox.WithTitle("UUID:").Sprint(dev.Id) - panel2 := pterm.DefaultBox.WithTitle("Name:").Sprint(dev.Name) - panel3 := pterm.DefaultBox.WithTitle("SBI-UUID:").Sprint(dev.Sbi.Id) - panel4 := pterm.DefaultBox.WithTitle("SBI-Type:").Sprint(dev.Sbi.Type.String()) + panel1 := pterm.DefaultBox.WithTitle("UUID:").Sprint(mne.Id) + panel2 := pterm.DefaultBox.WithTitle("Name:").Sprint(mne.Name) + panel3 := pterm.DefaultBox.WithTitle("SBI-UUID:").Sprint(mne.Sbi.Id) + panel4 := pterm.DefaultBox.WithTitle("SBI-Type:").Sprint(mne.Sbi.Type.String()) panels, _ := pterm.DefaultPanel.WithPanels(pterm.Panels{ {{Data: panel1}}, @@ -74,5 +74,5 @@ The actual device is not queried directly.`, } func init() { - deviceCmd.AddCommand(deviceShowCmd) + networkElementCmd.AddCommand(networkElementShowCmd) } diff --git a/cli/cmd/deviceSubscribe.go b/cli/cmd/networkElementSubscribe.go similarity index 96% rename from cli/cmd/deviceSubscribe.go rename to cli/cmd/networkElementSubscribe.go index 1297891fee8ccc93a7521e49522b8d1eb5839e40..e2b98b2c51ee58578f1cc239c41de8d4bee29318 100644 --- a/cli/cmd/deviceSubscribe.go +++ b/cli/cmd/networkElementSubscribe.go @@ -57,7 +57,7 @@ The device UUID and requested paths must be specified as a positional arguments. return err } - subClient, err := pndAdapter.SubscribeONDPath( + subClient, err := pndAdapter.SubscribeMNEPath( createContextWithAuthorization(), did, &pnd.SubscriptionList{ @@ -101,5 +101,5 @@ The device UUID and requested paths must be specified as a positional arguments. } func init() { - deviceCmd.AddCommand(deviceSubscribeCmd) + networkElementCmd.AddCommand(deviceSubscribeCmd) } diff --git a/cli/cmd/prompt.go b/cli/cmd/prompt.go index ffc0dd8ca84820667808593ee8d102c75e570b71..d8bc1a817a75c5445abe60e8e8f0067e7c3234cf 100644 --- a/cli/cmd/prompt.go +++ b/cli/cmd/prompt.go @@ -198,7 +198,7 @@ func cobraCommandCompletion(currCmd *cobra.Command, d prompt.Document, inputFlag return prompt.FilterHasPrefix(loaded, d.GetWordBeforeCursor(), true) } -//nolint +// nolint func completionBasedOnCmd(c *PromptCompleter, cmd *cobra.Command, inputSplit []string, inputFlags []string, d prompt.Document) []prompt.Suggest { switch cmd { case pndUseCmd, pndGetCmd, pndRemoveCmd: @@ -214,19 +214,19 @@ func completionBasedOnCmd(c *PromptCompleter, cmd *cobra.Command, inputSplit []s if len(inputSplit) < 3 || (len(inputSplit) == 3 && d.GetWordBeforeCursor() != "") { return c.updateSuggestionsThroughFunc(d, getCommittedChanges) } - case deviceRemoveCmd: + case networkElementRemoveCmd: if len(inputSplit) < 3 || (len(inputSplit) == 3 && d.GetWordBeforeCursor() != "") { return c.updateSuggestionsThroughFunc(d, getDevices) } - case deviceGetCmd, deviceSetCmd: + case networkElementGetCmd, networkElementSetCmd: return deviceGetCompletion(c, d, inputSplit) - case deviceShowCmd: + case networkElementShowCmd: devices, err := getDevices() if err != nil { return []prompt.Suggest{} } return devices - case deviceCmd, pndCmd, changeCmd: + case networkElementCmd, pndCmd, changeCmd: c.currentSuggestions = nil return cobraCommandCompletion(cmd, d, inputFlags, []prompt.Suggest{}) default: @@ -241,15 +241,15 @@ func completionBasedOnCmd(c *PromptCompleter, cmd *cobra.Command, inputSplit []s // the result is converted into a prompt.Suggest slice. func getDevices() ([]prompt.Suggest, error) { spinner, _ := pterm.DefaultSpinner.Start("Fetching devices from controller.") - resp, err := pndAdapter.GetFlattenedDevices(createContextWithAuthorization()) + resp, err := pndAdapter.GetFlattenedNetworkElements(createContextWithAuthorization()) if err != nil { spinner.Fail(err) return []prompt.Suggest{}, err } s := []prompt.Suggest{} - for _, ond := range resp.Ond { - s = append(s, prompt.Suggest{Text: ond.GetId(), Description: ond.GetName()}) + for _, mne := range resp.Mne { + s = append(s, prompt.Suggest{Text: mne.GetId(), Description: mne.GetName()}) } spinner.Success() return completer.SortSuggestionByText(s), nil @@ -260,12 +260,12 @@ func getDevices() ([]prompt.Suggest, error) { // current pulling status with the help of pterm. func getSchemaTreeForDeviceID(id string) (map[string]*yang.Entry, error) { spinner, _ := pterm.DefaultSpinner.Start("Fetching schema tree for Device with ID: ", id) - dev, err := pndAdapter.GetDevice(createContextWithAuthorization(), id) + dev, err := pndAdapter.GetNetworkElement(createContextWithAuthorization(), id) if err != nil { spinner.Fail(err) return nil, err } - sid, err := uuid.Parse(dev.GetOnd().GetSbi().GetId()) + sid, err := uuid.Parse(dev.GetMne().GetSbi().GetId()) if err != nil { spinner.Fail(err) return nil, err diff --git a/cli/cmd/root.go b/cli/cmd/root.go index 8e2e8a30f5b1b47eed00af10f75a9a1d9f813d22..dc14591b3ddd048a967b9638461751004b92992b 100644 --- a/cli/cmd/root.go +++ b/cli/cmd/root.go @@ -85,7 +85,7 @@ func init() { // add CLI global parameters rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (./.gosdnc.toml)") rootCmd.PersistentFlags().StringVarP(&loglevel, "log-level", "l", "", "log level 'debug' or 'trace'") - rootCmd.PersistentFlags().BoolVar(&verbose, "verbose", false, "show ond and sbi info") + rootCmd.PersistentFlags().BoolVar(&verbose, "verbose", false, "show mne and sbi info") rootCmd.Flags().StringVar(&grpcPort, "grpc-port", "55055", "port for gRPC NBI") } diff --git a/controller/ARCHITECTURE.md b/controller/ARCHITECTURE.md index dcd0d814bd56c70088e075aab00a801b32c1eab5..6169399944780c0d92c441690b438c42b6d5ebde 100644 --- a/controller/ARCHITECTURE.md +++ b/controller/ARCHITECTURE.md @@ -8,7 +8,7 @@ This document describes the the high-level architecture of the goSDN project. Al On the highest level goSDn provides a gRPC northbound-interface and two types of southbound-interfaces: RESTCONF and gRPC-based. The northbound interface allows the interaction with a running goSDN daemon and may allow the stacking of multiple controllers in the future. The southbound interface (SBI) capabilities are split in `nucleus` models and plugins. The supported `nucleus` models are OpenConfig yang [openconfig-yang](https://github.com/openconfig/yang) and TAPI. Third party models and more SBI-transports can be attached using the go plugin architecture. -The internal data representation uses [ygot](https://github.com/openconfig/ygot) generated go-structs. +The internal data representation uses [ygot](https://github.com/openconfig/ygot) generated go-structs. It is important to note that these go-structs are generated from yang models and thus are not generic data structures. This means that the `nucleus` code is organized in silos, i.e., one particular southbound-interface is visible in the `nucleus`, as the internal data representation depend on the used yang modes in the southbound-interface. ## Code Map @@ -29,15 +29,15 @@ Forks of `google/gnxi/gnmi` and `arista/goarista/gnmi` for gNMI server and clien ### `nucleus/principalNetworkDomain` -`nucleus` is the core package of goSDN. The main data structure is the `principalNetworkDomain` (PND). It reflects one administrative entity, i.e., as set of connected network devices, and is the source of truth for network state and configuration. A PND is SBI agnostic and supports multiple SBI implementations simultaneously. +`nucleus` is the core package of goSDN. The main data structure is the `principalNetworkDomain` (PND). It reflects one administrative entity, i.e., as set of connected network network elements, and is the source of truth for network state and configuration. A PND is SBI agnostic and supports multiple SBI implementations simultaneously. -**API boundary:** The PND' is the only way to interact with an `orchestratedNetworkingDevice` +**API boundary:** The PND' is the only way to interact with an `managedNetworkElement` -### `nucleus/device` +### `nucleus/network element` -This is the representation of an `orchestratedNetworkingDevice` (OND). An `orchestratedNetworkingDevice` is the network device that is directly managed by goSDN. It holds a reference to the device's `transport` and `southboundInterface` implementation. It contains a fakeroot device based on its attached SBI. +This is the representation of an `managedNetworkElement` (MNE). An `managedNetworkElement` is the network network element that is directly managed by goSDN. It holds a reference to the network element's `transport` and `southboundInterface` implementation. It contains a fakeroot network element based on its attached SBI. -**Architecture invariant:** The device is does not provide any functionality to upper API layers. +**Architecture invariant:** The network element is does not provide any functionality to upper API layers. ### `nucleus/southbound` @@ -47,8 +47,8 @@ Implementation of SBI specifics. Provides SBI models to other callers and SBI sp ### `nucleus/transport` `nucleus/gnmi_transport` `nucleus/restconf_transport` -Transport between goSDN and ONDs. Current core implementations are gNMI and RESTCONF. Additionally to implementing the transports the packages also provide a mapping from general purpose goSDN API calls to diverging SBI API calls. +Transport between goSDN and MNEs. Current core implementations are gNMI and RESTCONF. Additionally to implementing the transports the packages also provide a mapping from general purpose goSDN API calls to diverging SBI API calls. For example `gNMI::Subscribe` and `RESTCONF::Push` are mapped to `gosdn::Subscribe`. -The `gnmi_transport` implementation uses `ytypes.SetNode` to write to a device struct. +The `gnmi_transport` implementation uses `ytypes.SetNode` to write to a network element struct. diff --git a/controller/README.md b/controller/README.md index 0835d28c90b8eaa7b033343d1d4a753e7a77824b..3670c8f478bc127622f61caa3dc4d67a363492e4 100644 --- a/controller/README.md +++ b/controller/README.md @@ -27,15 +27,15 @@ # Concepts -The `goSDN` core - also called `nucleus` - is a lightweight library that manages principal network domains and provides southbound interface operations for orchestrated networking devices. +The `goSDN` core - also called `nucleus` - is a lightweight library that manages principal network domains and provides southbound interface operations for managed network elements. ## Principal Networking Domain (PND) -The PND is the single source of truth within a network. Its state is held and maintained by the controller. Any configuration of an OND has to be applied by the PND. +The PND is the single source of truth within a network. Its state is held and maintained by the controller. Any configuration of an MNE has to be applied by the PND. -## Orchestrated Networking Device (OND) +## Managed Network Element (MNE) -Any device directly configured by `goSDN` +Any network element directly configured by `goSDN` # Installing You can install the latest release of `goSDN` locally using the `go get` command. Since the repository and some dependencies are not publicly available you have to modify your git config first: diff --git a/controller/api/apiIntegration_test.go b/controller/api/apiIntegration_test.go index 39829243fb344712ce5f020a007939d77bea196a..e9c98b20c036bfd611b4edc1288c03dfad5a4cee 100644 --- a/controller/api/apiIntegration_test.go +++ b/controller/api/apiIntegration_test.go @@ -57,38 +57,38 @@ func TestApiIntegration(t *testing.T) { GnmiTransportOption: &tpb.GnmiTransportOption{}, }, } - if _, err := AddDevice( + if _, err := AddNetworkElement( context.TODO(), testAPIEndpoint, - "test-device", + "test-networkElement", opt, suid, puid, ); (err != nil) != tt.wantErr { - t.Errorf("gosdn cli add-device error = %v, wantErr %v", err, tt.wantErr) + t.Errorf("gosdn cli add-networkElement error = %v, wantErr %v", err, tt.wantErr) return } - did := viper.GetString("LAST_DEVICE_UUID") + mneid := viper.GetString("LAST_NETWORK_ELEMENT_UUID") - _, err = GetDevice( + _, err = GetNetworkElement( context.TODO(), testAPIEndpoint, cliPnd, - did, + mneid, ) if (err != nil) != tt.wantErr { t.Errorf("gosdn cli request error = %v, wantErr %v", err, tt.wantErr) return } - _, err = GetDevice( + _, err = GetNetworkElement( context.TODO(), testAPIEndpoint, cliPnd, - did, + mneid, ) if (err != nil) != tt.wantErr { - t.Errorf("gosdn cli get-device error = %v, wantErr %v", err, tt.wantErr) + t.Errorf("gosdn cli get-networkElement error = %v, wantErr %v", err, tt.wantErr) return } @@ -96,7 +96,7 @@ func TestApiIntegration(t *testing.T) { _, err = ChangeRequest( context.TODO(), testAPIEndpoint, - did, + mneid, cliPnd, testPath, hostname, @@ -107,7 +107,7 @@ func TestApiIntegration(t *testing.T) { return } - resp, err := GetDevice(context.TODO(), testAddress, testUsername, testPassword) + resp, err := GetNetworkElement(context.TODO(), testAddress, testUsername, testPassword) if err != nil { if !tt.wantErr { t.Errorf("Get() error = %v, wantErr %v", err, tt.wantErr) @@ -116,7 +116,7 @@ func TestApiIntegration(t *testing.T) { } var got string if resp != nil { - got = resp.Ond.Name + got = resp.Mne.Name } else { t.Errorf("integration test failed got cannot be nil") } diff --git a/controller/api/api_test.go b/controller/api/api_test.go index f6e8e29a6f129aa2f7a33214da15e6bd40b783b0..02a55df4be5e10f45213f6773d5de4ce3f90cede 100644 --- a/controller/api/api_test.go +++ b/controller/api/api_test.go @@ -33,7 +33,7 @@ func Test_GetIds(t *testing.T) { func ensureFilesForTestsAreRemoved() { ensureStoreFileForTestsIsRemoved(store.SbiFilenameSuffix) - ensureStoreFileForTestsIsRemoved(store.DeviceFilenameSuffix) + ensureStoreFileForTestsIsRemoved(store.NetworkElementFilenameSuffix) } func ensureStoreFileForTestsIsRemoved(storeName string) { @@ -117,7 +117,7 @@ func Test_AddDevice(t *testing.T) { GnmiTransportOption: &tpb.GnmiTransportOption{}, }, } - resp, err := AddDevice(context.TODO(), bufnet, "test", opt, sbiUUID, pndUUID) + resp, err := AddNetworkElement(context.TODO(), bufnet, "test", opt, sbiUUID, pndUUID) if err != nil { t.Error(err) return @@ -126,19 +126,19 @@ func Test_AddDevice(t *testing.T) { } func Test_GetDevice(t *testing.T) { - resp, err := GetDevice(context.TODO(), bufnet, pndID, ondID) + resp, err := GetNetworkElement(context.TODO(), bufnet, pndID, mneID) if err != nil { t.Error(err) return } - got := resp.Ond.Id - if got != ondID { - t.Errorf("PND ID is %v, expected %v", got, ondID) + got := resp.Mne.Id + if got != mneID { + t.Errorf("PND ID is %v, expected %v", got, mneID) } } func Test_Update(t *testing.T) { - resp, err := ChangeRequest(context.TODO(), bufnet, ondID, pndID, "", "", ppb.ApiOperation_API_OPERATION_UPDATE) + resp, err := ChangeRequest(context.TODO(), bufnet, mneID, pndID, "", "", ppb.ApiOperation_API_OPERATION_UPDATE) if err != nil { t.Error(err) return @@ -147,7 +147,7 @@ func Test_Update(t *testing.T) { } func Test_Replace(t *testing.T) { - resp, err := ChangeRequest(context.TODO(), bufnet, ondID, pndID, "", "", ppb.ApiOperation_API_OPERATION_REPLACE) + resp, err := ChangeRequest(context.TODO(), bufnet, mneID, pndID, "", "", ppb.ApiOperation_API_OPERATION_REPLACE) if err != nil { t.Error(err) return @@ -156,7 +156,7 @@ func Test_Replace(t *testing.T) { } func Test_Delete(t *testing.T) { - resp, err := ChangeRequest(context.TODO(), bufnet, ondID, pndID, "", "", ppb.ApiOperation_API_OPERATION_DELETE) + resp, err := ChangeRequest(context.TODO(), bufnet, mneID, pndID, "", "", ppb.ApiOperation_API_OPERATION_DELETE) if err != nil { t.Error(err) return diff --git a/controller/api/change.go b/controller/api/change.go index 2d5ad6e2ef8a024ed05d018fbb408c5d8599ded9..570b0af3374e5ab402a7f17e8765c98997068a66 100644 --- a/controller/api/change.go +++ b/controller/api/change.go @@ -79,14 +79,14 @@ func CommitConfirm(ctx context.Context, addr, pnd string, changes []*ppb.SetChan return client.SetChangeList(ctx, req) } -// ChangeRequest creates a ChangeRequest for the specified OND. ApiOperations +// ChangeRequest creates a ChangeRequest for the specified MNE. ApiOperations // are used to specify the type of the change (update, replace, delete as // specified in // https://github.com/openconfig/reference/blob/master/rpc/gnmi/gnmi-specification.md#34-modifying-state) // For delete operations the value field needs to contain an empty string. -func ChangeRequest(ctx context.Context, addr, did, pid, path, value string, op ppb.ApiOperation) (*ppb.SetPathListResponse, error) { +func ChangeRequest(ctx context.Context, addr, mneid, pid, path, value string, op ppb.ApiOperation) (*ppb.SetPathListResponse, error) { req := &ppb.ChangeRequest{ - Did: did, + Mneid: mneid, Path: path, Value: value, ApiOp: op, diff --git a/controller/api/initialise_test.go b/controller/api/initialise_test.go index 2938801f108172b6de9c965edf9cd5a0db24d1eb..1fed5009d856d4e883b5834a5a57791ef25b841b 100644 --- a/controller/api/initialise_test.go +++ b/controller/api/initialise_test.go @@ -15,8 +15,8 @@ import ( "code.fbi.h-da.de/danet/gosdn/controller/app" "code.fbi.h-da.de/danet/gosdn/controller/config" eventservice "code.fbi.h-da.de/danet/gosdn/controller/eventService" - "code.fbi.h-da.de/danet/gosdn/controller/interfaces/device" "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkdomain" + "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkelement" "code.fbi.h-da.de/danet/gosdn/controller/interfaces/rbac" "code.fbi.h-da.de/danet/gosdn/controller/interfaces/southbound" "code.fbi.h-da.de/danet/gosdn/controller/mocks" @@ -51,7 +51,7 @@ const bufnet = "bufnet" const pndID = "2043519e-46d1-4963-9a8e-d99007e104b8" const changeID = "0992d600-f7d4-4906-9559-409b04d59a5f" const sbiID = "f6fd4b35-f039-4111-9156-5e4501bb8a5a" -const ondID = "7e0ed8cc-ebf5-46fa-9794-741494914883" +const mneID = "7e0ed8cc-ebf5-46fa-9794-741494914883" var pndStore networkdomain.PndStore var userService rbac.UserService @@ -84,7 +84,7 @@ func bootstrapUnitTest() { log.Fatal(err) } - deviceUUID, err := uuid.Parse(ondID) + mneUUID, err := uuid.Parse(mneID) if err != nil { log.Fatal(err) } @@ -124,7 +124,7 @@ func bootstrapUnitTest() { mockDevice := &mocks.Device{} mockDevice.On("SBI").Return(sbi) - mockDevice.On("ID").Return(deviceUUID) + mockDevice.On("ID").Return(mneUUID) mockDevice.On("GetModel").Return(sbi.Schema().Root) mockDevice.On("Name").Return("openconfig") mockDevice.On("TransportAddress").Return("127.0.0.1:6030") @@ -136,18 +136,18 @@ func bootstrapUnitTest() { mockPnd.On("PendingChanges").Return([]uuid.UUID{changeUUID}) mockPnd.On("CommittedChanges").Return([]uuid.UUID{changeUUID}) mockPnd.On("GetChange", mock.Anything).Return(mockChange, nil) - mockPnd.On("AddDevice", mock.Anything, mock.Anything, mock.Anything).Return(nil, nil) - mockPnd.On("GetDevice", mock.Anything).Return(mockDevice, nil) + mockPnd.On("AddNetworkElement", mock.Anything, mock.Anything, mock.Anything).Return(nil, nil) + mockPnd.On("GetNetworkElement", mock.Anything).Return(mockDevice, nil) mockPnd.On("Commit", mock.Anything).Return(nil) mockPnd.On("Confirm", mock.Anything).Return(nil) - mockPnd.On("Devices").Return([]device.Device{ - &nucleus.CommonDevice{ - UUID: deviceUUID, + mockPnd.On("NetworkElements").Return([]networkelement.NetworkElement{ + &nucleus.CommonNetworkElement{ + UUID: mneUUID, Model: &openconfig.Device{}, }, }) mockPnd.On("GetSBIs").Return([]mocks.SouthboundInterface{}) - mockPnd.On("ChangeOND", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(uuid.Nil, nil) + mockPnd.On("ChangeMNE", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(uuid.Nil, nil) if err := pndStore.Add(&mockPnd); err != nil { log.Fatal(err) diff --git a/controller/api/device.go b/controller/api/managedNetworkElement.go similarity index 62% rename from controller/api/device.go rename to controller/api/managedNetworkElement.go index 27db2d3dff64d9b226a225c62db336f843d9be7c..8ed8f4d62d9d0cf8bc4c8af75bc2eb54d3aaa8f8 100644 --- a/controller/api/device.go +++ b/controller/api/managedNetworkElement.go @@ -17,23 +17,23 @@ import ( log "github.com/sirupsen/logrus" ) -// AddDevice adds a new device to the controller. The device name is optional. -// If no name is provided a name will be generated upon device creation. -func AddDevice(ctx context.Context, addr, deviceName string, opt *tpb.TransportOption, sid, pid uuid.UUID) (*ppb.SetOndListResponse, error) { +// AddNetworkElement adds a new network element to the controller. The network element name is optional. +// If no name is provided a name will be generated upon network element creation. +func AddNetworkElement(ctx context.Context, addr, mneName string, opt *tpb.TransportOption, sid, pid uuid.UUID) (*ppb.SetMneListResponse, error) { pndClient, err := nbi.PndClient(addr, dialOptions...) if err != nil { return nil, err } - req := &ppb.SetOndListRequest{ + req := &ppb.SetMneListRequest{ Timestamp: time.Now().UnixNano(), - Ond: []*ppb.SetOnd{ + Mne: []*ppb.SetMne{ { Address: opt.GetAddress(), Sbi: &spb.SouthboundInterface{ Id: sid.String(), }, - DeviceName: deviceName, + MneName: mneName, TransportOption: opt, }, }, @@ -41,35 +41,35 @@ func AddDevice(ctx context.Context, addr, deviceName string, opt *tpb.TransportO } switch t := opt.Type; t { case spb.Type_TYPE_CONTAINERISED, spb.Type_TYPE_PLUGIN: - req.Ond[0].Sbi.Id = uuid.Nil.String() - req.Ond[0].Sbi.Type = t - req.Ond[0].TransportOption.Type = t + req.Mne[0].Sbi.Id = uuid.Nil.String() + req.Mne[0].Sbi.Type = t + req.Mne[0].TransportOption.Type = t default: } - return pndClient.SetOndList(ctx, req) + return pndClient.SetMneList(ctx, req) } -// GetDevice requests one device belonging to a given -// PrincipalNetworkDomain from the controller. If no device identifier +// GetNetworkElement requests one network element belonging to a given +// PrincipalNetworkDomain from the controller. If no network element identifier // is provided, an error is thrown. -func GetDevice(ctx context.Context, addr, pid string, did string) (*ppb.GetOndResponse, error) { +func GetNetworkElement(ctx context.Context, addr, pid string, mneid string) (*ppb.GetMneResponse, error) { pndClient, err := nbi.PndClient(addr, dialOptions...) if err != nil { return nil, err } - if len(did) == 0 { + if len(mneid) == 0 { return nil, err } - req := &ppb.GetOndRequest{ + req := &ppb.GetMneRequest{ Timestamp: time.Now().UnixNano(), - Did: did, + Mneid: mneid, Pid: pid, } - return pndClient.GetOnd(ctx, req) + return pndClient.GetMne(ctx, req) } // GetSbiSchemaTree gets the sbi tree for a sbi. @@ -120,24 +120,24 @@ func GetSbiSchemaTree(ctx context.Context, addr string, pid, sid uuid.UUID) (map return sTreeMap, nil } -// GetFlattenedDevices requests all devices belonging to a given +// GetFlattenedNetworkElements requests all network elements belonging to a given // PrincipalNetworkDomain from the controller. -func GetFlattenedDevices(ctx context.Context, addr, pid string) (*ppb.GetFlattenedOndListResponse, error) { +func GetFlattenedNetworkElements(ctx context.Context, addr, pid string) (*ppb.GetFlattenedMneListResponse, error) { pndClient, err := nbi.PndClient(addr, dialOptions...) if err != nil { return nil, err } - req := &ppb.GetOndListRequest{ + req := &ppb.GetMneListRequest{ Timestamp: time.Now().UnixNano(), Pid: pid, } - return pndClient.GetFlattenedOndList(ctx, req) + return pndClient.GetFlattenedMneList(ctx, req) } // GetPath requests a specific path. -func GetPath(ctx context.Context, addr, pid, did, path string) (*ppb.GetPathResponse, error) { +func GetPath(ctx context.Context, addr, pid, mneid, path string) (*ppb.GetPathResponse, error) { pndClient, err := nbi.PndClient(addr, dialOptions...) if err != nil { return nil, err @@ -145,7 +145,7 @@ func GetPath(ctx context.Context, addr, pid, did, path string) (*ppb.GetPathResp req := &ppb.GetPathRequest{ Timestamp: time.Now().UnixNano(), - Did: did, + Mneid: mneid, Pid: pid, Path: path, } @@ -153,8 +153,8 @@ func GetPath(ctx context.Context, addr, pid, did, path string) (*ppb.GetPathResp return pndClient.GetPath(ctx, req) } -// SubscribePath subscribes to paths on a device. -func SubscribePath(ctx context.Context, addr, pid, did string, slist *ppb.SubscriptionList) (ppb.PndService_SubscribePathClient, error) { +// SubscribePath subscribes to paths on a network element. +func SubscribePath(ctx context.Context, addr, pid, mneid string, slist *ppb.SubscriptionList) (ppb.PndService_SubscribePathClient, error) { log.Println("subscribePath called") pndClient, err := nbi.PndClient(addr, dialOptions...) if err != nil { @@ -163,7 +163,7 @@ func SubscribePath(ctx context.Context, addr, pid, did string, slist *ppb.Subscr req := &ppb.SubscribePathRequest{ Timestamp: time.Now().UnixNano(), - Did: did, + Mneid: mneid, Pid: pid, Sublist: slist, } @@ -171,18 +171,18 @@ func SubscribePath(ctx context.Context, addr, pid, did string, slist *ppb.Subscr return pndClient.SubscribePath(ctx, req) } -// DeleteDevice deletes a device. -func DeleteDevice(ctx context.Context, addr, pid, did string) (*ppb.DeleteOndResponse, error) { +// DeleteNetworkElement deletes a network element. +func DeleteNetworkElement(ctx context.Context, addr, pid, mneid string) (*ppb.DeleteMneResponse, error) { pndClient, err := nbi.PndClient(addr, dialOptions...) if err != nil { return nil, err } - req := &ppb.DeleteOndRequest{ + req := &ppb.DeleteMneRequest{ Timestamp: time.Now().UnixNano(), - Did: did, + Mneid: mneid, Pid: pid, } - return pndClient.DeleteOnd(ctx, req) + return pndClient.DeleteMne(ctx, req) } diff --git a/controller/controller.go b/controller/controller.go index 1994888821bffa620eb93ca25d11e83c58193e6f..aadd8206d5ba61390bae3896717990c389e11dd4 100644 --- a/controller/controller.go +++ b/controller/controller.go @@ -22,7 +22,7 @@ import ( apppb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/app" pb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/core" cpb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/csbi" - dpb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/device" + mnepb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/networkelement" ppb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/pnd" apb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/rbac" spb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/southbound" @@ -33,8 +33,8 @@ import ( "code.fbi.h-da.de/danet/gosdn/controller/config" eventservice "code.fbi.h-da.de/danet/gosdn/controller/eventService" - "code.fbi.h-da.de/danet/gosdn/controller/interfaces/device" "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkdomain" + "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkelement" "code.fbi.h-da.de/danet/gosdn/controller/interfaces/rbac" "code.fbi.h-da.de/danet/gosdn/controller/northbound/server" nbi "code.fbi.h-da.de/danet/gosdn/controller/northbound/server" @@ -55,20 +55,20 @@ var coreOnce sync.Once // Core is the representation of the controller's core. type Core struct { - pndStore networkdomain.PndStore - userService rbac.UserService - roleService rbac.RoleService - topologyService topology.Service - nodeService nodes.Service - portService ports.Service - routeService routingtables.Service - httpServer *http.Server - grpcServer *grpc.Server - nbi *nbi.NorthboundInterface - eventService eventInterfaces.Service - appService app.ManagementService - deviceWatcher *nucleus.DeviceWatcher - stopChan chan os.Signal + pndStore networkdomain.PndStore + userService rbac.UserService + roleService rbac.RoleService + topologyService topology.Service + nodeService nodes.Service + portService ports.Service + routeService routingtables.Service + httpServer *http.Server + grpcServer *grpc.Server + nbi *nbi.NorthboundInterface + eventService eventInterfaces.Service + appService app.ManagementService + networkElementWatcher *nucleus.NetworkElementWatcher + stopChan chan os.Signal csbiClient cpb.CsbiServiceClient } @@ -84,7 +84,7 @@ func initialize() error { err = config.ReadGnmiSubscriptionPaths() if err != nil { - log.Error("Error reading in gNMI subscription paths, can not watch devices automatically: ", err) + log.Error("Error reading in gNMI subscription paths, can not watch network elements automatically: ", err) } eventService, err := eventservice.NewEventService() @@ -127,8 +127,8 @@ func initialize() error { return err } - c.deviceWatcher = nucleus.NewDeviceWatcher(c.pndStore) - c.deviceWatcher.SubToDevices(config.GetGnmiSubscriptionPaths(), nil) + c.networkElementWatcher = nucleus.NewNetworkElementWatcher(c.pndStore) + c.networkElementWatcher.SubToDevices(config.GetGnmiSubscriptionPaths(), nil) err = ensureDefaultRoleExists() if err != nil { @@ -189,7 +189,7 @@ func startGrpc() error { apb.RegisterRoleServiceServer(c.grpcServer, c.nbi.Role) apppb.RegisterAppServiceServer(c.grpcServer, c.nbi.App) tpb.RegisterTopologyServiceServer(c.grpcServer, c.nbi.Topology) - dpb.RegisterDeviceServiceServer(c.grpcServer, c.nbi.Device) + mnepb.RegisterNetworkElementServiceServer(c.grpcServer, c.nbi.NetworkElement) tpb.RegisterRoutingTableServiceServer(c.grpcServer, c.nbi.Routes) go func() { @@ -259,18 +259,18 @@ func ensureDefaultRoleExists() error { "/gosdn.rbac.RoleService/UpdateRoles", "/gosdn.rbac.RoleService/DeletePermissionsForRole", "/gosdn.rbac.RoleService/DeleteRoles", - "/gosdn.pnd.PndService/GetOnd", - "/gosdn.pnd.PndService/GetFlattenedOndList", + "/gosdn.pnd.PndService/GetMne", + "/gosdn.pnd.PndService/GetFlattenedMneList", "/gosdn.pnd.PndService/GetSbi", "/gosdn.pnd.PndService/GetSbiList", "/gosdn.pnd.PndService/GetPath", "/gosdn.pnd.PndService/GetChange", "/gosdn.pnd.PndService/GetChangeList", - "/gosdn.pnd.PndService/SetOndList", + "/gosdn.pnd.PndService/SetMneList", "/gosdn.pnd.PndService/SetChangeList", "/gosdn.pnd.PndService/SetPathList", "/gosdn.pnd.PndService/SetSbiList", - "/gosdn.pnd.PndService/DeleteOnd", + "/gosdn.pnd.PndService/DeleteMne", "/gosdn.pnd.PndService/SubscribePath", "/gosdn.southbound.SbiService/GetSchema", })) @@ -345,7 +345,7 @@ func shutdown() error { return stopHttpServer() } -func callback(id uuid.UUID, ch chan device.Details) { +func callback(id uuid.UUID, ch chan networkelement.Details) { if ch != nil { c.pndStore.AddPendingChannel(id, ch) log.Infof("pending channel %v added", id) diff --git a/controller/http.go b/controller/http.go index 4fc8e7de514acfc199c844dfb31d6072be7fe63b..73f4ff23dac1277f2d70d984d5bb917a1136eedc 100644 --- a/controller/http.go +++ b/controller/http.go @@ -16,7 +16,7 @@ import ( "google.golang.org/grpc/status" cgw "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/core" - dgw "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/device" + mnegw "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/networkelement" pgw "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/pnd" agw "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/rbac" tgw "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/topology" @@ -82,7 +82,7 @@ func run() error { return err } - err = dgw.RegisterDeviceServiceHandlerFromEndpoint(ctx, mux, *grpcServerEndpoint, opts) + err = mnegw.RegisterNetworkElementServiceHandlerFromEndpoint(ctx, mux, *grpcServerEndpoint, opts) if err != nil { return err } diff --git a/controller/interfaces/change/change.go b/controller/interfaces/change/change.go index 72dd99905a2aeabe15bad22649ef3ca53e3f3fe3..92d0b0f4e58a2f2b35c9f1266ba3619c83090b68 100644 --- a/controller/interfaces/change/change.go +++ b/controller/interfaces/change/change.go @@ -8,10 +8,10 @@ import ( "github.com/openconfig/ygot/ygot" ) -// Change is an intended change to an OND. It is unique and immutable. +// Change is an intended change to an MNE. It is unique and immutable. // It has a cuid, a timestamp, and holds both the previous and the new // state. It keeps track if the state is committed and confirmed. A callback -// exists to acess the proper transport for the changed OND. +// exists to acess the proper transport for the changed MNE. type Change interface { ID() uuid.UUID Commit() error diff --git a/controller/interfaces/device/deviceService.go b/controller/interfaces/device/deviceService.go deleted file mode 100644 index 525678bd95e5349d67c10b77415aaf87b2f826cf..0000000000000000000000000000000000000000 --- a/controller/interfaces/device/deviceService.go +++ /dev/null @@ -1,16 +0,0 @@ -package device - -import ( - "code.fbi.h-da.de/danet/gosdn/controller/store" -) - -// Service describes an interface for device service implementations. -type Service interface { - Add(Device) error - Update(Device) error - UpdateModel(Device, string) error - Delete(Device) error - Get(store.Query) (Device, error) - GetAll() ([]Device, error) - GetAllAsLoaded() ([]LoadedDevice, error) -} diff --git a/controller/interfaces/device/deviceStore.go b/controller/interfaces/device/deviceStore.go deleted file mode 100644 index 6fba480e52fc2f6f0af030c6f69b0cf42c8804bb..0000000000000000000000000000000000000000 --- a/controller/interfaces/device/deviceStore.go +++ /dev/null @@ -1,14 +0,0 @@ -package device - -import ( - "code.fbi.h-da.de/danet/gosdn/controller/store" -) - -// Store describes an interface for device store implementations. -type Store interface { - Add(Device) error - Update(Device) error - Delete(Device) error - Get(store.Query) (LoadedDevice, error) - GetAll() ([]LoadedDevice, error) -} diff --git a/controller/interfaces/networkdomain/pnd.go b/controller/interfaces/networkdomain/pnd.go index 12aff19d34ab3bb26c4cf6d42f497ff71272cad9..58e62256d28d95e4ef38add37b6d2257a1bc09da 100644 --- a/controller/interfaces/networkdomain/pnd.go +++ b/controller/interfaces/networkdomain/pnd.go @@ -4,7 +4,7 @@ import ( ppb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/pnd" tpb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/transport" "code.fbi.h-da.de/danet/gosdn/controller/interfaces/change" - "code.fbi.h-da.de/danet/gosdn/controller/interfaces/device" + "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkelement" "code.fbi.h-da.de/danet/gosdn/controller/interfaces/southbound" "github.com/google/uuid" "google.golang.org/protobuf/proto" @@ -16,18 +16,18 @@ type NetworkDomain interface { Destroy() error AddSbi(s southbound.SouthboundInterface) error RemoveSbi(uuid.UUID) error - AddDevice(name string, opts *tpb.TransportOption, sid uuid.UUID) (uuid.UUID, error) - GetDevice(identifier string) (device.Device, error) - RemoveDevice(uuid.UUID) error - UpdateDevice(device.Device, string) error - Devices() []device.Device - FlattenedDevices() []device.LoadedDevice - ChangeOND(uuid uuid.UUID, operation ppb.ApiOperation, path string, value ...string) (uuid.UUID, error) + AddNetworkElement(name string, opts *tpb.TransportOption, sid uuid.UUID) (uuid.UUID, error) + GetNetworkElement(identifier string) (networkelement.NetworkElement, error) + RemoveNetworkElement(uuid.UUID) error + UpdateNetworkElement(networkelement.NetworkElement, string) error + NetworkElements() []networkelement.NetworkElement + FlattenedNetworkElements() []networkelement.LoadedNetworkElement + ChangeMNE(uuid uuid.UUID, operation ppb.ApiOperation, path string, value ...string) (uuid.UUID, error) Request(uuid.UUID, string) (proto.Message, error) RequestAll(string) error GetName() string GetDescription() string - MarshalDevice(string) (string, error) + MarshalNetworkElement(string) (string, error) GetSBIs() ([]southbound.SouthboundInterface, error) GetSBI(uuid.UUID) (southbound.SouthboundInterface, error) ID() uuid.UUID @@ -37,5 +37,5 @@ type NetworkDomain interface { Commit(uuid.UUID) error Confirm(uuid.UUID) error SubscribePath(uuid.UUID, *ppb.SubscriptionList) error - UpdateDeviceAfterSubscribeResponse(device.Device) error + UpdateNetworkElementAfterSubscribeResponse(networkelement.NetworkElement) error } diff --git a/controller/interfaces/networkdomain/pndStore.go b/controller/interfaces/networkdomain/pndStore.go index cb0c1b4820696e7604b41e917f88ed8983cff455..aca76af93577510fd0b1bc412a7f34500229957e 100644 --- a/controller/interfaces/networkdomain/pndStore.go +++ b/controller/interfaces/networkdomain/pndStore.go @@ -1,7 +1,7 @@ package networkdomain import ( - "code.fbi.h-da.de/danet/gosdn/controller/interfaces/device" + "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkelement" "code.fbi.h-da.de/danet/gosdn/controller/store" "github.com/google/uuid" ) @@ -12,7 +12,7 @@ type PndStore interface { Delete(NetworkDomain) error Get(store.Query) (NetworkDomain, error) GetAll() ([]NetworkDomain, error) - PendingChannels(id uuid.UUID, parseErrors ...error) (chan device.Details, error) - AddPendingChannel(id uuid.UUID, ch chan device.Details) + PendingChannels(id uuid.UUID, parseErrors ...error) (chan networkelement.Details, error) + AddPendingChannel(id uuid.UUID, ch chan networkelement.Details) RemovePendingChannel(id uuid.UUID) } diff --git a/controller/interfaces/device/device.go b/controller/interfaces/networkelement/networkElement.go similarity index 71% rename from controller/interfaces/device/device.go rename to controller/interfaces/networkelement/networkElement.go index 9a0d94afe6784cf6e2bb9175b1825f7979a5da24..840cf072a82ec6b37438fa12b5945547024dd786 100644 --- a/controller/interfaces/device/device.go +++ b/controller/interfaces/networkelement/networkElement.go @@ -1,4 +1,4 @@ -package device +package networkelement import ( "code.fbi.h-da.de/danet/gosdn/controller/interfaces/southbound" @@ -10,9 +10,9 @@ import ( tpb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/transport" ) -// Device represents an Orchestrated Network Device (OND) which is managed by +// NetworkElement represents an Managed Network Element (MNE) which is managed by // nucleus. -type Device interface { +type NetworkElement interface { ID() uuid.UUID GetModel() ygot.GoStruct CreateModelCopy() (ygot.ValidatedGoStruct, error) @@ -25,23 +25,23 @@ type Device interface { TransportAddress() string } -// Details contains details of a device used by the cSBI mechanism. +// Details contains details of a network element used by the cSBI mechanism. type Details struct { ID string Address string TransportOption *tpb.TransportOption } -// LoadedDevice represents a Orchestrated Networking Device that was loaeded -// by using the Load() method of the DeviceStore. -type LoadedDevice struct { - // ID represents the UUID of the LoadedDevice. +// LoadedNetworkElement represents a Managed Network Element that was loaeded +// by using the Load() method of the NetworkElementStore. +type LoadedNetworkElement struct { + // ID represents the UUID of the LoadedNetworkElement. ID string `json:"id" bson:"_id"` - // Name represents the name of the LoadedDevice. + // Name represents the name of the LoadedNetworkElement. Name string `json:"name,omitempty"` - // TransportType represent the type of the transport in use of the LoadedDevice. + // TransportType represent the type of the transport in use of the LoadedNetworkElement. TransportType string `json:"transport_type,omitempty" bson:"transport_type,omitempty"` - // TransportAddress represents the address from which the device can be reached via the transport method. + // TransportAddress represents the address from which the network element can be reached via the transport method. TransportAddress string `json:"transport_address,omitempty" bson:"transport_address,omitempty"` // TransportUsername is used for authentication via the transport method in use. TransportUsername string `json:"transport_username,omitempty" bson:"transport_username,omitempty"` @@ -49,7 +49,7 @@ type LoadedDevice struct { TransportPassword string `json:"transport_password,omitempty" bson:"transport_password,omitempty"` TransportOptionCsbi bool `json:"transport_option_csbi,omitempty" bson:"transport_option_csbi,omitempty"` - // SBI indicates the southbound interface, which is used by this device as UUID. + // SBI indicates the southbound interface, which is used by this network element as UUID. SBI string `json:"sbi"` Model string `json:"model,omitempty" bson:"model,omitempty"` } diff --git a/controller/interfaces/networkelement/networkElementService.go b/controller/interfaces/networkelement/networkElementService.go new file mode 100644 index 0000000000000000000000000000000000000000..4d34937d1aaa7d9ae899aeb5cd532b995358648c --- /dev/null +++ b/controller/interfaces/networkelement/networkElementService.go @@ -0,0 +1,16 @@ +package networkelement + +import ( + "code.fbi.h-da.de/danet/gosdn/controller/store" +) + +// Service describes an interface for network element service implementations. +type Service interface { + Add(NetworkElement) error + Update(NetworkElement) error + UpdateModel(NetworkElement, string) error + Delete(NetworkElement) error + Get(store.Query) (NetworkElement, error) + GetAll() ([]NetworkElement, error) + GetAllAsLoaded() ([]LoadedNetworkElement, error) +} diff --git a/controller/interfaces/networkelement/networkElementStore.go b/controller/interfaces/networkelement/networkElementStore.go new file mode 100644 index 0000000000000000000000000000000000000000..e2a136105e3d817db19ff8eb6a21ff1f462b92c9 --- /dev/null +++ b/controller/interfaces/networkelement/networkElementStore.go @@ -0,0 +1,14 @@ +package networkelement + +import ( + "code.fbi.h-da.de/danet/gosdn/controller/store" +) + +// Store describes an interface for network element store implementations. +type Store interface { + Add(NetworkElement) error + Update(NetworkElement) error + Delete(NetworkElement) error + Get(store.Query) (LoadedNetworkElement, error) + GetAll() ([]LoadedNetworkElement, error) +} diff --git a/controller/interfaces/transport/transport.go b/controller/interfaces/transport/transport.go index 2be9f287f0aeb5b0a97fc26caf7a35261727f571..c5b969a1b041d06e2a9f949cd888bd0c11a76a91 100644 --- a/controller/interfaces/transport/transport.go +++ b/controller/interfaces/transport/transport.go @@ -29,7 +29,7 @@ type ( ) // SubscriptionInformation contains additional information used for internal subscriptions -// for distinguishing from which device the information is from, to stop subscriptions and +// for distinguishing from which network element the information is from, to stop subscriptions and // error handling. type SubscriptionInformation struct { PndID string diff --git a/controller/mocks/NetworkDomain.go b/controller/mocks/NetworkDomain.go index 6a770ba4bdb70b1d1da38d970671715e31c5d0c1..00b4f366239da660dbfeeed0092f0f15cfa8708a 100644 --- a/controller/mocks/NetworkDomain.go +++ b/controller/mocks/NetworkDomain.go @@ -4,10 +4,10 @@ package mocks import ( change "code.fbi.h-da.de/danet/gosdn/controller/interfaces/change" - device "code.fbi.h-da.de/danet/gosdn/controller/interfaces/device" - mock "github.com/stretchr/testify/mock" + networkelement "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkelement" + pnd "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/pnd" protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -24,8 +24,8 @@ type NetworkDomain struct { mock.Mock } -// AddDevice provides a mock function with given fields: name, opts, sid -func (_m *NetworkDomain) AddDevice(name string, opts *transport.TransportOption, sid uuid.UUID) (uuid.UUID, error) { +// AddNetworkElement provides a mock function with given fields: name, opts, sid +func (_m *NetworkDomain) AddNetworkElement(name string, opts *transport.TransportOption, sid uuid.UUID) (uuid.UUID, error) { ret := _m.Called(name, opts, sid) var r0 uuid.UUID @@ -61,8 +61,8 @@ func (_m *NetworkDomain) AddSbi(s southbound.SouthboundInterface) error { return r0 } -// ChangeOND provides a mock function with given fields: _a0, operation, path, value -func (_m *NetworkDomain) ChangeOND(_a0 uuid.UUID, operation pnd.ApiOperation, path string, value ...string) (uuid.UUID, error) { +// ChangeMNE provides a mock function with given fields: _a0, operation, path, value +func (_m *NetworkDomain) ChangeMNE(_a0 uuid.UUID, operation pnd.ApiOperation, path string, value ...string) (uuid.UUID, error) { _va := make([]interface{}, len(value)) for _i := range value { _va[_i] = value[_i] @@ -149,32 +149,16 @@ func (_m *NetworkDomain) Destroy() error { return r0 } -// Devices provides a mock function with given fields: -func (_m *NetworkDomain) Devices() []device.Device { - ret := _m.Called() - - var r0 []device.Device - if rf, ok := ret.Get(0).(func() []device.Device); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]device.Device) - } - } - - return r0 -} - -// FlattenedDevices provides a mock function with given fields: -func (_m *NetworkDomain) FlattenedDevices() []device.LoadedDevice { +// FlattenedNetworkElements provides a mock function with given fields: +func (_m *NetworkDomain) FlattenedNetworkElements() []networkelement.LoadedNetworkElement { ret := _m.Called() - var r0 []device.LoadedDevice - if rf, ok := ret.Get(0).(func() []device.LoadedDevice); ok { + var r0 []networkelement.LoadedNetworkElement + if rf, ok := ret.Get(0).(func() []networkelement.LoadedNetworkElement); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]device.LoadedDevice) + r0 = ret.Get(0).([]networkelement.LoadedNetworkElement) } } @@ -218,16 +202,30 @@ func (_m *NetworkDomain) GetDescription() string { return r0 } -// GetDevice provides a mock function with given fields: identifier -func (_m *NetworkDomain) GetDevice(identifier string) (device.Device, error) { +// GetName provides a mock function with given fields: +func (_m *NetworkDomain) GetName() string { + ret := _m.Called() + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// GetNetworkElement provides a mock function with given fields: identifier +func (_m *NetworkDomain) GetNetworkElement(identifier string) (networkelement.NetworkElement, error) { ret := _m.Called(identifier) - var r0 device.Device - if rf, ok := ret.Get(0).(func(string) device.Device); ok { + var r0 networkelement.NetworkElement + if rf, ok := ret.Get(0).(func(string) networkelement.NetworkElement); ok { r0 = rf(identifier) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(device.Device) + r0 = ret.Get(0).(networkelement.NetworkElement) } } @@ -241,20 +239,6 @@ func (_m *NetworkDomain) GetDevice(identifier string) (device.Device, error) { return r0, r1 } -// GetName provides a mock function with given fields: -func (_m *NetworkDomain) GetName() string { - ret := _m.Called() - - var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(string) - } - - return r0 -} - // GetSBI provides a mock function with given fields: _a0 func (_m *NetworkDomain) GetSBI(_a0 uuid.UUID) (southbound.SouthboundInterface, error) { ret := _m.Called(_a0) @@ -317,8 +301,8 @@ func (_m *NetworkDomain) ID() uuid.UUID { return r0 } -// MarshalDevice provides a mock function with given fields: _a0 -func (_m *NetworkDomain) MarshalDevice(_a0 string) (string, error) { +// MarshalNetworkElement provides a mock function with given fields: _a0 +func (_m *NetworkDomain) MarshalNetworkElement(_a0 string) (string, error) { ret := _m.Called(_a0) var r0 string @@ -338,6 +322,22 @@ func (_m *NetworkDomain) MarshalDevice(_a0 string) (string, error) { return r0, r1 } +// NetworkElements provides a mock function with given fields: +func (_m *NetworkDomain) NetworkElements() []networkelement.NetworkElement { + ret := _m.Called() + + var r0 []networkelement.NetworkElement + if rf, ok := ret.Get(0).(func() []networkelement.NetworkElement); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]networkelement.NetworkElement) + } + } + + return r0 +} + // PendingChanges provides a mock function with given fields: func (_m *NetworkDomain) PendingChanges() []uuid.UUID { ret := _m.Called() @@ -354,8 +354,8 @@ func (_m *NetworkDomain) PendingChanges() []uuid.UUID { return r0 } -// RemoveDevice provides a mock function with given fields: _a0 -func (_m *NetworkDomain) RemoveDevice(_a0 uuid.UUID) error { +// RemoveNetworkElement provides a mock function with given fields: _a0 +func (_m *NetworkDomain) RemoveNetworkElement(_a0 uuid.UUID) error { ret := _m.Called(_a0) var r0 error @@ -433,12 +433,12 @@ func (_m *NetworkDomain) SubscribePath(_a0 uuid.UUID, _a1 *pnd.SubscriptionList) return r0 } -// UpdateDevice provides a mock function with given fields: _a0, _a1 -func (_m *NetworkDomain) UpdateDevice(_a0 device.Device, _a1 string) error { +// UpdateNetworkElement provides a mock function with given fields: _a0, _a1 +func (_m *NetworkDomain) UpdateNetworkElement(_a0 networkelement.NetworkElement, _a1 string) error { ret := _m.Called(_a0, _a1) var r0 error - if rf, ok := ret.Get(0).(func(device.Device, string) error); ok { + if rf, ok := ret.Get(0).(func(networkelement.NetworkElement, string) error); ok { r0 = rf(_a0, _a1) } else { r0 = ret.Error(0) @@ -447,12 +447,12 @@ func (_m *NetworkDomain) UpdateDevice(_a0 device.Device, _a1 string) error { return r0 } -// UpdateDeviceAfterSubscribeResponse provides a mock function with given fields: _a0 -func (_m *NetworkDomain) UpdateDeviceAfterSubscribeResponse(_a0 device.Device) error { +// UpdateNetworkElementAfterSubscribeResponse provides a mock function with given fields: _a0 +func (_m *NetworkDomain) UpdateNetworkElementAfterSubscribeResponse(_a0 networkelement.NetworkElement) error { ret := _m.Called(_a0) var r0 error - if rf, ok := ret.Get(0).(func(device.Device) error); ok { + if rf, ok := ret.Get(0).(func(networkelement.NetworkElement) error); ok { r0 = rf(_a0) } else { r0 = ret.Error(0) diff --git a/controller/mocks/NetworkElement.go b/controller/mocks/NetworkElement.go new file mode 100644 index 0000000000000000000000000000000000000000..ce25e76b28ad19880adc31b9fa5a6cc8bb5be0af --- /dev/null +++ b/controller/mocks/NetworkElement.go @@ -0,0 +1,201 @@ +// Code generated by mockery v2.14.0. DO NOT EDIT. + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + + southbound "code.fbi.h-da.de/danet/gosdn/controller/interfaces/southbound" + + transport "code.fbi.h-da.de/danet/gosdn/controller/interfaces/transport" + + uuid "github.com/google/uuid" + + ygot "github.com/openconfig/ygot/ygot" +) + +// NetworkElement is an autogenerated mock type for the NetworkElement type +type NetworkElement struct { + mock.Mock +} + +// CreateModelCopy provides a mock function with given fields: +func (_m *NetworkElement) CreateModelCopy() (ygot.ValidatedGoStruct, error) { + ret := _m.Called() + + var r0 ygot.ValidatedGoStruct + if rf, ok := ret.Get(0).(func() ygot.ValidatedGoStruct); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(ygot.ValidatedGoStruct) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GetModel provides a mock function with given fields: +func (_m *NetworkElement) GetModel() ygot.GoStruct { + ret := _m.Called() + + var r0 ygot.GoStruct + if rf, ok := ret.Get(0).(func() ygot.GoStruct); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(ygot.GoStruct) + } + } + + return r0 +} + +// GetModelAsString provides a mock function with given fields: +func (_m *NetworkElement) GetModelAsString() (string, error) { + ret := _m.Called() + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + var r1 error + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// ID provides a mock function with given fields: +func (_m *NetworkElement) ID() uuid.UUID { + ret := _m.Called() + + var r0 uuid.UUID + if rf, ok := ret.Get(0).(func() uuid.UUID); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(uuid.UUID) + } + } + + return r0 +} + +// IsTransportValid provides a mock function with given fields: +func (_m *NetworkElement) IsTransportValid() bool { + ret := _m.Called() + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// Name provides a mock function with given fields: +func (_m *NetworkElement) Name() string { + ret := _m.Called() + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// ProcessResponse provides a mock function with given fields: _a0 +func (_m *NetworkElement) ProcessResponse(_a0 protoreflect.ProtoMessage) error { + ret := _m.Called(_a0) + + var r0 error + if rf, ok := ret.Get(0).(func(protoreflect.ProtoMessage) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// SBI provides a mock function with given fields: +func (_m *NetworkElement) SBI() southbound.SouthboundInterface { + ret := _m.Called() + + var r0 southbound.SouthboundInterface + if rf, ok := ret.Get(0).(func() southbound.SouthboundInterface); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(southbound.SouthboundInterface) + } + } + + return r0 +} + +// Transport provides a mock function with given fields: +func (_m *NetworkElement) Transport() transport.Transport { + ret := _m.Called() + + var r0 transport.Transport + if rf, ok := ret.Get(0).(func() transport.Transport); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(transport.Transport) + } + } + + return r0 +} + +// TransportAddress provides a mock function with given fields: +func (_m *NetworkElement) TransportAddress() string { + ret := _m.Called() + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +type mockConstructorTestingTNewNetworkElement interface { + mock.TestingT + Cleanup(func()) +} + +// NewNetworkElement creates a new instance of NetworkElement. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewNetworkElement(t mockConstructorTestingTNewNetworkElement) *NetworkElement { + mock := &NetworkElement{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/controller/mocks/PndStore.go b/controller/mocks/PndStore.go index 9081553cade0fe767c309789befab0de0ee901db..ba943d8d39cd5254621abf22e08fe6ced7530443 100644 --- a/controller/mocks/PndStore.go +++ b/controller/mocks/PndStore.go @@ -3,10 +3,9 @@ package mocks import ( - device "code.fbi.h-da.de/danet/gosdn/controller/interfaces/device" - mock "github.com/stretchr/testify/mock" - networkdomain "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkdomain" + networkelement "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkelement" + mock "github.com/stretchr/testify/mock" store "code.fbi.h-da.de/danet/gosdn/controller/store" @@ -33,7 +32,7 @@ func (_m *PndStore) Add(_a0 networkdomain.NetworkDomain) error { } // AddPendingChannel provides a mock function with given fields: id, ch -func (_m *PndStore) AddPendingChannel(id uuid.UUID, ch chan device.Details) { +func (_m *PndStore) AddPendingChannel(id uuid.UUID, ch chan networkelement.Details) { _m.Called(id, ch) } @@ -98,7 +97,7 @@ func (_m *PndStore) GetAll() ([]networkdomain.NetworkDomain, error) { } // PendingChannels provides a mock function with given fields: id, parseErrors -func (_m *PndStore) PendingChannels(id uuid.UUID, parseErrors ...error) (chan device.Details, error) { +func (_m *PndStore) PendingChannels(id uuid.UUID, parseErrors ...error) (chan networkelement.Details, error) { _va := make([]interface{}, len(parseErrors)) for _i := range parseErrors { _va[_i] = parseErrors[_i] @@ -108,12 +107,12 @@ func (_m *PndStore) PendingChannels(id uuid.UUID, parseErrors ...error) (chan de _ca = append(_ca, _va...) ret := _m.Called(_ca...) - var r0 chan device.Details - if rf, ok := ret.Get(0).(func(uuid.UUID, ...error) chan device.Details); ok { + var r0 chan networkelement.Details + if rf, ok := ret.Get(0).(func(uuid.UUID, ...error) chan networkelement.Details); ok { r0 = rf(id, parseErrors...) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(chan device.Details) + r0 = ret.Get(0).(chan networkelement.Details) } } diff --git a/controller/northbound/server/auth_interceptor_test.go b/controller/northbound/server/auth_interceptor_test.go index 023f9e0e48f0083f7a73964eb559453b88ff0b61..89d8169b545b6a06bff182d49dae5cc9210592dc 100644 --- a/controller/northbound/server/auth_interceptor_test.go +++ b/controller/northbound/server/auth_interceptor_test.go @@ -280,7 +280,7 @@ func TestAuthInterceptor_authorize(t *testing.T) { name: "error no permission for request", args: args{ ctx: metadata.NewIncomingContext(context.Background(), metadata.Pairs("authorize", validToken)), - method: "/gosdn.pnd.PndService/DeleteOnd", + method: "/gosdn.pnd.PndService/DeleteMne", }, wantErr: true, }, diff --git a/controller/northbound/server/core_test.go b/controller/northbound/server/core_test.go index 78941a2bccb49357ce9a277ff997311391b452f7..1b84b875fb2703ad07b31cee61046877db947819 100644 --- a/controller/northbound/server/core_test.go +++ b/controller/northbound/server/core_test.go @@ -38,12 +38,12 @@ func getTestCoreServer(t *testing.T) *CoreServer { t.Fatal(err) } - deviceUUID, err = uuid.Parse(ondID) + mneUUID, err = uuid.Parse(mneID) if err != nil { t.Fatal(err) } - mockDevice = &nucleus.CommonDevice{ + mockNetworkElement = &nucleus.CommonNetworkElement{ Model: &openconfig.Device{ System: &openconfig.OpenconfigSystem_System{ Config: &openconfig.OpenconfigSystem_System_Config{ @@ -52,18 +52,18 @@ func getTestCoreServer(t *testing.T) *CoreServer { }, }, }, - UUID: deviceUUID, + UUID: mneUUID, } sbi, err := nucleus.NewSBI(spb.Type_TYPE_OPENCONFIG, sbiUUID) if err != nil { t.Fatal(err) } - mockDevice.(*nucleus.CommonDevice).SetSBI(sbi) - mockDevice.(*nucleus.CommonDevice).SetTransport(&mocks.Transport{}) - mockDevice.(*nucleus.CommonDevice).SetName(hostname) + mockNetworkElement.(*nucleus.CommonNetworkElement).SetSBI(sbi) + mockNetworkElement.(*nucleus.CommonNetworkElement).SetTransport(&mocks.Transport{}) + mockNetworkElement.(*nucleus.CommonNetworkElement).SetName(hostname) sbiStore = nucleus.NewSbiStore(pndUUID) - if err := sbiStore.Add(mockDevice.SBI()); err != nil { + if err := sbiStore.Add(mockNetworkElement.SBI()); err != nil { t.Fatal(err) } @@ -76,16 +76,16 @@ func getTestCoreServer(t *testing.T) *CoreServer { mockPnd.On("GetName").Return("test") mockPnd.On("GetDescription").Return("test") mockPnd.On("GetSBIs").Return(sbiStore) - mockPnd.On("GetSBI", mock.Anything).Return(mockDevice.SBI(), nil) - mockPnd.On("Devices").Return([]uuid.UUID{deviceUUID}) + mockPnd.On("GetSBI", mock.Anything).Return(mockNetworkElement.SBI(), nil) + mockPnd.On("Devices").Return([]uuid.UUID{mneUUID}) mockPnd.On("PendingChanges").Return([]uuid.UUID{pendingChangeUUID}) mockPnd.On("CommittedChanges").Return([]uuid.UUID{committedChangeUUID}) mockPnd.On("GetChange", mock.Anything).Return(mockChange, nil) - mockPnd.On("AddDevice", mock.Anything, mock.Anything, mock.Anything).Return(nil) - mockPnd.On("GetDevice", mock.Anything).Return(mockDevice, nil) + mockPnd.On("AddNetworkElement", mock.Anything, mock.Anything, mock.Anything).Return(nil) + mockPnd.On("GetNetworkElement", mock.Anything).Return(mockNetworkElement, nil) mockPnd.On("Commit", mock.Anything).Return(nil) mockPnd.On("Confirm", mock.Anything).Return(nil) - mockPnd.On("ChangeOND", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(uuid.Nil, nil) + mockPnd.On("ChangeMNE", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(uuid.Nil, nil) mockPnd.On("Request", mock.Anything, mock.Anything).Return(nil, nil) pndStore := nucleus.NewMemoryPndStore() diff --git a/controller/northbound/server/csbi.go b/controller/northbound/server/csbi.go index 77cb9b7fb0becefcf2bac234c52ab8bc8b2cfe3b..803f1dc52b3a2f0199486430146927c30f61f49b 100644 --- a/controller/northbound/server/csbi.go +++ b/controller/northbound/server/csbi.go @@ -10,8 +10,8 @@ import ( log "github.com/sirupsen/logrus" cpb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/csbi" - "code.fbi.h-da.de/danet/gosdn/controller/interfaces/device" "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkdomain" + "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkelement" "code.fbi.h-da.de/danet/gosdn/controller/metrics" "code.fbi.h-da.de/danet/gosdn/controller/store" "google.golang.org/grpc/codes" @@ -51,7 +51,7 @@ func (s CsbiServer) Hello(ctx context.Context, syn *cpb.Syn) (*cpb.Ack, error) { log.Error(err) return nil, status.Errorf(codes.Aborted, "%v", err) } - ch <- device.Details{ + ch <- networkelement.Details{ ID: syn.Id, Address: net.JoinHostPort(csbiAddress, syn.Address), } diff --git a/controller/northbound/server/device.go b/controller/northbound/server/device.go deleted file mode 100644 index 0a283456f10d7f94e239d86d820bf2af04449c48..0000000000000000000000000000000000000000 --- a/controller/northbound/server/device.go +++ /dev/null @@ -1,133 +0,0 @@ -package server - -import ( - "context" - "time" - - dpb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/device" - "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkdomain" - "github.com/google/uuid" - log "github.com/sirupsen/logrus" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -// DeviceServer represents a deviceServer. -type DeviceServer struct { - dpb.UnimplementedDeviceServiceServer - networkDomain networkdomain.NetworkDomain -} - -// NewDeviceServer returns a new DeviceServer. -func NewDeviceServer(networkDomain networkdomain.NetworkDomain) *DeviceServer { - return &DeviceServer{ - networkDomain: networkDomain, - } -} - -// Add adds a new device. -func (d *DeviceServer) Add(ctx context.Context, request *dpb.AddDeviceRequest) (*dpb.AddDeviceResponse, error) { - sbiID, err := uuid.Parse(request.Device.Sbi.Id) - if err != nil { - return nil, status.Errorf(codes.Aborted, "%v", err) - } - - id, err := d.networkDomain.AddDevice( - request.Device.DeviceName, - request.Device.TransportOption, - sbiID, - ) - if err != nil { - return nil, status.Errorf(codes.Aborted, "%v", err) - } - - return &dpb.AddDeviceResponse{ - Timestamp: time.Now().UnixNano(), - Status: dpb.Status_STATUS_OK, - DeviceId: id.String(), - }, nil -} - -// GetAll returns all stored devices. -func (d *DeviceServer) GetAll(ctx context.Context, request *dpb.GetAllDeviceRequest) (*dpb.GetAllDeviceResponse, error) { - devices := d.networkDomain.Devices() - - onds := []*dpb.Device{} - for _, device := range devices { - ygotStructAsJSON, err := device.GetModelAsString() - if err != nil { - log.Error(err) - return nil, status.Errorf(codes.Aborted, "%v", err) - } - - onds = append(onds, &dpb.Device{ - Id: device.ID().String(), - Name: device.Name(), - Model: ygotStructAsJSON, - }) - } - - return &dpb.GetAllDeviceResponse{ - Timestamp: time.Now().UnixNano(), - Status: dpb.Status_STATUS_OK, - Device: onds, - }, nil -} - -// Get returns a device. -func (d *DeviceServer) Get(ctx context.Context, request *dpb.GetDeviceRequest) (*dpb.GetDeviceResponse, error) { - device, err := d.networkDomain.GetDevice(request.DeviceID) - if err != nil { - return nil, status.Errorf(codes.Aborted, "%v", err) - } - - ygotStructAsJSON, err := device.GetModelAsString() - if err != nil { - log.Error(err) - return nil, status.Errorf(codes.Aborted, "%v", err) - } - - ond := &dpb.Device{ - Id: device.ID().String(), - Name: device.Name(), - Model: ygotStructAsJSON, - TransportAddress: device.TransportAddress(), - } - - return &dpb.GetDeviceResponse{ - Timestamp: time.Now().UnixNano(), - Status: dpb.Status_STATUS_OK, - Device: ond, - }, nil -} - -// Update updates a device. -func (d *DeviceServer) Update(ctx context.Context, request *dpb.UpdateDeviceRequest) (*dpb.UpdateDeviceResponse, error) { - deviceID, err := uuid.Parse(request.Device.Id) - if err != nil { - return &dpb.UpdateDeviceResponse{ - Timestamp: time.Now().UnixNano(), - Status: dpb.Status_STATUS_OK, - }, err - } - device, err := d.networkDomain.GetDevice(deviceID.String()) - if err != nil { - return &dpb.UpdateDeviceResponse{ - Timestamp: time.Now().UnixNano(), - Status: dpb.Status_STATUS_OK, - }, err - } - - err = d.networkDomain.UpdateDevice(device, request.Device.Model) - if err != nil { - return &dpb.UpdateDeviceResponse{ - Timestamp: time.Now().UnixNano(), - Status: dpb.Status_STATUS_OK, - }, err - } - - return &dpb.UpdateDeviceResponse{ - Timestamp: time.Now().UnixNano(), - Status: dpb.Status_STATUS_OK, - }, nil -} diff --git a/controller/northbound/server/nbi.go b/controller/northbound/server/nbi.go index 38a42f9e39a09460ce9ae13d8c89bccb8972e854..a9314781ade93b3a30f465992236633c949001d1 100644 --- a/controller/northbound/server/nbi.go +++ b/controller/northbound/server/nbi.go @@ -20,17 +20,17 @@ import ( // NorthboundInterface is the representation of the // gRPC services used provided. type NorthboundInterface struct { - Pnd *PndServer - Core *CoreServer - Csbi *CsbiServer - Sbi *SbiServer - Auth *AuthServer - User *UserServer - Role *RoleServer - Topology *TopologyServer - App *AppServer - Device *DeviceServer - Routes *RoutingTableServiceServer + Pnd *PndServer + Core *CoreServer + Csbi *CsbiServer + Sbi *SbiServer + Auth *AuthServer + User *UserServer + Role *RoleServer + Topology *TopologyServer + App *AppServer + NetworkElement *NetworkElementServer + Routes *RoutingTableServiceServer } // NewNBI receives a PndStore and returns a new gRPC *NorthboundInterface. @@ -48,17 +48,17 @@ func NewNBI( ) *NorthboundInterface { return &NorthboundInterface{ - Pnd: NewPndServer(pnds), - Core: NewCoreServer(pnds), - Csbi: NewCsbiServer(pnds), - Sbi: NewSbiServer(pnds), - Auth: NewAuthServer(&jwt, users), - User: NewUserServer(&jwt, users), - Role: NewRoleServer(&jwt, roles), - Topology: NewTopologyServer(topologyService, nodeService, portService), - App: NewAppServer(apps), - Device: NewDeviceServer(networkDomain), - Routes: NewRoutingTableServiceServer(routeService, nodeService, portService), + Pnd: NewPndServer(pnds), + Core: NewCoreServer(pnds), + Csbi: NewCsbiServer(pnds), + Sbi: NewSbiServer(pnds), + Auth: NewAuthServer(&jwt, users), + User: NewUserServer(&jwt, users), + Role: NewRoleServer(&jwt, roles), + Topology: NewTopologyServer(topologyService, nodeService, portService), + App: NewAppServer(apps), + NetworkElement: NewNetworkElementServer(networkDomain), + Routes: NewRoutingTableServiceServer(routeService, nodeService, portService), } } diff --git a/controller/northbound/server/networkElement.go b/controller/northbound/server/networkElement.go new file mode 100644 index 0000000000000000000000000000000000000000..ebbb79d746e19817d3fb613d91a74ec70783bbf0 --- /dev/null +++ b/controller/northbound/server/networkElement.go @@ -0,0 +1,133 @@ +package server + +import ( + "context" + "time" + + mnepb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/networkelement" + "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkdomain" + "github.com/google/uuid" + log "github.com/sirupsen/logrus" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +// NetworkElementServer represents a NetworkElementServer. +type NetworkElementServer struct { + mnepb.UnimplementedNetworkElementServiceServer + networkDomain networkdomain.NetworkDomain +} + +// NewNetworkElementServer returns a new NetWorkElementServer. +func NewNetworkElementServer(networkDomain networkdomain.NetworkDomain) *NetworkElementServer { + return &NetworkElementServer{ + networkDomain: networkDomain, + } +} + +// Add adds a new network element. +func (s *NetworkElementServer) Add(ctx context.Context, request *mnepb.AddNetworkElementRequest) (*mnepb.AddNetworkElementResponse, error) { + sbiID, err := uuid.Parse(request.NetworkElement.Sbi.Id) + if err != nil { + return nil, status.Errorf(codes.Aborted, "%v", err) + } + + id, err := s.networkDomain.AddNetworkElement( + request.NetworkElement.NetworkElementName, + request.NetworkElement.TransportOption, + sbiID, + ) + if err != nil { + return nil, status.Errorf(codes.Aborted, "%v", err) + } + + return &mnepb.AddNetworkElementResponse{ + Timestamp: time.Now().UnixNano(), + Status: mnepb.Status_STATUS_OK, + NetworkElementId: id.String(), + }, nil +} + +// GetAll returns all stored network elements. +func (s *NetworkElementServer) GetAll(ctx context.Context, request *mnepb.GetAllNetworkElementRequest) (*mnepb.GetAllNetworkElementResponse, error) { + networkElements := s.networkDomain.NetworkElements() + + mnes := []*mnepb.NetworkElement{} + for _, mne := range networkElements { + ygotStructAsJSON, err := mne.GetModelAsString() + if err != nil { + log.Error(err) + return nil, status.Errorf(codes.Aborted, "%v", err) + } + + mnes = append(mnes, &mnepb.NetworkElement{ + Id: mne.ID().String(), + Name: mne.Name(), + Model: ygotStructAsJSON, + }) + } + + return &mnepb.GetAllNetworkElementResponse{ + Timestamp: time.Now().UnixNano(), + Status: mnepb.Status_STATUS_OK, + NetworkElement: mnes, + }, nil +} + +// Get returns a network element. +func (s *NetworkElementServer) Get(ctx context.Context, request *mnepb.GetNetworkElementRequest) (*mnepb.GetNetworkElementResponse, error) { + mne, err := s.networkDomain.GetNetworkElement(request.NetworkElementId) + if err != nil { + return nil, status.Errorf(codes.Aborted, "%v", err) + } + + ygotStructAsJSON, err := mne.GetModelAsString() + if err != nil { + log.Error(err) + return nil, status.Errorf(codes.Aborted, "%v", err) + } + + networkElement := &mnepb.NetworkElement{ + Id: mne.ID().String(), + Name: mne.Name(), + Model: ygotStructAsJSON, + TransportAddress: mne.TransportAddress(), + } + + return &mnepb.GetNetworkElementResponse{ + Timestamp: time.Now().UnixNano(), + Status: mnepb.Status_STATUS_OK, + NetworkElement: networkElement, + }, nil +} + +// Update updates a network element. +func (s *NetworkElementServer) Update(ctx context.Context, request *mnepb.UpdateNetworkElementRequest) (*mnepb.UpdateNetworkElementResponse, error) { + mneID, err := uuid.Parse(request.NetworkElement.Id) + if err != nil { + return &mnepb.UpdateNetworkElementResponse{ + Timestamp: time.Now().UnixNano(), + Status: mnepb.Status_STATUS_OK, + }, err + } + mne, err := s.networkDomain.GetNetworkElement(mneID.String()) + if err != nil { + return &mnepb.UpdateNetworkElementResponse{ + Timestamp: time.Now().UnixNano(), + Status: mnepb.Status_STATUS_OK, + }, err + } + + err = s.networkDomain.UpdateNetworkElement(mne, request.NetworkElement.Model) + if err != nil { + return &mnepb.UpdateNetworkElementResponse{ + Timestamp: time.Now().UnixNano(), + Status: mnepb.Status_STATUS_OK, + }, err + } + + return &mnepb.UpdateNetworkElementResponse{ + Timestamp: time.Now().UnixNano(), + Status: mnepb.Status_STATUS_OK, + }, nil +} diff --git a/controller/northbound/server/pnd.go b/controller/northbound/server/pnd.go index 8020c8b5e740ce25bfe543e4089152c20128aaa6..989f5f15ff53a2cf3af5aba11d1d4a4d2ac6c790 100644 --- a/controller/northbound/server/pnd.go +++ b/controller/northbound/server/pnd.go @@ -8,8 +8,8 @@ import ( ppb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/pnd" spb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/southbound" "code.fbi.h-da.de/danet/gosdn/controller/customerrs" - "code.fbi.h-da.de/danet/gosdn/controller/interfaces/device" "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkdomain" + "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkelement" "code.fbi.h-da.de/danet/gosdn/controller/metrics" "code.fbi.h-da.de/danet/gosdn/controller/nucleus" "code.fbi.h-da.de/danet/gosdn/controller/store" @@ -36,8 +36,8 @@ func NewPndServer(pndStore networkdomain.PndStore) *PndServer { } } -// GetOnd gets a specific ond. -func (p PndServer) GetOnd(ctx context.Context, request *ppb.GetOndRequest) (*ppb.GetOndResponse, error) { +// GetMne gets a specific mne. +func (p PndServer) GetMne(ctx context.Context, request *ppb.GetMneRequest) (*ppb.GetMneResponse, error) { labels := prometheus.Labels{"service": "pnd", "rpc": "get"} start := metrics.StartHook(labels, grpcRequestsTotal) defer metrics.FinishHook(labels, start, grpcRequestDurationSecondsTotal, grpcRequestDurationSeconds) @@ -52,31 +52,31 @@ func (p PndServer) GetOnd(ctx context.Context, request *ppb.GetOndRequest) (*ppb return nil, status.Errorf(codes.Aborted, "%v", err) } - device, err := pnd.GetDevice(request.Did) + networkElement, err := pnd.GetNetworkElement(request.Mneid) if err != nil { log.Error(err) return nil, status.Errorf(codes.Aborted, "%v", err) } - ond, err := fillOndBySpecificPath(device, "/") + mne, err := fillMneBySpecificPath(networkElement, "/") if err != nil { log.Error(err) return nil, status.Errorf(codes.Aborted, "%v", err) } - return &ppb.GetOndResponse{ + return &ppb.GetMneResponse{ Timestamp: time.Now().UnixNano(), Pnd: &ppb.PrincipalNetworkDomain{ Id: pnd.ID().String(), Name: pnd.GetName(), Description: pnd.GetDescription(), }, - Ond: ond, + Mne: mne, }, nil } -// GetOndList returns a list of existing onds. -func (p PndServer) GetOndList(ctx context.Context, request *ppb.GetOndListRequest) (*ppb.GetOndListResponse, error) { +// GetMneList returns a list of existing mnes. +func (p PndServer) GetMneList(ctx context.Context, request *ppb.GetMneListRequest) (*ppb.GetMneListResponse, error) { labels := prometheus.Labels{"service": "pnd", "rpc": "get"} start := metrics.StartHook(labels, grpcRequestsTotal) defer metrics.FinishHook(labels, start, grpcRequestDurationSecondsTotal, grpcRequestDurationSeconds) @@ -91,29 +91,29 @@ func (p PndServer) GetOndList(ctx context.Context, request *ppb.GetOndListReques return nil, status.Errorf(codes.Aborted, "%v", err) } - onds := make([]*ppb.OrchestratedNetworkingDevice, len(pnd.Devices())) - for i, device := range pnd.Devices() { - ond, err := fillOndBySpecificPath(device, "/") + mnes := make([]*ppb.ManagedNetworkElement, len(pnd.NetworkElements())) + for i, networkElement := range pnd.NetworkElements() { + mne, err := fillMneBySpecificPath(networkElement, "/") if err != nil { log.Error(err) return nil, status.Errorf(codes.Aborted, "%v", err) } - onds[i] = ond + mnes[i] = mne } - return &ppb.GetOndListResponse{ + return &ppb.GetMneListResponse{ Timestamp: time.Now().UnixNano(), Pnd: &ppb.PrincipalNetworkDomain{ Id: pnd.ID().String(), Name: pnd.GetName(), Description: pnd.GetDescription(), }, - Ond: onds, + Mne: mnes, }, nil } -// GetFlattenedOndList returns a list of existing onds. -func (p PndServer) GetFlattenedOndList(ctx context.Context, request *ppb.GetOndListRequest) (*ppb.GetFlattenedOndListResponse, error) { +// GetFlattenedMneList returns a list of existing mnes. +func (p PndServer) GetFlattenedMneList(ctx context.Context, request *ppb.GetMneListRequest) (*ppb.GetFlattenedMneListResponse, error) { labels := prometheus.Labels{"service": "pnd", "rpc": "get"} start := metrics.StartHook(labels, grpcRequestsTotal) defer metrics.FinishHook(labels, start, grpcRequestDurationSecondsTotal, grpcRequestDurationSeconds) @@ -128,30 +128,30 @@ func (p PndServer) GetFlattenedOndList(ctx context.Context, request *ppb.GetOndL return nil, status.Errorf(codes.Aborted, "%v", err) } - onds := pnd.FlattenedDevices() - flattenedOnds := make([]*ppb.FlattenedOrchestratedNetworkingDevice, len(onds)) - for i, ond := range onds { - ond := &ppb.FlattenedOrchestratedNetworkingDevice{ + mnes := pnd.FlattenedNetworkElements() + flattenedMnes := make([]*ppb.FlattenedManagedNetworkElement, len(mnes)) + for i, mne := range mnes { + mne := &ppb.FlattenedManagedNetworkElement{ - Id: ond.ID, - Name: ond.Name, - Sbi: ond.SBI, + Id: mne.ID, + Name: mne.Name, + Sbi: mne.SBI, } - flattenedOnds[i] = ond + flattenedMnes[i] = mne } - return &ppb.GetFlattenedOndListResponse{ + return &ppb.GetFlattenedMneListResponse{ Timestamp: time.Now().UnixNano(), Pnd: &ppb.PrincipalNetworkDomain{ Id: pnd.ID().String(), Name: pnd.GetName(), Description: pnd.GetDescription(), }, - Ond: flattenedOnds, + Mne: flattenedMnes, }, nil } -func fillOndBySpecificPath(d device.Device, path string) (*ppb.OrchestratedNetworkingDevice, error) { +func fillMneBySpecificPath(nme networkelement.NetworkElement, path string) (*ppb.ManagedNetworkElement, error) { gnmiPath, err := ygot.StringToStructuredPath(path) if err != nil { log.Error(err) @@ -162,37 +162,37 @@ func fillOndBySpecificPath(d device.Device, path string) (*ppb.OrchestratedNetwo &ytypes.GetHandleWildcards{}, &ytypes.GetPartialKeyMatch{}, } - nodes, err := ytypes.GetNode(d.SBI().Schema().RootSchema(), d.GetModel(), gnmiPath, opts...) + nodes, err := ytypes.GetNode(nme.SBI().Schema().RootSchema(), nme.GetModel(), gnmiPath, opts...) if err != nil { log.Error(err) return nil, status.Errorf(codes.Aborted, "%v", err) } - devices := make([]*gnmi.Notification, len(nodes)) + notifications := make([]*gnmi.Notification, len(nodes)) for i, node := range nodes { - dev, err := genGnmiNotification(gnmiPath, node.Data) + mneNotification, err := genGnmiNotification(gnmiPath, node.Data) if err != nil { log.Error(err) return nil, status.Errorf(codes.Aborted, "%v", err) } - devices[i] = dev + notifications[i] = mneNotification } sbi := spb.SouthboundInterface{} - if d.SBI() != nil { - sbi.Id = d.SBI().ID().String() - sbi.Type = d.SBI().Type() + if nme.SBI() != nil { + sbi.Id = nme.SBI().ID().String() + sbi.Type = nme.SBI().Type() } - ond := &ppb.OrchestratedNetworkingDevice{ - Id: d.ID().String(), - Name: d.Name(), - Device: devices, - Sbi: &sbi, + mne := &ppb.ManagedNetworkElement{ + Id: nme.ID().String(), + Name: nme.Name(), + MneNotification: notifications, + Sbi: &sbi, } - return ond, nil + return mne, nil } func genGnmiNotification(path *gnmi.Path, val any) (*gnmi.Notification, error) { @@ -314,7 +314,7 @@ func stringArrayToUUIDs(sid []string) ([]uuid.UUID, error) { return UUIDs, nil } -// GetPath gets a path on a ond. +// GetPath gets a path on a mne. func (p PndServer) GetPath(ctx context.Context, request *ppb.GetPathRequest) (*ppb.GetPathResponse, error) { labels := prometheus.Labels{"service": "pnd", "rpc": "get"} start := metrics.StartHook(labels, grpcRequestsTotal) @@ -330,12 +330,12 @@ func (p PndServer) GetPath(ctx context.Context, request *ppb.GetPathRequest) (*p return nil, status.Errorf(codes.Aborted, "%v", err) } - device, err := pnd.GetDevice(request.Did) + networkElement, err := pnd.GetNetworkElement(request.Mneid) if err != nil { log.Error(err) return nil, status.Errorf(codes.Aborted, "%v", err) } - duid, err := uuid.Parse(request.Did) + mneuid, err := uuid.Parse(request.Mneid) if err != nil { log.Error(err) return nil, status.Errorf(codes.Aborted, "%v", err) @@ -344,13 +344,13 @@ func (p PndServer) GetPath(ctx context.Context, request *ppb.GetPathRequest) (*p // In case we get the path from grpc-gateway we have to replace path := strings.ReplaceAll(request.Path, "||", "/") - _, err = pnd.Request(duid, path) + _, err = pnd.Request(mneuid, path) if err != nil { log.Error(err) return nil, status.Errorf(codes.Aborted, "%v", err) } - ond, err := fillOndBySpecificPath(device, path) + mne, err := fillMneBySpecificPath(networkElement, path) if err != nil { log.Error(err) return nil, status.Errorf(codes.Aborted, "%v", err) @@ -363,11 +363,11 @@ func (p PndServer) GetPath(ctx context.Context, request *ppb.GetPathRequest) (*p Name: pnd.GetName(), Description: pnd.GetDescription(), }, - Device: ond.Device, + MneNotification: mne.MneNotification, }, nil } -// GetChange gets a specific change of a ond. +// GetChange gets a specific change of a mne. func (p PndServer) GetChange(ctx context.Context, request *ppb.GetChangeRequest) (*ppb.GetChangeResponse, error) { labels := prometheus.Labels{"service": "pnd", "rpc": "get"} start := metrics.StartHook(labels, grpcRequestsTotal) @@ -441,7 +441,7 @@ func fillChanges(pnd networkdomain.NetworkDomain, all bool, cuid ...string) ([]* if len(cuid) == 0 { return nil, &customerrs.InvalidParametersError{ Func: fillChanges, - Param: "length of 'did' cannot be '0' when 'all' is set to 'false'", + Param: "length of 'mneID' cannot be '0' when 'all' is set to 'false'", } } changeList, err = stringArrayToUUIDs(cuid) @@ -475,8 +475,8 @@ func fillChanges(pnd networkdomain.NetworkDomain, all bool, cuid ...string) ([]* return changes, nil } -// SetOndList updates the list of onds. -func (p PndServer) SetOndList(ctx context.Context, request *ppb.SetOndListRequest) (*ppb.SetOndListResponse, error) { +// SetMneList updates the list of mnes. +func (p PndServer) SetMneList(ctx context.Context, request *ppb.SetMneListRequest) (*ppb.SetMneListResponse, error) { labels := prometheus.Labels{"service": "pnd", "rpc": "set"} start := metrics.StartHook(labels, grpcRequestsTotal) defer metrics.FinishHook(labels, start, grpcRequestDurationSecondsTotal, grpcRequestDurationSeconds) @@ -490,27 +490,27 @@ func (p PndServer) SetOndList(ctx context.Context, request *ppb.SetOndListReques return nil, handleRPCError(labels, err) } - deviceIDs := make([]uuid.UUID, 0, len(request.Ond)) - for _, r := range request.Ond { + networkElementIDs := make([]uuid.UUID, 0, len(request.Mne)) + for _, r := range request.Mne { sid, err := uuid.Parse(r.Sbi.Id) if err != nil { log.Error(err) return nil, status.Errorf(codes.Aborted, "%v", err) } - did, err := pnd.AddDevice(r.DeviceName, r.TransportOption, sid) + mneID, err := pnd.AddNetworkElement(r.MneName, r.TransportOption, sid) if err != nil { log.Error(err) return nil, status.Errorf(codes.Aborted, "%v", err) } - deviceIDs = append(deviceIDs, did) + networkElementIDs = append(networkElementIDs, mneID) } - r := make([]*ppb.SetResponse, len(deviceIDs)) - for i, did := range deviceIDs { - r[i] = &ppb.SetResponse{Id: did.String(), Status: ppb.Status_STATUS_OK} + r := make([]*ppb.SetResponse, len(networkElementIDs)) + for i, mneID := range networkElementIDs { + r[i] = &ppb.SetResponse{Id: mneID.String(), Status: ppb.Status_STATUS_OK} } - return &ppb.SetOndListResponse{ + return &ppb.SetMneListResponse{ Timestamp: time.Now().UnixNano(), Status: ppb.Status_STATUS_OK, Responses: r, @@ -587,12 +587,12 @@ func (p PndServer) SetPathList(ctx context.Context, request *ppb.SetPathListRequ responses := make([]*ppb.SetResponse, len(request.ChangeRequest)) for i, r := range request.ChangeRequest { - did, err := uuid.Parse(r.Did) + mneID, err := uuid.Parse(r.Mneid) if err != nil { log.Error(err) return nil, status.Errorf(codes.Aborted, "%v", err) } - cid, err := pnd.ChangeOND(did, r.ApiOp, r.Path, r.Value) + cid, err := pnd.ChangeMNE(mneID, r.ApiOp, r.Path, r.Value) if err != nil { log.Error(err) return nil, status.Errorf(codes.Aborted, "%v", err) @@ -666,8 +666,8 @@ func filterSbiType(sbiType ppb.SbiType) spb.Type { return spbType } -// DeleteOnd deletes a ond. -func (p PndServer) DeleteOnd(ctx context.Context, request *ppb.DeleteOndRequest) (*ppb.DeleteOndResponse, error) { +// DeleteMne deletes a mne. +func (p PndServer) DeleteMne(ctx context.Context, request *ppb.DeleteMneRequest) (*ppb.DeleteMneResponse, error) { pid, err := uuid.Parse(request.Pid) if err != nil { log.Error(err) @@ -679,22 +679,22 @@ func (p PndServer) DeleteOnd(ctx context.Context, request *ppb.DeleteOndRequest) return nil, status.Errorf(codes.Aborted, "%v", err) } - did, err := uuid.Parse(request.Did) + mneID, err := uuid.Parse(request.Mneid) if err != nil { log.Error(err) return nil, status.Errorf(codes.Aborted, "%v", err) } - if err := pnd.RemoveDevice(did); err != nil { + if err := pnd.RemoveNetworkElement(mneID); err != nil { log.Error(err) return nil, status.Errorf(codes.Aborted, "%v", err) } - return &ppb.DeleteOndResponse{ + return &ppb.DeleteMneResponse{ Timestamp: time.Now().UnixNano(), Status: ppb.Status_STATUS_OK, }, nil } -// SubscribePath subscribes to specifc paths of an ond. +// SubscribePath subscribes to specifc paths of an mne. func (p PndServer) SubscribePath(request *ppb.SubscribePathRequest, stream ppb.PndService_SubscribePathServer) error { pid, err := uuid.Parse(request.Pid) if err != nil { @@ -706,12 +706,12 @@ func (p PndServer) SubscribePath(request *ppb.SubscribePathRequest, stream ppb.P return err } - did, err := uuid.Parse(request.Did) + mneID, err := uuid.Parse(request.Mneid) if err != nil { return err } - if err := pnd.SubscribePath(did, request.Sublist); err != nil { + if err := pnd.SubscribePath(mneID, request.Sublist); err != nil { return err } diff --git a/controller/northbound/server/pnd_test.go b/controller/northbound/server/pnd_test.go index 523753b15d9ddcd404661f63668831e0d1d621bc..f5f15f0cb857a29d84d08288c58a763bff0617d2 100644 --- a/controller/northbound/server/pnd_test.go +++ b/controller/northbound/server/pnd_test.go @@ -40,12 +40,12 @@ func getTestPndServer(t *testing.T) *PndServer { t.Fatal(err) } - deviceUUID, err = uuid.Parse(ondID) + mneUUID, err = uuid.Parse(mneID) if err != nil { t.Fatal(err) } - mockDevice = &nucleus.CommonDevice{ + mockNetworkElement = &nucleus.CommonNetworkElement{ Model: &openconfig.Device{ System: &openconfig.OpenconfigSystem_System{ Config: &openconfig.OpenconfigSystem_System_Config{ @@ -54,18 +54,18 @@ func getTestPndServer(t *testing.T) *PndServer { }, }, }, - UUID: deviceUUID, + UUID: mneUUID, } sbi, err := nucleus.NewSBI(spb.Type_TYPE_OPENCONFIG, sbiUUID) if err != nil { t.Fatal(err) } - mockDevice.(*nucleus.CommonDevice).SetSBI(sbi) - mockDevice.(*nucleus.CommonDevice).SetTransport(&mocks.Transport{}) - mockDevice.(*nucleus.CommonDevice).SetName(hostname) + mockNetworkElement.(*nucleus.CommonNetworkElement).SetSBI(sbi) + mockNetworkElement.(*nucleus.CommonNetworkElement).SetTransport(&mocks.Transport{}) + mockNetworkElement.(*nucleus.CommonNetworkElement).SetName(hostname) sbiStore = nucleus.NewSbiStore(pndUUID) - if err := sbiStore.Add(mockDevice.SBI()); err != nil { + if err := sbiStore.Add(mockNetworkElement.SBI()); err != nil { t.Fatal(err) } @@ -78,16 +78,16 @@ func getTestPndServer(t *testing.T) *PndServer { mockPnd.On("GetName").Return("test") mockPnd.On("GetDescription").Return("test") mockPnd.On("GetSBIs").Return(sbiStore) - mockPnd.On("GetSBI", mock.Anything).Return(mockDevice.SBI(), nil) - mockPnd.On("Devices").Return([]uuid.UUID{deviceUUID}) + mockPnd.On("GetSBI", mock.Anything).Return(mockNetworkElement.SBI(), nil) + mockPnd.On("NetworkElements").Return([]uuid.UUID{mneUUID}) mockPnd.On("PendingChanges").Return([]uuid.UUID{pendingChangeUUID}) mockPnd.On("CommittedChanges").Return([]uuid.UUID{committedChangeUUID}) mockPnd.On("GetChange", mock.Anything).Return(mockChange, nil) - mockPnd.On("AddDevice", mock.Anything, mock.Anything, mock.Anything).Return(nil) - mockPnd.On("GetDevice", mock.Anything).Return(mockDevice, nil) + mockPnd.On("AddNetworkElement", mock.Anything, mock.Anything, mock.Anything).Return(nil) + mockPnd.On("GetNetworkElement", mock.Anything).Return(mockNetworkElement, nil) mockPnd.On("Commit", mock.Anything).Return(nil) mockPnd.On("Confirm", mock.Anything).Return(nil) - mockPnd.On("ChangeOND", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(uuid.Nil, nil) + mockPnd.On("ChangeMNE", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(uuid.Nil, nil) mockPnd.On("Request", mock.Anything, mock.Anything).Return(nil, nil) pndStore := nucleus.NewMemoryPndStore() @@ -128,7 +128,7 @@ func Test_pnd_GetPath(t *testing.T) { ctx: context.Background(), request: &ppb.GetPathRequest{ Timestamp: time.Now().UnixNano(), - Did: deviceUUID.String(), + Mneid: mneUUID.String(), Path: "system/config/hostname", Pid: pndUUID.String(), }, @@ -166,7 +166,7 @@ func Test_pnd_GetPath(t *testing.T) { ctx: context.Background(), request: &ppb.GetPathRequest{ Timestamp: time.Now().UnixNano(), - Did: deviceUUID.String(), + Mneid: mneUUID.String(), Path: "system", Pid: pndUUID.String(), }, @@ -198,7 +198,7 @@ func Test_pnd_GetPath(t *testing.T) { ctx: context.Background(), request: &ppb.GetPathRequest{ Timestamp: time.Now().UnixNano(), - Did: deviceUUID.String(), + Mneid: mneUUID.String(), Path: "this/path/is/not/valid", Pid: pndUUID.String(), }, @@ -216,7 +216,7 @@ func Test_pnd_GetPath(t *testing.T) { return } - got := resp.GetDevice() + got := resp.GetMneNotification() for i, n := range got { if diff := cmp.Diff(n.GetUpdate(), tt.want[i].GetUpdate(), opts...); diff != "" { @@ -239,11 +239,11 @@ func Test_pnd_Set(t *testing.T) { // wantErr bool // }{ // { - // name: "set ond", + // name: "set mne", // args: args{ // ctx: context.Background(), // request: &ppb.SetRequest{ - // Ond: []*ppb.SetOnd{ + // Mne: []*ppb.SetMne{ // { // Sbi: &spb.SouthboundInterface{ // Id: sbiID, @@ -293,19 +293,19 @@ func Test_pnd_Set(t *testing.T) { // // Pid: pndID, // // ChangeRequest: []*ppb.ChangeRequest{ // // { - // // Id: ondID, + // // Id: mneID, // // Path: "/system/config/hostname", // // Value: "herbert", // // ApiOp: ppb.ApiOperation_UPDATE, // // }, // // { - // // Id: ondID, + // // Id: mneID, // // Path: "/system/config/hostname", // // Value: "fridolin", // // ApiOp: ppb.ApiOperation_REPLACE, // // }, // // { - // // Id: ondID, + // // Id: mneID, // // Path: "/system/config/hostname", // // ApiOp: ppb.ApiOperation_DELETE, // // }, diff --git a/controller/northbound/server/test_util_test.go b/controller/northbound/server/test_util_test.go index fea44b5cfb7239515eaa897930355aaa62e30019..4a4202e0470fea150b8ad3aa74f3cb28f022c2ea 100644 --- a/controller/northbound/server/test_util_test.go +++ b/controller/northbound/server/test_util_test.go @@ -7,8 +7,8 @@ import ( "testing" spb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/southbound" - "code.fbi.h-da.de/danet/gosdn/controller/interfaces/device" "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkdomain" + "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkelement" rbacInterfaces "code.fbi.h-da.de/danet/gosdn/controller/interfaces/rbac" "code.fbi.h-da.de/danet/gosdn/controller/interfaces/southbound" "code.fbi.h-da.de/danet/gosdn/controller/mocks" @@ -27,7 +27,7 @@ const pndID = "2043519e-46d1-4963-9a8e-d99007e104b8" const pendingChangeID = "0992d600-f7d4-4906-9559-409b04d59a5f" const committedChangeID = "804787d6-e5a8-4dba-a1e6-e73f96b0119e" const sbiID = "f6fd4b35-f039-4111-9156-5e4501bb8a5a" -const ondID = "7e0ed8cc-ebf5-46fa-9794-741494914883" +const mneID = "7e0ed8cc-ebf5-46fa-9794-741494914883" var hostname = "manfred" var domainname = "uwe" @@ -35,9 +35,9 @@ var pndUUID uuid.UUID var sbiUUID uuid.UUID var pendingChangeUUID uuid.UUID var committedChangeUUID uuid.UUID -var deviceUUID uuid.UUID +var mneUUID uuid.UUID var mockPnd *mocks.NetworkDomain -var mockDevice device.Device +var mockNetworkElement networkelement.NetworkElement var sbiStore southbound.Store // Name of this file requires _test at the end, because of how the availability of varibales is handled in test files of go packages. @@ -206,7 +206,7 @@ func createHashedAndSaltedPassword(plainPWD, salt string) string { } func getMockPnd(t *testing.T) networkdomain.NetworkDomain { - mockDevice = &nucleus.CommonDevice{ + mockNetworkElement = &nucleus.CommonNetworkElement{ Model: &openconfig.Device{ System: &openconfig.OpenconfigSystem_System{ Config: &openconfig.OpenconfigSystem_System_Config{ @@ -215,18 +215,18 @@ func getMockPnd(t *testing.T) networkdomain.NetworkDomain { }, }, }, - UUID: deviceUUID, + UUID: mneUUID, } sbi, err := nucleus.NewSBI(spb.Type_TYPE_OPENCONFIG, sbiUUID) if err != nil { t.Fatal(err) } - mockDevice.(*nucleus.CommonDevice).SetSBI(sbi) - mockDevice.(*nucleus.CommonDevice).SetTransport(&mocks.Transport{}) - mockDevice.(*nucleus.CommonDevice).SetName(hostname) + mockNetworkElement.(*nucleus.CommonNetworkElement).SetSBI(sbi) + mockNetworkElement.(*nucleus.CommonNetworkElement).SetTransport(&mocks.Transport{}) + mockNetworkElement.(*nucleus.CommonNetworkElement).SetName(hostname) sbiStore = nucleus.NewSbiStore(pndUUID) - if err := sbiStore.Add(mockDevice.SBI()); err != nil { + if err := sbiStore.Add(mockNetworkElement.SBI()); err != nil { t.Fatal(err) } @@ -235,15 +235,15 @@ func getMockPnd(t *testing.T) networkdomain.NetworkDomain { mockPnd.On("GetName").Return("test") mockPnd.On("GetDescription").Return("test") mockPnd.On("GetSBIs").Return(sbiStore) - mockPnd.On("GetSBI", mock.Anything).Return(mockDevice.SBI(), nil) - mockPnd.On("Devices").Return([]uuid.UUID{deviceUUID}) + mockPnd.On("GetSBI", mock.Anything).Return(mockNetworkElement.SBI(), nil) + mockPnd.On("NetworkElements").Return([]uuid.UUID{mneUUID}) mockPnd.On("PendingChanges").Return([]uuid.UUID{pendingChangeUUID}) mockPnd.On("CommittedChanges").Return([]uuid.UUID{committedChangeUUID}) - mockPnd.On("AddDevice", mock.Anything, mock.Anything, mock.Anything).Return(nil) - mockPnd.On("GetDevice", mock.Anything).Return(mockDevice, nil) + mockPnd.On("AddNetworkElement", mock.Anything, mock.Anything, mock.Anything).Return(nil) + mockPnd.On("GetNetworkElement", mock.Anything).Return(mockNetworkElement, nil) mockPnd.On("Commit", mock.Anything).Return(nil) mockPnd.On("Confirm", mock.Anything).Return(nil) - mockPnd.On("ChangeOND", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(uuid.Nil, nil) + mockPnd.On("ChangeMNE", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(uuid.Nil, nil) mockPnd.On("Request", mock.Anything, mock.Anything).Return(nil, nil) return mockPnd @@ -271,7 +271,7 @@ func initUUIDs(t *testing.T) { t.Fatal(err) } - deviceUUID, err = uuid.Parse(ondID) + mneUUID, err = uuid.Parse(mneID) if err != nil { t.Fatal(err) } diff --git a/controller/nucleus/change.go b/controller/nucleus/change.go index feae600c8cbfd8b5e5b951e625f1ee1f0d9d3f64..40d09e694c20a99b39824d6bf4691659c9eef7b1 100644 --- a/controller/nucleus/change.go +++ b/controller/nucleus/change.go @@ -34,10 +34,10 @@ func init() { // a callback function, and returns a *Change. // The callback function is used by the Commit() and Confirm() functions. It // must define how the change is carried out. -func NewChange(device uuid.UUID, currentState ygot.GoStruct, change ygot.GoStruct, callback func(ygot.GoStruct, ygot.GoStruct) error) *Change { +func NewChange(mne uuid.UUID, currentState ygot.GoStruct, change ygot.GoStruct, callback func(ygot.GoStruct, ygot.GoStruct) error) *Change { c := &Change{ cuid: uuid.New(), - duid: device, + duid: mne, state: ppb.ChangeState_CHANGE_STATE_PENDING, timestamp: time.Now(), previousState: currentState, @@ -53,10 +53,10 @@ func NewChange(device uuid.UUID, currentState ygot.GoStruct, change ygot.GoStruc return c } -// Change is an intended change to an OND. It is unique and immutable. +// Change is an intended change to an MNE. It is unique and immutable. // It has a cuid, a timestamp, and holds both the previous and the new // state. It keeps track if the state is committed and confirmed. A callback -// exists to acess the proper transport for the changed OND. +// exists to acess the proper transport for the changed MNE. type Change struct { cuid uuid.UUID duid uuid.UUID @@ -77,7 +77,7 @@ func (c *Change) ID() uuid.UUID { return c.cuid } -// Commit pushes the change to the OND using the callback() function +// Commit pushes the change to the MNE using the callback() function // and starts the timeout-timer for the Change. If the timer expires // the change is rolled back. func (c *Change) Commit() error { diff --git a/controller/nucleus/change_test.go b/controller/nucleus/change_test.go index 19f96e7eca06080c5da9e4066ca22033151a2031..cdfae361add283fd4257d12583299763d11cd41a 100644 --- a/controller/nucleus/change_test.go +++ b/controller/nucleus/change_test.go @@ -37,7 +37,7 @@ func TestChange_CommitRollback(t *testing.T) { callback := make(chan string) c := &Change{ cuid: cuid, - duid: did, + duid: mneid, timestamp: time.Now(), previousState: rollbackDevice, intendedState: commitDevice, @@ -82,7 +82,7 @@ func TestChange_CommitRollbackError(t *testing.T) { rollbackErrChannel := make(chan error) c := &Change{ cuid: cuid, - duid: did, + duid: mneid, timestamp: time.Now(), previousState: rollbackDevice, intendedState: commitDevice, @@ -123,7 +123,7 @@ func TestChange_CommitError(t *testing.T) { want := ppb.ChangeState_CHANGE_STATE_INCONSISTENT c := &Change{ cuid: cuid, - duid: did, + duid: mneid, timestamp: time.Now(), previousState: rollbackDevice, intendedState: commitDevice, @@ -153,7 +153,7 @@ func TestChange_Commit(t *testing.T) { want := ppb.ChangeState_CHANGE_STATE_COMMITTED c := &Change{ cuid: cuid, - duid: did, + duid: mneid, timestamp: time.Now(), previousState: rollbackDevice, intendedState: commitDevice, @@ -285,7 +285,7 @@ func TestChange_State(t *testing.T) { t.Logf("callback in test %v", testName) return nil } - c := NewChange(did, rollbackDevice, commitDevice, callback) + c := NewChange(mneid, rollbackDevice, commitDevice, callback) if tt.name != "pending" { if err := c.Commit(); err != nil { t.Errorf("Commit() error = %v", err) diff --git a/controller/nucleus/databaseDeviceStore.go b/controller/nucleus/databaseDeviceStore.go deleted file mode 100644 index b2d8feef18e71820dc24f038597c88b07830fe8a..0000000000000000000000000000000000000000 --- a/controller/nucleus/databaseDeviceStore.go +++ /dev/null @@ -1,213 +0,0 @@ -package nucleus - -import ( - "fmt" - - "code.fbi.h-da.de/danet/gosdn/controller/customerrs" - "code.fbi.h-da.de/danet/gosdn/controller/interfaces/device" - "code.fbi.h-da.de/danet/gosdn/controller/nucleus/database" - "code.fbi.h-da.de/danet/gosdn/controller/store" - "go.mongodb.org/mongo-driver/bson" - "go.mongodb.org/mongo-driver/bson/primitive" - "go.mongodb.org/mongo-driver/mongo/options" - - "github.com/google/uuid" - log "github.com/sirupsen/logrus" -) - -// DatabaseDeviceStore is used to store Devices. -type DatabaseDeviceStore struct { - storeName string -} - -// NewDatabaseDeviceStore returns a DeviceStore. -func NewDatabaseDeviceStore(pndUUID uuid.UUID) device.Store { - return &DatabaseDeviceStore{ - storeName: fmt.Sprintf("device-store-%s.json", pndUUID.String()), - } -} - -// Get takes a Device's UUID or name and returns the Device. -func (s *DatabaseDeviceStore) Get(query store.Query) (device.LoadedDevice, error) { - var loadedDevice device.LoadedDevice - - if query.ID.String() != "" { - loadedDevice, err := s.getByID(query.ID) - if err != nil { - return loadedDevice, err - } - - return loadedDevice, nil - } - - loadedDevice, err := s.getByName(query.Name) - if err != nil { - return loadedDevice, err - } - - return loadedDevice, nil -} - -func (s *DatabaseDeviceStore) getByID(idOfDevice uuid.UUID) (loadedDevice device.LoadedDevice, err error) { - client, ctx, cancel := database.GetMongoConnection() - defer cancel() - defer func() { - if ferr := client.Disconnect(ctx); ferr != nil { - fErrString := ferr.Error() - err = fmt.Errorf("InternalError=%w DeferError=%+s", err, fErrString) - } - }() - db := client.Database(database.DatabaseName) - collection := db.Collection(s.storeName) - result := collection.FindOne(ctx, bson.D{primitive.E{Key: "_id", Value: idOfDevice.String()}}) - if result == nil { - return loadedDevice, customerrs.CouldNotFindError{ID: idOfDevice} - } - - err = result.Decode(&loadedDevice) - if err != nil { - log.Printf("Failed marshalling %v", err) - return loadedDevice, customerrs.CouldNotMarshallError{Identifier: idOfDevice, Type: loadedDevice, Err: err} - } - - return loadedDevice, nil -} - -func (s *DatabaseDeviceStore) getByName(nameOfDevice string) (loadedDevice device.LoadedDevice, err error) { - client, ctx, cancel := database.GetMongoConnection() - defer cancel() - defer func() { - if ferr := client.Disconnect(ctx); ferr != nil { - fErrString := ferr.Error() - err = fmt.Errorf("InternalError=%w DeferError=%+s", err, fErrString) - } - }() - db := client.Database(database.DatabaseName) - collection := db.Collection(s.storeName) - result := collection.FindOne(ctx, bson.D{primitive.E{Key: "name", Value: nameOfDevice}}) - if result == nil { - return loadedDevice, customerrs.CouldNotFindError{Name: nameOfDevice} - } - - err = result.Decode(&loadedDevice) - if err != nil { - log.Printf("Failed marshalling %v", err) - return loadedDevice, customerrs.CouldNotMarshallError{Identifier: nameOfDevice, Type: loadedDevice, Err: err} - } - - return loadedDevice, nil -} - -// GetAll returns all stored devices. -func (s *DatabaseDeviceStore) GetAll() (loadedDevices []device.LoadedDevice, err error) { - client, ctx, cancel := database.GetMongoConnection() - defer cancel() - defer func() { - if ferr := client.Disconnect(ctx); ferr != nil { - fErrString := ferr.Error() - err = fmt.Errorf("InternalError=%w DeferError=%+s", err, fErrString) - } - }() - - db := client.Database(database.DatabaseName) - collection := db.Collection(s.storeName) - - cursor, err := collection.Find(ctx, bson.D{}) - if err != nil { - return nil, err - } - defer func() { - if ferr := cursor.Close(ctx); ferr != nil { - fErrString := ferr.Error() - err = fmt.Errorf("InternalError=%w DeferError=%+s", err, fErrString) - } - }() - - err = cursor.All(ctx, &loadedDevices) - if err != nil { - log.Printf("Failed marshalling %v", err) - - return nil, customerrs.CouldNotMarshallError{Type: loadedDevices, Err: err} - } - - return loadedDevices, nil -} - -// Add adds a device to the device store. -func (s *DatabaseDeviceStore) Add(deviceToAdd device.Device) (err error) { - client, ctx, cancel := database.GetMongoConnection() - defer cancel() - defer func() { - if ferr := client.Disconnect(ctx); ferr != nil { - fErrString := ferr.Error() - err = fmt.Errorf("InternalError=%w DeferError=%+s", err, fErrString) - } - }() - - _, err = client.Database(database.DatabaseName). - Collection(s.storeName). - InsertOne(ctx, deviceToAdd) - if err != nil { - log.Printf("Could not create Device: %v", err) - return customerrs.CouldNotCreateError{Identifier: deviceToAdd.ID(), Type: deviceToAdd, Err: err} - } - - return nil -} - -// Update updates a existing device. -func (s *DatabaseDeviceStore) Update(deviceToUpdate device.Device) (err error) { - var updatedLoadedDevice device.LoadedDevice - - client, ctx, cancel := database.GetMongoConnection() - defer cancel() - defer func() { - if ferr := client.Disconnect(ctx); ferr != nil { - fErrString := ferr.Error() - err = fmt.Errorf("InternalError=%w DeferError=%+s", err, fErrString) - } - }() - - update := bson.D{primitive.E{Key: "$set", Value: deviceToUpdate}} - - upsert := false - after := options.After - opt := options.FindOneAndUpdateOptions{ - Upsert: &upsert, - ReturnDocument: &after, - } - - err = client.Database(database.DatabaseName). - Collection(s.storeName). - FindOneAndUpdate( - ctx, bson.M{"_id": deviceToUpdate.ID().String()}, update, &opt). - Decode(&updatedLoadedDevice) - if err != nil { - log.Printf("Could not update Device: %v", err) - - return customerrs.CouldNotUpdateError{Identifier: deviceToUpdate.ID(), Type: deviceToUpdate, Err: err} - } - - return nil -} - -// Delete deletes a device from the device store. -func (s *DatabaseDeviceStore) Delete(deviceToDelete device.Device) (err error) { - client, ctx, cancel := database.GetMongoConnection() - defer cancel() - defer func() { - if ferr := client.Disconnect(ctx); ferr != nil { - fErrString := ferr.Error() - err = fmt.Errorf("InternalError=%w DeferError=%+s", err, fErrString) - } - }() - - db := client.Database(database.DatabaseName) - collection := db.Collection(s.storeName) - _, err = collection.DeleteOne(ctx, bson.D{primitive.E{Key: deviceToDelete.ID().String()}}) - if err != nil { - return customerrs.CouldNotDeleteError{Identifier: deviceToDelete.ID(), Type: deviceToDelete, Err: err} - } - - return nil -} diff --git a/controller/nucleus/databaseNetworkElementStore.go b/controller/nucleus/databaseNetworkElementStore.go new file mode 100644 index 0000000000000000000000000000000000000000..5a42a3730bcfa0662d216a05b66703d59ca5461b --- /dev/null +++ b/controller/nucleus/databaseNetworkElementStore.go @@ -0,0 +1,213 @@ +package nucleus + +import ( + "fmt" + + "code.fbi.h-da.de/danet/gosdn/controller/customerrs" + "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkelement" + "code.fbi.h-da.de/danet/gosdn/controller/nucleus/database" + "code.fbi.h-da.de/danet/gosdn/controller/store" + "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/bson/primitive" + "go.mongodb.org/mongo-driver/mongo/options" + + "github.com/google/uuid" + log "github.com/sirupsen/logrus" +) + +// DatabaseNetworkElementStore is used to store Network Elements. +type DatabaseNetworkElementStore struct { + storeName string +} + +// NewDatabaseNetworkElementStore returns a NetworkElementStore. +func NewDatabaseNetworkElementStore(pndUUID uuid.UUID) networkelement.Store { + return &DatabaseNetworkElementStore{ + storeName: fmt.Sprintf("networkElement-store-%s.json", pndUUID.String()), + } +} + +// Get takes a NetworkElement's UUID or name and returns the NetworkElement. +func (s *DatabaseNetworkElementStore) Get(query store.Query) (networkelement.LoadedNetworkElement, error) { + var loadedNetworkElement networkelement.LoadedNetworkElement + + if query.ID.String() != "" { + loadedNetworkElement, err := s.getByID(query.ID) + if err != nil { + return loadedNetworkElement, err + } + + return loadedNetworkElement, nil + } + + loadedNetworkElement, err := s.getByName(query.Name) + if err != nil { + return loadedNetworkElement, err + } + + return loadedNetworkElement, nil +} + +func (s *DatabaseNetworkElementStore) getByID(idOfNetworkElement uuid.UUID) (loadedNetworkElement networkelement.LoadedNetworkElement, err error) { + client, ctx, cancel := database.GetMongoConnection() + defer cancel() + defer func() { + if ferr := client.Disconnect(ctx); ferr != nil { + fErrString := ferr.Error() + err = fmt.Errorf("InternalError=%w DeferError=%+s", err, fErrString) + } + }() + db := client.Database(database.DatabaseName) + collection := db.Collection(s.storeName) + result := collection.FindOne(ctx, bson.D{primitive.E{Key: "_id", Value: idOfNetworkElement.String()}}) + if result == nil { + return loadedNetworkElement, customerrs.CouldNotFindError{ID: idOfNetworkElement} + } + + err = result.Decode(&loadedNetworkElement) + if err != nil { + log.Printf("Failed marshalling %v", err) + return loadedNetworkElement, customerrs.CouldNotMarshallError{Identifier: idOfNetworkElement, Type: loadedNetworkElement, Err: err} + } + + return loadedNetworkElement, nil +} + +func (s *DatabaseNetworkElementStore) getByName(nameOfNetworkElement string) (loadedNetworkElement networkelement.LoadedNetworkElement, err error) { + client, ctx, cancel := database.GetMongoConnection() + defer cancel() + defer func() { + if ferr := client.Disconnect(ctx); ferr != nil { + fErrString := ferr.Error() + err = fmt.Errorf("InternalError=%w DeferError=%+s", err, fErrString) + } + }() + db := client.Database(database.DatabaseName) + collection := db.Collection(s.storeName) + result := collection.FindOne(ctx, bson.D{primitive.E{Key: "name", Value: nameOfNetworkElement}}) + if result == nil { + return loadedNetworkElement, customerrs.CouldNotFindError{Name: nameOfNetworkElement} + } + + err = result.Decode(&loadedNetworkElement) + if err != nil { + log.Printf("Failed marshalling %v", err) + return loadedNetworkElement, customerrs.CouldNotMarshallError{Identifier: nameOfNetworkElement, Type: loadedNetworkElement, Err: err} + } + + return loadedNetworkElement, nil +} + +// GetAll returns all stored network elements. +func (s *DatabaseNetworkElementStore) GetAll() (loadedNetworkElements []networkelement.LoadedNetworkElement, err error) { + client, ctx, cancel := database.GetMongoConnection() + defer cancel() + defer func() { + if ferr := client.Disconnect(ctx); ferr != nil { + fErrString := ferr.Error() + err = fmt.Errorf("InternalError=%w DeferError=%+s", err, fErrString) + } + }() + + db := client.Database(database.DatabaseName) + collection := db.Collection(s.storeName) + + cursor, err := collection.Find(ctx, bson.D{}) + if err != nil { + return nil, err + } + defer func() { + if ferr := cursor.Close(ctx); ferr != nil { + fErrString := ferr.Error() + err = fmt.Errorf("InternalError=%w DeferError=%+s", err, fErrString) + } + }() + + err = cursor.All(ctx, &loadedNetworkElements) + if err != nil { + log.Printf("Failed marshalling %v", err) + + return nil, customerrs.CouldNotMarshallError{Type: loadedNetworkElements, Err: err} + } + + return loadedNetworkElements, nil +} + +// Add adds a network element to the network element store. +func (s *DatabaseNetworkElementStore) Add(networkElementToAdd networkelement.NetworkElement) (err error) { + client, ctx, cancel := database.GetMongoConnection() + defer cancel() + defer func() { + if ferr := client.Disconnect(ctx); ferr != nil { + fErrString := ferr.Error() + err = fmt.Errorf("InternalError=%w DeferError=%+s", err, fErrString) + } + }() + + _, err = client.Database(database.DatabaseName). + Collection(s.storeName). + InsertOne(ctx, networkElementToAdd) + if err != nil { + log.Printf("Could not create NetworkElement: %v", err) + return customerrs.CouldNotCreateError{Identifier: networkElementToAdd.ID(), Type: networkElementToAdd, Err: err} + } + + return nil +} + +// Update updates a existing network element. +func (s *DatabaseNetworkElementStore) Update(networkElementToUpdate networkelement.NetworkElement) (err error) { + var updatedLoadedNetworkElement networkelement.LoadedNetworkElement + + client, ctx, cancel := database.GetMongoConnection() + defer cancel() + defer func() { + if ferr := client.Disconnect(ctx); ferr != nil { + fErrString := ferr.Error() + err = fmt.Errorf("InternalError=%w DeferError=%+s", err, fErrString) + } + }() + + update := bson.D{primitive.E{Key: "$set", Value: networkElementToUpdate}} + + upsert := false + after := options.After + opt := options.FindOneAndUpdateOptions{ + Upsert: &upsert, + ReturnDocument: &after, + } + + err = client.Database(database.DatabaseName). + Collection(s.storeName). + FindOneAndUpdate( + ctx, bson.M{"_id": networkElementToUpdate.ID().String()}, update, &opt). + Decode(&updatedLoadedNetworkElement) + if err != nil { + log.Printf("Could not update NetworkElement: %v", err) + + return customerrs.CouldNotUpdateError{Identifier: networkElementToUpdate.ID(), Type: networkElementToUpdate, Err: err} + } + + return nil +} + +// Delete deletes a network element from the network element store. +func (s *DatabaseNetworkElementStore) Delete(networkElementToDelete networkelement.NetworkElement) (err error) { + client, ctx, cancel := database.GetMongoConnection() + defer cancel() + defer func() { + if ferr := client.Disconnect(ctx); ferr != nil { + fErrString := ferr.Error() + err = fmt.Errorf("InternalError=%w DeferError=%+s", err, fErrString) + } + }() + + db := client.Database(database.DatabaseName) + collection := db.Collection(s.storeName) + _, err = collection.DeleteOne(ctx, bson.D{primitive.E{Key: networkElementToDelete.ID().String()}}) + if err != nil { + return customerrs.CouldNotDeleteError{Identifier: networkElementToDelete.ID(), Type: networkElementToDelete, Err: err} + } + + return nil +} diff --git a/controller/nucleus/databasePndStore.go b/controller/nucleus/databasePndStore.go index d04262e963035e260666a74c57b81884cab26302..e79b73f651ab91c3e086544d135d5f95fcbda46b 100644 --- a/controller/nucleus/databasePndStore.go +++ b/controller/nucleus/databasePndStore.go @@ -3,8 +3,8 @@ package nucleus import ( "fmt" - "code.fbi.h-da.de/danet/gosdn/controller/interfaces/device" "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkdomain" + "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkelement" cpb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/csbi" "code.fbi.h-da.de/danet/gosdn/controller/customerrs" @@ -22,7 +22,7 @@ import ( // DatabasePndStore is used to store PrincipalNetworkDomains. type DatabasePndStore struct { pndStoreName string - pendingChannels map[uuid.UUID]chan device.Details + pendingChannels map[uuid.UUID]chan networkelement.Details csbiClient cpb.CsbiServiceClient } @@ -175,7 +175,7 @@ func (s *DatabasePndStore) Delete(pndToDelete networkdomain.NetworkDomain) (err // PendingChannels holds channels used communicate with pending // cSBI deployments. -func (s *DatabasePndStore) PendingChannels(id uuid.UUID, parseErrors ...error) (chan device.Details, error) { +func (s *DatabasePndStore) PendingChannels(id uuid.UUID, parseErrors ...error) (chan networkelement.Details, error) { ch, ok := s.pendingChannels[id] if !ok { return nil, &customerrs.CouldNotFindError{ID: id} @@ -184,7 +184,7 @@ func (s *DatabasePndStore) PendingChannels(id uuid.UUID, parseErrors ...error) ( } // AddPendingChannel adds a pending channel to the map. -func (s *DatabasePndStore) AddPendingChannel(id uuid.UUID, ch chan device.Details) { +func (s *DatabasePndStore) AddPendingChannel(id uuid.UUID, ch chan networkelement.Details) { s.pendingChannels[id] = ch } @@ -193,7 +193,7 @@ func (s *DatabasePndStore) RemovePendingChannel(id uuid.UUID) { delete(s.pendingChannels, id) } -func (s *DatabasePndStore) callback(id uuid.UUID, ch chan device.Details) { +func (s *DatabasePndStore) callback(id uuid.UUID, ch chan networkelement.Details) { if ch != nil { s.AddPendingChannel(id, ch) log.Infof("pending channel %v added", id) diff --git a/controller/nucleus/device.go b/controller/nucleus/device.go deleted file mode 100644 index 8846b2ba75aeefaa9e5b72d5e505bad43f7f6271..0000000000000000000000000000000000000000 --- a/controller/nucleus/device.go +++ /dev/null @@ -1,358 +0,0 @@ -package nucleus - -import ( - "encoding/json" - - spb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/southbound" - tpb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/transport" - "code.fbi.h-da.de/danet/gosdn/controller/customerrs" - "code.fbi.h-da.de/danet/gosdn/controller/interfaces/device" - "code.fbi.h-da.de/danet/gosdn/controller/interfaces/southbound" - "code.fbi.h-da.de/danet/gosdn/controller/interfaces/transport" - "github.com/docker/docker/pkg/namesgenerator" - "github.com/google/uuid" - "github.com/openconfig/ygot/ygot" - "go.mongodb.org/mongo-driver/bson" - "google.golang.org/protobuf/proto" -) - -// NewDevice creates a Device. -func NewDevice(name string, uuidInput uuid.UUID, opt *tpb.TransportOption, sbi southbound.SouthboundInterface) (device.Device, error) { - t, err := NewTransport(opt, sbi) - if err != nil { - return nil, err - } - - // TODO: this needs to check the case that the uuidInput is set, as the - // same uuid may be already stored. - if uuidInput == uuid.Nil { - uuidInput = uuid.New() - } - - if name == "" { - name = namesgenerator.GetRandomName(0) - } - - // We want a representation of the OND's config (the SBI-schema's root created through ygot), - // but do not want to work on the sbi.Schema() directly. - // So the root of sbi.Schema() is never changed when a set or get on a device will be called. - root, err := ygot.DeepCopy(sbi.Schema().Root) - if err != nil { - return nil, err - } - ygotDeepCopy, ok := root.(ygot.GoStruct) - if !ok { - return nil, &customerrs.InvalidTypeAssertionError{ - Value: root, - Type: (*ygot.ValidatedGoStruct)(nil), - } - } - - if opt.Type == spb.Type_TYPE_CONTAINERISED { - return &CsbiDevice{ - CommonDevice: CommonDevice{ - UUID: uuidInput, - Model: ygotDeepCopy, - sbi: sbi, - transport: t, - name: name, - transportOptions: opt, - }, - }, nil - } - - return &CommonDevice{ - UUID: uuidInput, - Model: ygotDeepCopy, - sbi: sbi, - transport: t, - name: name, - transportOptions: opt, - }, nil -} - -// CommonDevice represents an OND. -type CommonDevice struct { - // UUID represents the Devices UUID - UUID uuid.UUID - - // Device embeds a ygot.GoStruct containing the device details - Model ygot.GoStruct - - // SBI is the device's southbound interface implementation - sbi southbound.SouthboundInterface - - // Transport is the device's Transport implementation - transport transport.Transport - - // Name is the device's human readable name - name string - - transportOptions *tpb.TransportOption -} - -// ID returns the UUID of the Device. -func (d *CommonDevice) ID() uuid.UUID { - return d.UUID -} - -// GetModel returns the ygot representation of the Device. -func (d *CommonDevice) GetModel() ygot.GoStruct { - return d.Model -} - -// CreateModelCopy returns a copy of the ygot representation of the Device. -func (d *CommonDevice) CreateModelCopy() (ygot.ValidatedGoStruct, error) { - return createValidatedCopy(d) -} - -// Transport returns the Transport of the device. -func (d *CommonDevice) Transport() transport.Transport { - return d.transport -} - -// TransportAddress returns the TransportAddress of the device. -func (d *CommonDevice) TransportAddress() string { - return d.transportOptions.Address -} - -// Name returns the name of the device. -func (d *CommonDevice) Name() string { - return d.name -} - -// SBI returns the sbi of the Device. -func (d *CommonDevice) SBI() southbound.SouthboundInterface { - return d.sbi -} - -// SetTransport sets the Device's Transport. -func (d *CommonDevice) SetTransport(t transport.Transport) { - d.transport = t -} - -// SetName sets the Device's name. -func (d *CommonDevice) SetName(n string) { - d.name = n -} - -// SetSBI sets the Device's SBI. -func (d *CommonDevice) SetSBI(sbi southbound.SouthboundInterface) { - d.sbi = sbi -} - -// ProcessResponse processes a response for the Device. -func (d *CommonDevice) ProcessResponse(resp proto.Message) error { - return d.transport.ProcessResponse(resp, d.Model, d.sbi.Schema()) -} - -// IsTransportValid returns a boolean if the transport of a device is valid. -func (d *CommonDevice) IsTransportValid() bool { - if d.transportOptions != nil && d.transportOptions.Address != "" { - return true - } - - return false -} - -// CsbiDevice is used for the cSBI functionality. -type CsbiDevice struct { - CommonDevice -} - -// ID returns the UUID of the Device. -func (d *CsbiDevice) ID() uuid.UUID { - return d.UUID -} - -// GetModel returns the ygot representation of the Device. -func (d *CsbiDevice) GetModel() ygot.GoStruct { - return d.Model -} - -// CreateModelCopy returns a copy of the ygot representation of the Device. -func (d *CsbiDevice) CreateModelCopy() (ygot.ValidatedGoStruct, error) { - return createValidatedCopy(d) -} - -// Transport returns the Transport of the device. -func (d *CsbiDevice) Transport() transport.Transport { - return d.transport -} - -// Name returns the name of the device. -func (d *CsbiDevice) Name() string { - return d.name -} - -// SBI returns the sbi of the Device. -func (d *CsbiDevice) SBI() southbound.SouthboundInterface { - return d.sbi -} - -// ProcessResponse processes a response for the Device. -func (d *CsbiDevice) ProcessResponse(resp proto.Message) error { - // TODO: callback to send response to caller - return d.transport.ProcessResponse(resp, d.Model, d.sbi.Schema()) -} - -func createValidatedCopy(d device.Device) (ygot.ValidatedGoStruct, error) { - cpy, err := ygot.DeepCopy(d.GetModel()) - ygot.BuildEmptyTree(cpy) - if err != nil { - return nil, err - } - - validatedCpy, ok := cpy.(ygot.ValidatedGoStruct) - if !ok { - return nil, customerrs.InvalidTypeAssertionError{ - Value: validatedCpy, - Type: (*ygot.ValidatedGoStruct)(nil), - } - } - - return validatedCpy, nil -} - -// IsTransportValid returns a boolean if the transport of a device is valid. -func (d *CsbiDevice) IsTransportValid() bool { - if d.transportOptions != nil && d.transportOptions.Address != "" { - return true - } - - return false -} - -// MarshalJSON implements the MarshalJSON interface to store a device as JSON. -func (d *CommonDevice) MarshalJSON() ([]byte, error) { - var transportType string - var transportAddress string - var transportUsername string - var transportPassword string - var transportOptionType spb.Type - - // Handling of these cases is necessary as we use partial devices for testing. - // eg. in most tests no transport or sbi is defined. - // The marshaller will crash if we want to access a nil field. - if d.transport == nil || d.transportOptions == nil { - transportType = "testing" - transportAddress = "testing" - transportUsername = "testing" - transportPassword = "testing" - transportOptionType = spb.Type_TYPE_OPENCONFIG - } else { - transportType = d.transport.Type() - transportAddress = d.transportOptions.Address - transportUsername = d.transportOptions.Username - transportPassword = d.transportOptions.Password - transportOptionType = d.transportOptions.Type - } - - var sbiUUID uuid.UUID - - if d.sbi == nil { - sbiUUID = uuid.UUID{} - } else { - sbiUUID = d.sbi.ID() - } - - modelAsString, err := ygot.EmitJSON(d.Model, d.getYgotEmitJSONConfig()) - if err != nil { - return []byte{}, err - } - - return json.Marshal(&struct { - ID uuid.UUID `json:"id,omitempty"` - Name string `json:"name,omitempty"` - TransportType string `json:"transport_type,omitempty"` - TransportAddress string `json:"transport_address,omitempty"` - TransportUsername string `json:"transport_username,omitempty"` - TransportPassword string `json:"transport_password,omitempty"` - TransportOptionType spb.Type `json:"transport_option"` - SBI uuid.UUID `json:"sbi,omitempty"` - Model string `bson:"model,omitempty"` - }{ - ID: d.ID(), - Name: d.Name(), - TransportType: transportType, - TransportAddress: transportAddress, - TransportUsername: transportUsername, - TransportPassword: transportPassword, - TransportOptionType: transportOptionType, - SBI: sbiUUID, - Model: modelAsString, - }) -} - -// MarshalBSON implements the MarshalBSON interface to store a device as BSON. -func (d *CommonDevice) MarshalBSON() ([]byte, error) { - var transportType string - var transportAddress string - var transportUsername string - var transportPassword string - var transportOptionType spb.Type - - // Handling of these cases is necessary as we use partial devices for testing. - // eg. in most tests no transport or sbi is defined. - // The marshaller will crash if we want to access a nil field. - if d.transport == nil || d.transportOptions == nil { - transportType = "testing" - transportAddress = "testing" - transportUsername = "testing" - transportPassword = "testing" - transportOptionType = spb.Type_TYPE_OPENCONFIG - } else { - transportType = d.transport.Type() - transportAddress = d.transportOptions.Address - transportUsername = d.transportOptions.Username - transportPassword = d.transportOptions.Password - transportOptionType = d.transportOptions.Type - } - - modelAsString, err := ygot.EmitJSON(d.Model, d.getYgotEmitJSONConfig()) - if err != nil { - return []byte{}, err - } - - return bson.Marshal(&struct { - ID string `bson:"_id,omitempty"` - Name string `bson:"name,omitempty"` - TransportType string `bson:"transport_type,omitempty"` - TransportAddress string `bson:"transport_address,omitempty"` - TransportUsername string `bson:"transport_username,omitempty"` - TransportPassword string `bson:"transport_password,omitempty"` - TransportOptionType spb.Type `bson:"transport_option"` - SBI string `bson:"sbi,omitempty"` - Model string `bson:"model,omitempty"` - }{ - ID: d.ID().String(), - Name: d.Name(), - TransportType: transportType, - TransportAddress: transportAddress, - TransportUsername: transportUsername, - TransportPassword: transportPassword, - TransportOptionType: transportOptionType, - SBI: d.sbi.ID().String(), - Model: modelAsString, - }) -} - -// GetModelAsString returns the YANG model of a device as string. -func (d *CommonDevice) GetModelAsString() (string, error) { - modelAsString, err := ygot.EmitJSON(d.Model, d.getYgotEmitJSONConfig()) - if err != nil { - return "", err - } - - return modelAsString, nil -} - -func (d *CommonDevice) getYgotEmitJSONConfig() *ygot.EmitJSONConfig { - return &ygot.EmitJSONConfig{ - Format: ygot.RFC7951, - Indent: "", - SkipValidation: true, - RFC7951Config: &ygot.RFC7951JSONConfig{ - AppendModuleName: true, - }} -} diff --git a/controller/nucleus/deviceFilesystemStore.go b/controller/nucleus/deviceFilesystemStore.go deleted file mode 100644 index 61561f83dc5b52ce2078b24f65e6f07a9ab51824..0000000000000000000000000000000000000000 --- a/controller/nucleus/deviceFilesystemStore.go +++ /dev/null @@ -1,178 +0,0 @@ -package nucleus - -import ( - "encoding/json" - "os" - "sync" - - "code.fbi.h-da.de/danet/gosdn/controller/customerrs" - "code.fbi.h-da.de/danet/gosdn/controller/interfaces/device" - "code.fbi.h-da.de/danet/gosdn/controller/store" - "github.com/google/uuid" - log "github.com/sirupsen/logrus" -) - -// FilesystemDeviceStore is the filesystem implementation of the device store. -type FilesystemDeviceStore struct { - pndUUID uuid.UUID - fileMutex sync.Mutex - pathToDeviceFile string -} - -// NewFilesystemDeviceStore returns a filesystem implementation for a pnd store. -func NewFilesystemDeviceStore(pndUUID uuid.UUID) device.Store { - deviceFilenameForUUID := store.GetStoreFilenameForUUID(pndUUID, store.DeviceFilenameSuffix) - - if err := store.EnsureFilesystemStorePathExists(deviceFilenameForUUID); err != nil { - log.Error(err) - } - return &FilesystemDeviceStore{ - pathToDeviceFile: store.GetCompletePathToFileStore(deviceFilenameForUUID), - fileMutex: sync.Mutex{}, - pndUUID: pndUUID, - } -} - -func (s *FilesystemDeviceStore) readAllDevicesFromFile() ([]device.LoadedDevice, error) { - var loadedDevices []device.LoadedDevice - - content, err := os.ReadFile(s.pathToDeviceFile) - if err != nil { - return nil, err - } - - err = json.Unmarshal(content, &loadedDevices) - if err != nil { - return nil, err - } - - return loadedDevices, nil -} - -func (s *FilesystemDeviceStore) writeAllDevicesToFile(devices []device.LoadedDevice) error { - serializedData, err := json.Marshal(devices) - if err != nil { - return err - } - - err = os.WriteFile(s.pathToDeviceFile, serializedData, 0600) - if err != nil { - return err - } - - return nil -} - -// Get takes a Device's UUID or name and returns the Device. -func (s *FilesystemDeviceStore) Get(query store.Query) (device.LoadedDevice, error) { - s.fileMutex.Lock() - defer s.fileMutex.Unlock() - - var device device.LoadedDevice - - devices, err := s.readAllDevicesFromFile() - if err != nil { - return device, err - } - - for _, device := range devices { - if device.ID == query.ID.String() || device.Name == query.Name { - return device, nil - } - } - - return device, &customerrs.CouldNotFindError{ID: query.ID, Name: query.Name} -} - -// GetAll returns all stored devices. -func (s *FilesystemDeviceStore) GetAll() ([]device.LoadedDevice, error) { - s.fileMutex.Lock() - defer s.fileMutex.Unlock() - - devices, err := s.readAllDevicesFromFile() - - return devices, err -} - -// Add adds a device to the device store. -func (s *FilesystemDeviceStore) Add(deviceToAdd device.Device) error { - s.fileMutex.Lock() - defer s.fileMutex.Unlock() - - devices, err := s.readAllDevicesFromFile() - if err != nil { - return err - } - - var loadedDevice device.LoadedDevice - loadedDevice, err = store.TransformObjectToLoadedObject[device.Device, device.LoadedDevice](deviceToAdd) - if err != nil { - return err - } - - devices = append(devices, loadedDevice) - - err = s.writeAllDevicesToFile(devices) - if err != nil { - return err - } - - return nil -} - -// Update updates a existing device. -func (s *FilesystemDeviceStore) Update(deviceToUpdate device.Device) error { - s.fileMutex.Lock() - defer s.fileMutex.Unlock() - - loadedDeviceToUpdate, err := store.TransformObjectToLoadedObject[device.Device, device.LoadedDevice](deviceToUpdate) - if err != nil { - return err - } - - devices, err := s.readAllDevicesFromFile() - if err != nil { - return err - } - - for i, device := range devices { - if device.ID == deviceToUpdate.ID().String() { - devices[i] = loadedDeviceToUpdate - err = s.writeAllDevicesToFile(devices) - if err != nil { - return err - } - return nil - } - } - - return &customerrs.CouldNotUpdateError{Identifier: deviceToUpdate.ID(), Type: deviceToUpdate, Err: err} -} - -// Delete deletes a device from the device store. -func (s *FilesystemDeviceStore) Delete(deviceToDelete device.Device) error { - s.fileMutex.Lock() - defer s.fileMutex.Unlock() - - devices, err := s.readAllDevicesFromFile() - if err != nil { - return err - } - - for i, device := range devices { - if device.ID == deviceToDelete.ID().String() { - //remove item from slice - devices[i] = devices[len(devices)-1] - devices = devices[:len(devices)-1] - - err = s.writeAllDevicesToFile(devices) - if err != nil { - return err - } - - return nil - } - } - - return &customerrs.CouldNotDeleteError{Identifier: deviceToDelete.ID(), Type: deviceToDelete, Err: err} -} diff --git a/controller/nucleus/deviceFilesystemStore_test.go b/controller/nucleus/deviceFilesystemStore_test.go deleted file mode 100644 index 0a6ae860553cd2ed52b2ade62e7558107ebbe530..0000000000000000000000000000000000000000 --- a/controller/nucleus/deviceFilesystemStore_test.go +++ /dev/null @@ -1,244 +0,0 @@ -package nucleus - -import ( - "testing" - - spb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/southbound" - tpb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/transport" - "code.fbi.h-da.de/danet/gosdn/controller/interfaces/device" - "code.fbi.h-da.de/danet/gosdn/controller/store" - "github.com/google/uuid" -) - -func returnBasicTransportOption() tpb.TransportOption { - return tpb.TransportOption{ - Address: "test:///", - Username: "test", - Password: "test", - TransportOption: &tpb.TransportOption_GnmiTransportOption{ - GnmiTransportOption: &tpb.GnmiTransportOption{ - Compression: "", - GrpcDialOptions: nil, - Token: "", - Encoding: 0, - }, - }, - } -} - -func TestAddDevice(t *testing.T) { - defer ensureStoreFileForTestsIsRemoved(store.DeviceFilenameSuffix) - - pndID, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad") - deviceID, _ := uuid.Parse("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa") - sbiID1, _ := uuid.Parse("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa") - trop := returnBasicTransportOption() - - sbi1, _ := NewSBI(spb.Type_TYPE_OPENCONFIG, sbiID1) - - deviceStore := NewDeviceStore(pndID) - device, _ := NewDevice("testdevice", deviceID, &trop, sbi1) - - err := deviceStore.Add(device) - if err != nil { - t.Error(err) - } -} - -func TestGetAllDevices(t *testing.T) { - defer ensureStoreFileForTestsIsRemoved(store.DeviceFilenameSuffix) - - pndID, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad") - deviceStore := NewDeviceStore(pndID) - - sbiID, _ := uuid.Parse("ssssssss-ssss-ssss-ssss-ssssssssssss") - sbi, _ := NewSBI(spb.Type_TYPE_OPENCONFIG, sbiID) - - deviceID1, _ := uuid.Parse("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa") - deviceID2, _ := uuid.Parse("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaab") - - transportOptions := returnBasicTransportOption() - - device1, err := NewDevice("testname", deviceID1, &transportOptions, sbi) - if err != nil { - t.Error(err) - } - - device2, err := NewDevice("testname2", deviceID2, &transportOptions, sbi) - if err != nil { - t.Error(err) - } - - inputDevices := [2]device.Device{device1, device2} - - for _, device := range inputDevices { - err := deviceStore.Add(device) - if err != nil { - t.Error(err) - } - } - - returnedDevices, err := deviceStore.GetAll() - if err != nil { - t.Error(err) - } - - length := len(returnedDevices) - if length != 2 { - t.Errorf("GetAll() length of array = %v, want %v", length, 2) - } - - for i, device := range returnedDevices { - if device.ID != inputDevices[i].ID().String() { - t.Errorf("GetAll() = %v, want %v", device.ID, inputDevices[i].ID().String()) - } - if device.Name != inputDevices[i].Name() { - t.Errorf("GetAll() = %v, want %v", device.Name, inputDevices[i].Name()) - } - } -} - -func TestGetDevice(t *testing.T) { - defer ensureStoreFileForTestsIsRemoved(store.DeviceFilenameSuffix) - - pndID, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad") - deviceStore := NewDeviceStore(pndID) - - sbiID, _ := uuid.Parse("ssssssss-ssss-ssss-ssss-ssssssssssss") - sbi, _ := NewSBI(spb.Type_TYPE_OPENCONFIG, sbiID) - - deviceID1, _ := uuid.Parse("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa") - deviceID2, _ := uuid.Parse("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaab") - - trop := returnBasicTransportOption() - - device1, err := NewDevice("testname", deviceID1, &trop, sbi) - if err != nil { - t.Error(err) - } - - device2, err := NewDevice("testname2", deviceID2, &trop, sbi) - if err != nil { - t.Error(err) - } - - inputDevices := [2]device.Device{device1, device2} - - for _, device := range inputDevices { - err := deviceStore.Add(device) - if err != nil { - t.Error(err) - } - } - - returnDevice, err := deviceStore.Get(store.Query{ID: deviceID2, Name: "testname2"}) - if err != nil { - t.Error(err) - } - - if returnDevice.ID != inputDevices[1].ID().String() { - t.Errorf("Get() = %v, want %v", returnDevice.ID, inputDevices[1].ID().String()) - } - if returnDevice.Name != inputDevices[1].Name() { - t.Errorf("Get() = %v, want %v", returnDevice.Name, inputDevices[1].Name()) - } -} - -func TestUpdateDevice(t *testing.T) { - defer ensureStoreFileForTestsIsRemoved(store.DeviceFilenameSuffix) - - pndID, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad") - deviceID, _ := uuid.Parse("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa") - sbiID1, _ := uuid.Parse("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa") - - trop := returnBasicTransportOption() - - updatedDeviceName := "testdevice2" - - sbi1, _ := NewSBI(spb.Type_TYPE_OPENCONFIG, sbiID1) - - deviceStore := NewDeviceStore(pndID) - device, _ := NewDevice("testdevice", deviceID, &trop, sbi1) - - err := deviceStore.Add(device) - if err != nil { - t.Error(err) - } - - device, _ = NewDevice(updatedDeviceName, deviceID, &trop, sbi1) - - err = deviceStore.Update(device) - if err != nil { - t.Error(err) - } - - returnDevice, err := deviceStore.Get(store.Query{ID: deviceID, Name: updatedDeviceName}) - if err != nil { - t.Error(err) - } - - if returnDevice.ID != deviceID.String() { - t.Errorf("Get() = %v, want %v", returnDevice.ID, deviceID.String()) - } - if returnDevice.Name != updatedDeviceName { - t.Errorf("Get() = %v, want %v", returnDevice.Name, updatedDeviceName) - } -} - -func TestDeleteDevice(t *testing.T) { - defer ensureStoreFileForTestsIsRemoved(store.DeviceFilenameSuffix) - - pndID, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad") - deviceStore := NewDeviceStore(pndID) - - sbiID, _ := uuid.Parse("ssssssss-ssss-ssss-ssss-ssssssssssss") - sbi, _ := NewSBI(spb.Type_TYPE_OPENCONFIG, sbiID) - - deviceID1, _ := uuid.Parse("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa") - deviceID2, _ := uuid.Parse("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaab") - - trop := returnBasicTransportOption() - - device1, err := NewDevice("testname", deviceID1, &trop, sbi) - if err != nil { - t.Error(err) - } - - device2, err := NewDevice("testname2", deviceID2, &trop, sbi) - if err != nil { - t.Error(err) - } - - inputDevices := [2]device.Device{device1, device2} - - for _, device := range inputDevices { - err := deviceStore.Add(device) - if err != nil { - t.Error(err) - } - } - - err = deviceStore.Delete(device1) - if err != nil { - t.Error(err) - } - - returnDevices, err := deviceStore.GetAll() - if err != nil { - t.Error(err) - } - - length := len(returnDevices) - if length != 1 { - t.Errorf("GetAll() length of array = %v, want %v", length, 2) - } - - for _, device := range returnDevices { - if device.ID != inputDevices[1].ID().String() { - t.Errorf("GetAll() = %v, want %v", device.ID, inputDevices[1].ID().String()) - } - if device.Name != inputDevices[1].Name() { - t.Errorf("GetAll() = %v, want %v", device.Name, inputDevices[1].Name()) - } - } -} diff --git a/controller/nucleus/deviceService.go b/controller/nucleus/deviceService.go deleted file mode 100644 index 9b3d47252ccdda67d065aa6d186054a58e9fb962..0000000000000000000000000000000000000000 --- a/controller/nucleus/deviceService.go +++ /dev/null @@ -1,212 +0,0 @@ -package nucleus - -import ( - "fmt" - - spb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/southbound" - "code.fbi.h-da.de/danet/gosdn/controller/event" - "code.fbi.h-da.de/danet/gosdn/controller/interfaces/device" - eventInterfaces "code.fbi.h-da.de/danet/gosdn/controller/interfaces/event" - "code.fbi.h-da.de/danet/gosdn/controller/interfaces/southbound" - "code.fbi.h-da.de/danet/gosdn/controller/store" - "github.com/google/uuid" - "github.com/openconfig/ygot/ygot" - - tpb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/transport" - log "github.com/sirupsen/logrus" -) - -const ( - // DeviceEventTopic is the used topic for device related entity changes. - DeviceEventTopic = "device" -) - -// DeviceService provides a device service implementation. -// This services provides abstraction between the user (e.g a PND) and the matching store (e.g. deviceStore). -type DeviceService struct { - deviceStore device.Store - sbiService southbound.Service - eventService eventInterfaces.Service -} - -// NewDeviceService creates a device service. -func NewDeviceService( - deviceStore device.Store, - sbiService southbound.Service, - eventService eventInterfaces.Service, -) device.Service { - return &DeviceService{ - deviceStore: deviceStore, - sbiService: sbiService, - eventService: eventService, - } -} - -// Get takes a Device's UUID or name and returns the Device. -func (s *DeviceService) Get(query store.Query) (device.Device, error) { - loadedDevice, err := s.deviceStore.Get(query) - if err != nil { - return nil, err - } - - device, err := s.createDeviceFromStore(loadedDevice) - if err != nil { - return nil, err - } - - return device, nil -} - -// GetAll returns all stored devices. -func (s *DeviceService) GetAll() ([]device.Device, error) { - var devices []device.Device - - loadedDevices, err := s.deviceStore.GetAll() - if err != nil { - return nil, err - } - - for _, loadedDevice := range loadedDevices { - device, err := s.createDeviceFromStore(loadedDevice) - if err != nil { - return nil, err - } - - devices = append(devices, device) - } - - return devices, nil -} - -// GetAllAsLoaded returns all stored devices as LoadedDevice. -// This method should be used if there is no need for a device.Device, since -// requesting device information through this method is a lot faster than the -// usual `GetAll` method. -func (s *DeviceService) GetAllAsLoaded() ([]device.LoadedDevice, error) { - loadedDevices, err := s.deviceStore.GetAll() - if err != nil { - return nil, err - } - - return loadedDevices, nil -} - -// Add adds a device to the device store. -func (s *DeviceService) Add(deviceToAdd device.Device) error { - err := s.deviceStore.Add(deviceToAdd) - if err != nil { - return err - } - - if err := s.eventService.PublishEvent(DeviceEventTopic, event.NewAddEvent(deviceToAdd.ID())); err != nil { - log.Error(err) - } - - return nil -} - -// UpdateModel updates a existing device with a new model provided as string. -func (s *DeviceService) UpdateModel(deviceToUpdate device.Device, modelAsString string) error { - exisitingDevice, err := s.Get(store.Query{ID: deviceToUpdate.ID()}) - if err != nil { - return err - } - - // Create 'root' path to be able to load the whole model from the store. - path, err := ygot.StringToPath("/", ygot.StructuredPath) - if err != nil { - return err - } - - // Use unmarshall from the devices SBI to unmarshall ygot json in go struct. - err = exisitingDevice.SBI().Unmarshal([]byte(modelAsString), path, exisitingDevice.GetModel()) - if err != nil { - return err - } - - err = s.deviceStore.Update(exisitingDevice) - if err != nil { - return err - } - - if err := s.eventService.PublishEvent(DeviceEventTopic, event.NewUpdateEvent(deviceToUpdate.ID())); err != nil { - log.Error(err) - } - - return nil -} - -// Update updates a existing device. -func (s *DeviceService) Update(deviceToUpdate device.Device) error { - err := s.deviceStore.Update(deviceToUpdate) - if err != nil { - return err - } - - if err := s.eventService.PublishEvent(DeviceEventTopic, event.NewUpdateEvent(deviceToUpdate.ID())); err != nil { - log.Error(err) - } - - return nil -} - -// Delete deletes a device from the device store. -func (s *DeviceService) Delete(deviceToDelete device.Device) error { - err := s.deviceStore.Delete(deviceToDelete) - if err != nil { - return err - } - if deviceToDelete.SBI().Type() == spb.Type_TYPE_PLUGIN { - err = s.sbiService.Delete(deviceToDelete.SBI()) - if err != nil { - return err - } - } - - if err := s.eventService.PublishEvent(DeviceEventTopic, event.NewDeleteEvent(deviceToDelete.ID())); err != nil { - log.Error(err) - } - - return nil -} - -func (s *DeviceService) createDeviceFromStore(loadedDevice device.LoadedDevice) (device.Device, error) { - if loadedDevice.SBI == "" { - return nil, fmt.Errorf("no sbi found for device") - } - - sbiForDevice, err := s.sbiService.Get(store.Query{ID: uuid.MustParse(loadedDevice.SBI)}) - if err != nil { - return nil, err - } - - d, err := NewDevice( - loadedDevice.Name, - uuid.MustParse(loadedDevice.ID), - &tpb.TransportOption{ - Address: loadedDevice.TransportAddress, - Username: loadedDevice.TransportUsername, - Password: loadedDevice.TransportPassword, - TransportOption: &tpb.TransportOption_GnmiTransportOption{ - GnmiTransportOption: &tpb.GnmiTransportOption{}, - }, - Type: spb.Type_TYPE_OPENCONFIG, - }, sbiForDevice) - if err != nil { - return nil, err - } - - // Create 'root' path to be able to load the whole model from the store. - path, err := ygot.StringToPath("/", ygot.StructuredPath) - if err != nil { - return nil, err - } - - // Use unmarshall from the devices SBI to unmarshall ygot json in go struct. - err = d.SBI().Unmarshal([]byte(loadedDevice.Model), path, d.GetModel()) - if err != nil { - return nil, err - } - - return d, nil -} diff --git a/controller/nucleus/deviceServiceMock.go b/controller/nucleus/deviceServiceMock.go deleted file mode 100644 index a738d5ae828938b6786e20956e8c78a5e4ae8423..0000000000000000000000000000000000000000 --- a/controller/nucleus/deviceServiceMock.go +++ /dev/null @@ -1,115 +0,0 @@ -package nucleus - -import ( - "code.fbi.h-da.de/danet/gosdn/controller/interfaces/device" - "code.fbi.h-da.de/danet/gosdn/controller/store" - "github.com/google/uuid" -) - -// DeviceServiceMock provides a in-memory implementation for multiple stores. -type DeviceServiceMock struct { - Store map[uuid.UUID]device.Device - nameLookupTable map[string]uuid.UUID -} - -// NewDeviceServiceMock returns a specific in-memory store for device service. -func NewDeviceServiceMock() device.Service { - return &DeviceServiceMock{ - Store: make(map[uuid.UUID]device.Device), - nameLookupTable: make(map[string]uuid.UUID), - } -} - -// Add adds a item device.Device. -func (t *DeviceServiceMock) Add(item device.Device) error { - _, ok := t.Store[item.ID()] - if ok { - return nil - } - - t.Store[item.ID()] = item - t.nameLookupTable[item.Name()] = item.ID() - - return nil -} - -// Update updates a item device.Device. -func (t *DeviceServiceMock) Update(item device.Device) error { - _, ok := t.Store[item.ID()] - if ok { - return nil - } - - t.Store[item.ID()] = item - t.nameLookupTable[item.Name()] = item.ID() - - return nil -} - -// UpdateModel updates a item device.Device. -func (t *DeviceServiceMock) UpdateModel(item device.Device, model string) error { - _, ok := t.Store[item.ID()] - if ok { - return nil - } - - t.Store[item.ID()] = item - t.nameLookupTable[item.Name()] = item.ID() - - return nil -} - -// Delete deletes a item device.Device. -func (t *DeviceServiceMock) Delete(item device.Device) error { - delete(t.Store, item.ID()) - - return nil -} - -// Get gets a item device.Device. -func (t *DeviceServiceMock) Get(query store.Query) (device.Device, error) { - // First search for direct hit on UUID. - item, ok := t.Store[query.ID] - if !ok { - // Second search for name - id, ok := t.nameLookupTable[query.Name] - if !ok { - return nil, nil - } - - item, ok := t.Store[id] - if !ok { - return nil, nil - } - - return item, nil - } - - return item, nil -} - -// GetAll gets all items. -func (t *DeviceServiceMock) GetAll() ([]device.Device, error) { - var allItems []device.Device - - for _, item := range t.Store { - allItems = append(allItems, item) - } - - return allItems, nil -} - -// GetAllAsLoaded gets all items as `device.LoadedDevice`. -func (t *DeviceServiceMock) GetAllAsLoaded() ([]device.LoadedDevice, error) { - var allItems []device.LoadedDevice - - for _, item := range t.Store { - allItems = append(allItems, device.LoadedDevice{ - ID: item.ID().String(), - Name: item.Name(), - SBI: item.SBI().ID().String(), - }) - } - - return allItems, nil -} diff --git a/controller/nucleus/deviceService_test.go b/controller/nucleus/deviceService_test.go deleted file mode 100644 index 0364bdf6601ec8229ddea8fe5c808043970a67fc..0000000000000000000000000000000000000000 --- a/controller/nucleus/deviceService_test.go +++ /dev/null @@ -1,112 +0,0 @@ -package nucleus - -import ( - "testing" - - eventservice "code.fbi.h-da.de/danet/gosdn/controller/eventService" - "code.fbi.h-da.de/danet/gosdn/controller/interfaces/device" - "code.fbi.h-da.de/danet/gosdn/controller/interfaces/southbound" - "code.fbi.h-da.de/danet/gosdn/controller/mocks" - "code.fbi.h-da.de/danet/gosdn/controller/store" - "github.com/google/uuid" - - spb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/southbound" -) - -func getMockDevice(deviceID uuid.UUID, sbi southbound.SouthboundInterface) device.Device { - return &CommonDevice{ - UUID: deviceID, - Model: sbi.Schema().Root, - sbi: sbi, - transport: &mocks.Transport{}, - } -} - -func getDeviceTestStores(t *testing.T, deviceID uuid.UUID) (device.Service, southbound.Service, device.Device, southbound.SouthboundInterface) { - eventService := eventservice.NewMockEventService() - sbiStore := NewMemorySbiStore() - deviceStore := NewMemoryDeviceStore() - sbiService := NewSbiService(sbiStore, eventService) - deviceService := NewDeviceService( - deviceStore, - sbiService, - eventService, - ) - - sbi, err := NewSBI(spb.Type_TYPE_OPENCONFIG) - if err != nil { - t.Error("could not create sbi") - } - - err = sbiService.Add(sbi) - if err != nil { - t.Error("could not add sbi") - } - - mockDevice := getMockDevice(deviceID, sbi) - err = deviceService.Add(mockDevice) - if err != nil { - t.Error("could not add device") - } - - return deviceService, sbiService, mockDevice, sbi -} - -func TestDeviceService_Get(t *testing.T) { - deviceID := uuid.New() - - deviceService, _, mockDevice, _ := getDeviceTestStores(t, deviceID) - - device, err := deviceService.Get(store.Query{ - ID: mockDevice.ID(), - Name: mockDevice.Name(), - }) - if err != nil { - t.Error("could not get device") - } - - if mockDevice.ID() != device.ID() { - t.Errorf("Expected ID=%s, got %s", mockDevice.ID(), device.ID()) - } -} - -func TestDeviceService_Delete(t *testing.T) { - deviceID := uuid.New() - - deviceService, _, mockDevice, _ := getDeviceTestStores(t, deviceID) - - device, err := deviceService.Get(store.Query{ - ID: mockDevice.ID(), - Name: mockDevice.Name(), - }) - if err != nil { - t.Error("could not get device") - } - - err = deviceService.Delete(device) - if err != nil { - t.Error("could not delete device") - } -} - -func TestDeviceService_GetAll(t *testing.T) { - deviceID := uuid.New() - deviceID2 := uuid.New() - - deviceService, _, _, sbi := getDeviceTestStores(t, deviceID) - mockDevice2 := getMockDevice(deviceID2, sbi) - - err := deviceService.Add(mockDevice2) - if err != nil { - t.Error("could not add device") - } - - devices, err := deviceService.GetAll() - if err != nil { - t.Error("could not get all devices") - } - - if len(devices) != 2 { - t.Errorf("Expected len(devices)=2, got %d", len(devices)) - } -} diff --git a/controller/nucleus/deviceStore.go b/controller/nucleus/deviceStore.go deleted file mode 100644 index 22db669671e533f11c12c68efdb1aa59a9422941..0000000000000000000000000000000000000000 --- a/controller/nucleus/deviceStore.go +++ /dev/null @@ -1,28 +0,0 @@ -package nucleus - -import ( - "fmt" - - "code.fbi.h-da.de/danet/gosdn/controller/interfaces/device" - "code.fbi.h-da.de/danet/gosdn/controller/store" - - "github.com/google/uuid" - log "github.com/sirupsen/logrus" -) - -// NewDeviceStore returns a DeviceStore. -func NewDeviceStore(pndUUID uuid.UUID) device.Store { - storeMode := store.GetStoreMode() - log.Debugf("StoreMode: %s", storeMode) - - switch storeMode { - case store.Database: - return &DatabaseDeviceStore{ - storeName: fmt.Sprintf("device-store-%s.json", pndUUID.String()), - } - - default: - store := NewFilesystemDeviceStore(pndUUID) - return store - } -} diff --git a/controller/nucleus/gnmi_transport.go b/controller/nucleus/gnmi_transport.go index 31ca51feb04ec114752989a218226ac96a2fc66f..eb1ea0e2409808f3a169a62b58ddd292d5b1c3ee 100644 --- a/controller/nucleus/gnmi_transport.go +++ b/controller/nucleus/gnmi_transport.go @@ -246,7 +246,7 @@ func (g *Gnmi) ProcessResponse(resp interface{}, root interface{}, s *ytypes.Sch return nil } -// ProcessControlPlaneSubscribeResponse processes the gNMI notification within the subscribe response, updating the provided device model. +// ProcessControlPlaneSubscribeResponse processes the gNMI notification within the subscribe response, updating the provided network element model. func (g *Gnmi) ProcessControlPlaneSubscribeResponse(resp *gpb.SubscribeResponse_Update, root any, schema *ytypes.Schema) error { dModel, ok := root.(ygot.ValidatedGoStruct) if !ok { @@ -408,7 +408,7 @@ func (g *Gnmi) subscribe(ctx context.Context) error { return gnmi.SubscribeErr(ctx, g.client, opts, g.RespChan) } -// controlPlaneSubscribe calls gNMI subscribe with a callback for responses and additional device information including +// controlPlaneSubscribe calls gNMI subscribe with a callback for responses and additional network element information including // an option to stop the subscription. func (g *Gnmi) controlPlaneSubscribe(ctx context.Context, subcribeCallbackFunc func(*gpb.SubscribeResponse, *tpInterface.SubscriptionInformation), subscriptionInfo *tpInterface.SubscriptionInformation) error { diff --git a/controller/nucleus/initialise_test.go b/controller/nucleus/initialise_test.go index 3b1ace8cbbf1cee1a29cccf058bf340cf8aa7215..6a66fc3fabb5c3296c91cf255b7fe4475ea01e1b 100644 --- a/controller/nucleus/initialise_test.go +++ b/controller/nucleus/initialise_test.go @@ -9,10 +9,10 @@ import ( "time" eventservice "code.fbi.h-da.de/danet/gosdn/controller/eventService" - "code.fbi.h-da.de/danet/gosdn/controller/interfaces/device" "code.fbi.h-da.de/danet/gosdn/controller/store" tpb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/transport" + "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkelement" "code.fbi.h-da.de/danet/gosdn/controller/mocks" "code.fbi.h-da.de/danet/gosdn/controller/nucleus/util/proto" @@ -26,7 +26,7 @@ import ( ) // UUIDs for test cases. -var did uuid.UUID +var mneid uuid.UUID var mdid uuid.UUID var defaultSbiID uuid.UUID var defaultPndID uuid.UUID @@ -108,7 +108,7 @@ func newGnmiTransportOptions() *tpb.TransportOption { func readTestUUIDs() { var err error - did, err = uuid.Parse("4d8246f8-e884-41d6-87f5-c2c784df9e44") + mneid, err = uuid.Parse("4d8246f8-e884-41d6-87f5-c2c784df9e44") if err != nil { log.Fatal(err) } @@ -142,9 +142,9 @@ func readTestUUIDs() { } } -func mockDevice() device.Device { +func mockNetworkElement() networkelement.NetworkElement { sbi := &OpenConfig{} - return &CommonDevice{ + return &CommonNetworkElement{ UUID: mdid, Model: sbi.Schema().Root, sbi: sbi, @@ -156,21 +156,21 @@ func newPnd() pndImplementation { eventService := eventservice.NewMockEventService() sbiStore := NewMemorySbiStore() - deviceStore := NewMemoryDeviceStore() + deviceStore := NewMemoryNetworkElementStore() sbiService := NewSbiService(sbiStore, eventService) - deviceService := NewDeviceService( + deviceService := NewNetworkElementService( deviceStore, sbiService, eventService, ) return pndImplementation{ - Name: "default", - Description: "default test pnd", - southboundService: sbiService, - deviceService: deviceService, - changes: store.NewChangeStore(), - Id: defaultPndID, + Name: "default", + Description: "default test pnd", + southboundService: sbiService, + networkElementService: deviceService, + changes: store.NewChangeStore(), + Id: defaultPndID, } } diff --git a/controller/nucleus/memoryDeviceStore.go b/controller/nucleus/memoryDeviceStore.go deleted file mode 100644 index 6fc400b425fb50a9ad721cd161f323f1c640dacf..0000000000000000000000000000000000000000 --- a/controller/nucleus/memoryDeviceStore.go +++ /dev/null @@ -1,111 +0,0 @@ -package nucleus - -import ( - "encoding/json" - - "code.fbi.h-da.de/danet/gosdn/controller/customerrs" - "code.fbi.h-da.de/danet/gosdn/controller/interfaces/device" - "code.fbi.h-da.de/danet/gosdn/controller/store" -) - -// MemoryDeviceStore provides a in-memory implementation for devices. -type MemoryDeviceStore struct { - Store map[string]device.LoadedDevice - nameLookupTable map[string]string -} - -// NewMemoryDeviceStore returns a specific in-memory store for devices. -func NewMemoryDeviceStore() device.Store { - return &MemoryDeviceStore{ - Store: make(map[string]device.LoadedDevice), - nameLookupTable: make(map[string]string), - } -} - -// Add adds a item to the store. -func (t *MemoryDeviceStore) Add(item device.Device) error { - var device device.LoadedDevice - - b, err := json.Marshal(item) - if err != nil { - return err - } - err = json.Unmarshal(b, &device) - if err != nil { - return err - } - - _, ok := t.Store[device.ID] - if ok { - return nil - } - - t.Store[device.ID] = device - t.nameLookupTable[item.Name()] = device.ID - - return nil -} - -// Update updates a existing device. -func (t *MemoryDeviceStore) Update(item device.Device) error { - _, ok := t.Store[item.ID().String()] - if !ok { - return customerrs.CouldNotFindError{ID: item.ID(), Name: item.Name()} - } - - var device device.LoadedDevice - - b, err := json.Marshal(item) - if err != nil { - return err - } - err = json.Unmarshal(b, &device) - if err != nil { - return err - } - - t.Store[item.ID().String()] = device - t.nameLookupTable[item.Name()] = item.ID().String() - - return nil -} - -// Delete deletes a device from the device store. -func (t *MemoryDeviceStore) Delete(item device.Device) error { - delete(t.Store, item.ID().String()) - - return nil -} - -// Get takes a Device's UUID or name and returns the Device. -func (t *MemoryDeviceStore) Get(query store.Query) (device.LoadedDevice, error) { - // First search for direct hit on UUID. - item, ok := t.Store[query.ID.String()] - if !ok { - // Second search for name - id, ok := t.nameLookupTable[query.Name] - if !ok { - return item, customerrs.CouldNotFindError{ID: query.ID, Name: query.Name} - } - - item, ok := t.Store[id] - if !ok { - return item, customerrs.CouldNotFindError{ID: query.ID, Name: query.Name} - } - - return item, nil - } - - return item, nil -} - -// GetAll returns all stored devices. -func (t *MemoryDeviceStore) GetAll() ([]device.LoadedDevice, error) { - var allItems []device.LoadedDevice - - for _, item := range t.Store { - allItems = append(allItems, item) - } - - return allItems, nil -} diff --git a/controller/nucleus/memoryNetworkElementStore.go b/controller/nucleus/memoryNetworkElementStore.go new file mode 100644 index 0000000000000000000000000000000000000000..100410af71bffe51c7e8f46404194d2e780f4a73 --- /dev/null +++ b/controller/nucleus/memoryNetworkElementStore.go @@ -0,0 +1,111 @@ +package nucleus + +import ( + "encoding/json" + + "code.fbi.h-da.de/danet/gosdn/controller/customerrs" + "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkelement" + "code.fbi.h-da.de/danet/gosdn/controller/store" +) + +// MemoryNetworkElementStore provides a in-memory implementation for network elements. +type MemoryNetworkElementStore struct { + Store map[string]networkelement.LoadedNetworkElement + nameLookupTable map[string]string +} + +// NewMemoryNetworkElementStore returns a specific in-memory store for network elements. +func NewMemoryNetworkElementStore() networkelement.Store { + return &MemoryNetworkElementStore{ + Store: make(map[string]networkelement.LoadedNetworkElement), + nameLookupTable: make(map[string]string), + } +} + +// Add adds a item to the store. +func (t *MemoryNetworkElementStore) Add(item networkelement.NetworkElement) error { + var mne networkelement.LoadedNetworkElement + + b, err := json.Marshal(item) + if err != nil { + return err + } + err = json.Unmarshal(b, &mne) + if err != nil { + return err + } + + _, ok := t.Store[mne.ID] + if ok { + return nil + } + + t.Store[mne.ID] = mne + t.nameLookupTable[item.Name()] = mne.ID + + return nil +} + +// Update updates a existing network element. +func (t *MemoryNetworkElementStore) Update(item networkelement.NetworkElement) error { + _, ok := t.Store[item.ID().String()] + if !ok { + return customerrs.CouldNotFindError{ID: item.ID(), Name: item.Name()} + } + + var mne networkelement.LoadedNetworkElement + + b, err := json.Marshal(item) + if err != nil { + return err + } + err = json.Unmarshal(b, &mne) + if err != nil { + return err + } + + t.Store[item.ID().String()] = mne + t.nameLookupTable[item.Name()] = item.ID().String() + + return nil +} + +// Delete deletes a network element from the network element store. +func (t *MemoryNetworkElementStore) Delete(item networkelement.NetworkElement) error { + delete(t.Store, item.ID().String()) + + return nil +} + +// Get takes a network element's UUID or name and returns the network element. +func (t *MemoryNetworkElementStore) Get(query store.Query) (networkelement.LoadedNetworkElement, error) { + // First search for direct hit on UUID. + item, ok := t.Store[query.ID.String()] + if !ok { + // Second search for name + id, ok := t.nameLookupTable[query.Name] + if !ok { + return item, customerrs.CouldNotFindError{ID: query.ID, Name: query.Name} + } + + item, ok := t.Store[id] + if !ok { + return item, customerrs.CouldNotFindError{ID: query.ID, Name: query.Name} + } + + return item, nil + } + + return item, nil +} + +// GetAll returns all stored network elements. +func (t *MemoryNetworkElementStore) GetAll() ([]networkelement.LoadedNetworkElement, error) { + var allItems []networkelement.LoadedNetworkElement + + for _, item := range t.Store { + allItems = append(allItems, item) + } + + return allItems, nil +} diff --git a/controller/nucleus/memoryPndStore.go b/controller/nucleus/memoryPndStore.go index 7cb549236657fa6076e763733d403df2332f8fca..e454095a2c6da10dac1edb8d28c890d2dae91051 100644 --- a/controller/nucleus/memoryPndStore.go +++ b/controller/nucleus/memoryPndStore.go @@ -2,8 +2,8 @@ package nucleus import ( "code.fbi.h-da.de/danet/gosdn/controller/customerrs" - "code.fbi.h-da.de/danet/gosdn/controller/interfaces/device" "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkdomain" + "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkelement" "code.fbi.h-da.de/danet/gosdn/controller/store" "github.com/google/uuid" ) @@ -11,14 +11,14 @@ import ( // MemoryPndStore provides a in-memory implementation for a pnd store. type MemoryPndStore struct { Store map[uuid.UUID]networkdomain.NetworkDomain - pendingChannels map[uuid.UUID]chan device.Details + pendingChannels map[uuid.UUID]chan networkelement.Details } // NewMemoryPndStore returns a in-memory implementation for a pnd store. func NewMemoryPndStore() networkdomain.PndStore { return &MemoryPndStore{ Store: make(map[uuid.UUID]networkdomain.NetworkDomain), - pendingChannels: make(map[uuid.UUID]chan device.Details), + pendingChannels: make(map[uuid.UUID]chan networkelement.Details), } } @@ -64,7 +64,7 @@ func (t *MemoryPndStore) GetAll() ([]networkdomain.NetworkDomain, error) { // PendingChannels holds channels used communicate with pending // cSBI deployments. -func (t *MemoryPndStore) PendingChannels(id uuid.UUID, parseErrors ...error) (chan device.Details, error) { +func (t *MemoryPndStore) PendingChannels(id uuid.UUID, parseErrors ...error) (chan networkelement.Details, error) { ch, ok := t.pendingChannels[id] if !ok { return nil, &customerrs.CouldNotFindError{ID: id} @@ -73,7 +73,7 @@ func (t *MemoryPndStore) PendingChannels(id uuid.UUID, parseErrors ...error) (ch } // AddPendingChannel adds a pending channel to the map. -func (t *MemoryPndStore) AddPendingChannel(id uuid.UUID, ch chan device.Details) { +func (t *MemoryPndStore) AddPendingChannel(id uuid.UUID, ch chan networkelement.Details) { t.pendingChannels[id] = ch } diff --git a/controller/nucleus/metrics.go b/controller/nucleus/metrics.go index fb151fde466811a7e4b00c497ea636c50cffebf9..d8a4b3b04eedc4b818a8c859f295e168f65746f9 100644 --- a/controller/nucleus/metrics.go +++ b/controller/nucleus/metrics.go @@ -6,7 +6,7 @@ import ( ) var ( - deviceCreationsTotal = promauto.NewCounterVec( + networkElementCreationsTotal = promauto.NewCounterVec( prometheus.CounterOpts{ Name: "device_creations_total", Help: "Total number of created devices", @@ -14,7 +14,7 @@ var ( []string{"type"}, ) - deviceCreationDurationSecondsTotal = promauto.NewCounterVec( + networkElementCreationDurationSecondsTotal = promauto.NewCounterVec( prometheus.CounterOpts{ Name: "device_creation_duration_seconds_total", Help: "Total time needed to create devices", @@ -22,15 +22,15 @@ var ( []string{"type"}, ) - deviceCreationDurationSeconds = promauto.NewHistogramVec( + networkElementCreationDurationSeconds = promauto.NewHistogramVec( prometheus.HistogramOpts{ Name: "device_creation_duration_seconds", - Help: "Histogram of device creation times", + Help: "Histogram of network element creation times", }, []string{"type"}, ) - deviceDeletionsTotal = promauto.NewCounterVec( + networkElementDeletionsTotal = promauto.NewCounterVec( prometheus.CounterOpts{ Name: "device_deletions_total", Help: "Total number of deleted devices", @@ -38,7 +38,7 @@ var ( []string{"type"}, ) - deviceDeletionDurationSecondsTotal = promauto.NewCounterVec( + networkElementDeletionDurationSecondsTotal = promauto.NewCounterVec( prometheus.CounterOpts{ Name: "device_deletion_duration_seconds_total", Help: "Total time needed to delete devices", @@ -46,10 +46,10 @@ var ( []string{"type"}, ) - deviceDeletionDurationSeconds = promauto.NewHistogramVec( + networkElementDeletionDurationSeconds = promauto.NewHistogramVec( prometheus.HistogramOpts{ Name: "device_deletion_duration_seconds", - Help: "Histogram of device deletion times", + Help: "Histogram of network element deletion times", }, []string{"type"}, ) diff --git a/controller/nucleus/networkElement.go b/controller/nucleus/networkElement.go new file mode 100644 index 0000000000000000000000000000000000000000..379c468589bf53be840edc01dfa9fcaef39c6293 --- /dev/null +++ b/controller/nucleus/networkElement.go @@ -0,0 +1,358 @@ +package nucleus + +import ( + "encoding/json" + + spb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/southbound" + tpb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/transport" + "code.fbi.h-da.de/danet/gosdn/controller/customerrs" + "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkelement" + "code.fbi.h-da.de/danet/gosdn/controller/interfaces/southbound" + "code.fbi.h-da.de/danet/gosdn/controller/interfaces/transport" + "github.com/docker/docker/pkg/namesgenerator" + "github.com/google/uuid" + "github.com/openconfig/ygot/ygot" + "go.mongodb.org/mongo-driver/bson" + "google.golang.org/protobuf/proto" +) + +// NewNetworkElement creates a network element. +func NewNetworkElement(name string, uuidInput uuid.UUID, opt *tpb.TransportOption, sbi southbound.SouthboundInterface) (networkelement.NetworkElement, error) { + t, err := NewTransport(opt, sbi) + if err != nil { + return nil, err + } + + // TODO: this needs to check the case that the uuidInput is set, as the + // same uuid may be already stored. + if uuidInput == uuid.Nil { + uuidInput = uuid.New() + } + + if name == "" { + name = namesgenerator.GetRandomName(0) + } + + // We want a representation of the MNE's config (the SBI-schema's root created through ygot), + // but do not want to work on the sbi.Schema() directly. + // So the root of sbi.Schema() is never changed when a set or get on a network element will be called. + root, err := ygot.DeepCopy(sbi.Schema().Root) + if err != nil { + return nil, err + } + ygotDeepCopy, ok := root.(ygot.GoStruct) + if !ok { + return nil, &customerrs.InvalidTypeAssertionError{ + Value: root, + Type: (*ygot.ValidatedGoStruct)(nil), + } + } + + if opt.Type == spb.Type_TYPE_CONTAINERISED { + return &CsbiNetworkElement{ + CommonNetworkElement: CommonNetworkElement{ + UUID: uuidInput, + Model: ygotDeepCopy, + sbi: sbi, + transport: t, + name: name, + transportOptions: opt, + }, + }, nil + } + + return &CommonNetworkElement{ + UUID: uuidInput, + Model: ygotDeepCopy, + sbi: sbi, + transport: t, + name: name, + transportOptions: opt, + }, nil +} + +// CommonNetworkElement represents an MNE. +type CommonNetworkElement struct { + // UUID represents the Network Elements UUID + UUID uuid.UUID + + // Network Element embeds a ygot.GoStruct containing the network element details + Model ygot.GoStruct + + // SBI is the network element's southbound interface implementation + sbi southbound.SouthboundInterface + + // Transport is the network element's Transport implementation + transport transport.Transport + + // Name is the network element's human readable name + name string + + transportOptions *tpb.TransportOption +} + +// ID returns the UUID of the Network Element. +func (n *CommonNetworkElement) ID() uuid.UUID { + return n.UUID +} + +// GetModel returns the ygot representation of the Network Element. +func (n *CommonNetworkElement) GetModel() ygot.GoStruct { + return n.Model +} + +// CreateModelCopy returns a copy of the ygot representation of the Network Element. +func (n *CommonNetworkElement) CreateModelCopy() (ygot.ValidatedGoStruct, error) { + return createValidatedCopy(n) +} + +// Transport returns the Transport of the network element. +func (n *CommonNetworkElement) Transport() transport.Transport { + return n.transport +} + +// TransportAddress returns the TransportAddress of the network element. +func (n *CommonNetworkElement) TransportAddress() string { + return n.transportOptions.Address +} + +// Name returns the name of the network element. +func (n *CommonNetworkElement) Name() string { + return n.name +} + +// SBI returns the sbi of the Network Element. +func (n *CommonNetworkElement) SBI() southbound.SouthboundInterface { + return n.sbi +} + +// SetTransport sets the Network Element's Transport. +func (n *CommonNetworkElement) SetTransport(t transport.Transport) { + n.transport = t +} + +// SetName sets the Network Element's name. +func (n *CommonNetworkElement) SetName(name string) { + n.name = name +} + +// SetSBI sets the Network Element's SBI. +func (n *CommonNetworkElement) SetSBI(sbi southbound.SouthboundInterface) { + n.sbi = sbi +} + +// ProcessResponse processes a response for the Network Element. +func (n *CommonNetworkElement) ProcessResponse(resp proto.Message) error { + return n.transport.ProcessResponse(resp, n.Model, n.sbi.Schema()) +} + +// IsTransportValid returns a boolean if the transport of a network element is valid. +func (n *CommonNetworkElement) IsTransportValid() bool { + if n.transportOptions != nil && n.transportOptions.Address != "" { + return true + } + + return false +} + +// CsbiNetworkElement is used for the cSBI functionality. +type CsbiNetworkElement struct { + CommonNetworkElement +} + +// ID returns the UUID of the Network Element. +func (n *CsbiNetworkElement) ID() uuid.UUID { + return n.UUID +} + +// GetModel returns the ygot representation of the Network Element. +func (n *CsbiNetworkElement) GetModel() ygot.GoStruct { + return n.Model +} + +// CreateModelCopy returns a copy of the ygot representation of the Network Element. +func (n *CsbiNetworkElement) CreateModelCopy() (ygot.ValidatedGoStruct, error) { + return createValidatedCopy(n) +} + +// Transport returns the Transport of the network element. +func (n *CsbiNetworkElement) Transport() transport.Transport { + return n.transport +} + +// Name returns the name of the network element. +func (n *CsbiNetworkElement) Name() string { + return n.name +} + +// SBI returns the sbi of the Network Element. +func (n *CsbiNetworkElement) SBI() southbound.SouthboundInterface { + return n.sbi +} + +// ProcessResponse processes a response for the Network Element. +func (n *CsbiNetworkElement) ProcessResponse(resp proto.Message) error { + // TODO: callback to send response to caller + return n.transport.ProcessResponse(resp, n.Model, n.sbi.Schema()) +} + +func createValidatedCopy(n networkelement.NetworkElement) (ygot.ValidatedGoStruct, error) { + cpy, err := ygot.DeepCopy(n.GetModel()) + ygot.BuildEmptyTree(cpy) + if err != nil { + return nil, err + } + + validatedCpy, ok := cpy.(ygot.ValidatedGoStruct) + if !ok { + return nil, customerrs.InvalidTypeAssertionError{ + Value: validatedCpy, + Type: (*ygot.ValidatedGoStruct)(nil), + } + } + + return validatedCpy, nil +} + +// IsTransportValid returns a boolean if the transport of a network element is valid. +func (n *CsbiNetworkElement) IsTransportValid() bool { + if n.transportOptions != nil && n.transportOptions.Address != "" { + return true + } + + return false +} + +// MarshalJSON implements the MarshalJSON interface to store a network element as JSON. +func (n *CommonNetworkElement) MarshalJSON() ([]byte, error) { + var transportType string + var transportAddress string + var transportUsername string + var transportPassword string + var transportOptionType spb.Type + + // Handling of these cases is necessary as we use partial network elements for testing. + // eg. in most tests no transport or sbi is defined. + // The marshaller will crash if we want to access a nil field. + if n.transport == nil || n.transportOptions == nil { + transportType = "testing" + transportAddress = "testing" + transportUsername = "testing" + transportPassword = "testing" + transportOptionType = spb.Type_TYPE_OPENCONFIG + } else { + transportType = n.transport.Type() + transportAddress = n.transportOptions.Address + transportUsername = n.transportOptions.Username + transportPassword = n.transportOptions.Password + transportOptionType = n.transportOptions.Type + } + + var sbiUUID uuid.UUID + + if n.sbi == nil { + sbiUUID = uuid.UUID{} + } else { + sbiUUID = n.sbi.ID() + } + + modelAsString, err := ygot.EmitJSON(n.Model, n.getYgotEmitJSONConfig()) + if err != nil { + return []byte{}, err + } + + return json.Marshal(&struct { + ID uuid.UUID `json:"id,omitempty"` + Name string `json:"name,omitempty"` + TransportType string `json:"transport_type,omitempty"` + TransportAddress string `json:"transport_address,omitempty"` + TransportUsername string `json:"transport_username,omitempty"` + TransportPassword string `json:"transport_password,omitempty"` + TransportOptionType spb.Type `json:"transport_option"` + SBI uuid.UUID `json:"sbi,omitempty"` + Model string `bson:"model,omitempty"` + }{ + ID: n.ID(), + Name: n.Name(), + TransportType: transportType, + TransportAddress: transportAddress, + TransportUsername: transportUsername, + TransportPassword: transportPassword, + TransportOptionType: transportOptionType, + SBI: sbiUUID, + Model: modelAsString, + }) +} + +// MarshalBSON implements the MarshalBSON interface to store a network element as BSON. +func (n *CommonNetworkElement) MarshalBSON() ([]byte, error) { + var transportType string + var transportAddress string + var transportUsername string + var transportPassword string + var transportOptionType spb.Type + + // Handling of these cases is necessary as we use partial network elements for testing. + // eg. in most tests no transport or sbi is defined. + // The marshaller will crash if we want to access a nil field. + if n.transport == nil || n.transportOptions == nil { + transportType = "testing" + transportAddress = "testing" + transportUsername = "testing" + transportPassword = "testing" + transportOptionType = spb.Type_TYPE_OPENCONFIG + } else { + transportType = n.transport.Type() + transportAddress = n.transportOptions.Address + transportUsername = n.transportOptions.Username + transportPassword = n.transportOptions.Password + transportOptionType = n.transportOptions.Type + } + + modelAsString, err := ygot.EmitJSON(n.Model, n.getYgotEmitJSONConfig()) + if err != nil { + return []byte{}, err + } + + return bson.Marshal(&struct { + ID string `bson:"_id,omitempty"` + Name string `bson:"name,omitempty"` + TransportType string `bson:"transport_type,omitempty"` + TransportAddress string `bson:"transport_address,omitempty"` + TransportUsername string `bson:"transport_username,omitempty"` + TransportPassword string `bson:"transport_password,omitempty"` + TransportOptionType spb.Type `bson:"transport_option"` + SBI string `bson:"sbi,omitempty"` + Model string `bson:"model,omitempty"` + }{ + ID: n.ID().String(), + Name: n.Name(), + TransportType: transportType, + TransportAddress: transportAddress, + TransportUsername: transportUsername, + TransportPassword: transportPassword, + TransportOptionType: transportOptionType, + SBI: n.sbi.ID().String(), + Model: modelAsString, + }) +} + +// GetModelAsString returns the YANG model of a network element as string. +func (n *CommonNetworkElement) GetModelAsString() (string, error) { + modelAsString, err := ygot.EmitJSON(n.Model, n.getYgotEmitJSONConfig()) + if err != nil { + return "", err + } + + return modelAsString, nil +} + +func (n *CommonNetworkElement) getYgotEmitJSONConfig() *ygot.EmitJSONConfig { + return &ygot.EmitJSONConfig{ + Format: ygot.RFC7951, + Indent: "", + SkipValidation: true, + RFC7951Config: &ygot.RFC7951JSONConfig{ + AppendModuleName: true, + }} +} diff --git a/controller/nucleus/networkElementFilesystemStore.go b/controller/nucleus/networkElementFilesystemStore.go new file mode 100644 index 0000000000000000000000000000000000000000..251fb229a59af45d4d125d5f8f72991f5b40dad2 --- /dev/null +++ b/controller/nucleus/networkElementFilesystemStore.go @@ -0,0 +1,178 @@ +package nucleus + +import ( + "encoding/json" + "os" + "sync" + + "code.fbi.h-da.de/danet/gosdn/controller/customerrs" + "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkelement" + "code.fbi.h-da.de/danet/gosdn/controller/store" + "github.com/google/uuid" + log "github.com/sirupsen/logrus" +) + +// FilesystemNetworkElementStore is the filesystem implementation of the network element store. +type FilesystemNetworkElementStore struct { + pndUUID uuid.UUID + fileMutex sync.Mutex + pathToNetworkElementFile string +} + +// NewFilesystemNetworkElementStore returns a filesystem implementation for a pnd store. +func NewFilesystemNetworkElementStore(pndUUID uuid.UUID) networkelement.Store { + networkElementFilenameForUUID := store.GetStoreFilenameForUUID(pndUUID, store.NetworkElementFilenameSuffix) + + if err := store.EnsureFilesystemStorePathExists(networkElementFilenameForUUID); err != nil { + log.Error(err) + } + return &FilesystemNetworkElementStore{ + pathToNetworkElementFile: store.GetCompletePathToFileStore(networkElementFilenameForUUID), + fileMutex: sync.Mutex{}, + pndUUID: pndUUID, + } +} + +func (s *FilesystemNetworkElementStore) readAllNetworkElementsFromFile() ([]networkelement.LoadedNetworkElement, error) { + var loadedNetworkElements []networkelement.LoadedNetworkElement + + content, err := os.ReadFile(s.pathToNetworkElementFile) + if err != nil { + return nil, err + } + + err = json.Unmarshal(content, &loadedNetworkElements) + if err != nil { + return nil, err + } + + return loadedNetworkElements, nil +} + +func (s *FilesystemNetworkElementStore) writeAllNetworkElementsToFile(mnes []networkelement.LoadedNetworkElement) error { + serializedData, err := json.Marshal(mnes) + if err != nil { + return err + } + + err = os.WriteFile(s.pathToNetworkElementFile, serializedData, 0600) + if err != nil { + return err + } + + return nil +} + +// Get takes a network element's UUID or name and returns the network element. +func (s *FilesystemNetworkElementStore) Get(query store.Query) (networkelement.LoadedNetworkElement, error) { + s.fileMutex.Lock() + defer s.fileMutex.Unlock() + + var lMNE networkelement.LoadedNetworkElement + + mnes, err := s.readAllNetworkElementsFromFile() + if err != nil { + return lMNE, err + } + + for _, mne := range mnes { + if mne.ID == query.ID.String() || mne.Name == query.Name { + return mne, nil + } + } + + return lMNE, &customerrs.CouldNotFindError{ID: query.ID, Name: query.Name} +} + +// GetAll returns all stored network elements. +func (s *FilesystemNetworkElementStore) GetAll() ([]networkelement.LoadedNetworkElement, error) { + s.fileMutex.Lock() + defer s.fileMutex.Unlock() + + mnes, err := s.readAllNetworkElementsFromFile() + + return mnes, err +} + +// Add adds a network element to the network element store. +func (s *FilesystemNetworkElementStore) Add(networkElementToAdd networkelement.NetworkElement) error { + s.fileMutex.Lock() + defer s.fileMutex.Unlock() + + mnes, err := s.readAllNetworkElementsFromFile() + if err != nil { + return err + } + + var loadedNetworkElement networkelement.LoadedNetworkElement + loadedNetworkElement, err = store.TransformObjectToLoadedObject[networkelement.NetworkElement, networkelement.LoadedNetworkElement](networkElementToAdd) + if err != nil { + return err + } + + mnes = append(mnes, loadedNetworkElement) + + err = s.writeAllNetworkElementsToFile(mnes) + if err != nil { + return err + } + + return nil +} + +// Update updates a existing network element. +func (s *FilesystemNetworkElementStore) Update(networkElementToUpdate networkelement.NetworkElement) error { + s.fileMutex.Lock() + defer s.fileMutex.Unlock() + + loadedNetworkElementToUpdate, err := store.TransformObjectToLoadedObject[networkelement.NetworkElement, networkelement.LoadedNetworkElement](networkElementToUpdate) + if err != nil { + return err + } + + mnes, err := s.readAllNetworkElementsFromFile() + if err != nil { + return err + } + + for i, mne := range mnes { + if mne.ID == networkElementToUpdate.ID().String() { + mnes[i] = loadedNetworkElementToUpdate + err = s.writeAllNetworkElementsToFile(mnes) + if err != nil { + return err + } + return nil + } + } + + return &customerrs.CouldNotUpdateError{Identifier: networkElementToUpdate.ID(), Type: networkElementToUpdate, Err: err} +} + +// Delete deletes a network element from the network element store. +func (s *FilesystemNetworkElementStore) Delete(networkElementToDelete networkelement.NetworkElement) error { + s.fileMutex.Lock() + defer s.fileMutex.Unlock() + + mnes, err := s.readAllNetworkElementsFromFile() + if err != nil { + return err + } + + for i, mne := range mnes { + if mne.ID == networkElementToDelete.ID().String() { + //remove item from slice + mnes[i] = mnes[len(mnes)-1] + mnes = mnes[:len(mnes)-1] + + err = s.writeAllNetworkElementsToFile(mnes) + if err != nil { + return err + } + + return nil + } + } + + return &customerrs.CouldNotDeleteError{Identifier: networkElementToDelete.ID(), Type: networkElementToDelete, Err: err} +} diff --git a/controller/nucleus/networkElementFilesystemStore_test.go b/controller/nucleus/networkElementFilesystemStore_test.go new file mode 100644 index 0000000000000000000000000000000000000000..0b6ba8a3193599a741417b8eec19c3b7e5fd7d21 --- /dev/null +++ b/controller/nucleus/networkElementFilesystemStore_test.go @@ -0,0 +1,244 @@ +package nucleus + +import ( + "testing" + + spb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/southbound" + tpb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/transport" + "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkelement" + "code.fbi.h-da.de/danet/gosdn/controller/store" + "github.com/google/uuid" +) + +func returnBasicTransportOption() tpb.TransportOption { + return tpb.TransportOption{ + Address: "test:///", + Username: "test", + Password: "test", + TransportOption: &tpb.TransportOption_GnmiTransportOption{ + GnmiTransportOption: &tpb.GnmiTransportOption{ + Compression: "", + GrpcDialOptions: nil, + Token: "", + Encoding: 0, + }, + }, + } +} + +func TestAddNetworkElement(t *testing.T) { + defer ensureStoreFileForTestsIsRemoved(store.NetworkElementFilenameSuffix) + + pndID, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad") + mneID, _ := uuid.Parse("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa") + sbiID1, _ := uuid.Parse("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa") + trop := returnBasicTransportOption() + + sbi1, _ := NewSBI(spb.Type_TYPE_OPENCONFIG, sbiID1) + + networkElementStore := NewNetworkElementStore(pndID) + mne, _ := NewNetworkElement("testNetworkElement", mneID, &trop, sbi1) + + err := networkElementStore.Add(mne) + if err != nil { + t.Error(err) + } +} + +func TestGetAllNetworkElements(t *testing.T) { + defer ensureStoreFileForTestsIsRemoved(store.NetworkElementFilenameSuffix) + + pndID, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad") + networkElementStore := NewNetworkElementStore(pndID) + + sbiID, _ := uuid.Parse("ssssssss-ssss-ssss-ssss-ssssssssssss") + sbi, _ := NewSBI(spb.Type_TYPE_OPENCONFIG, sbiID) + + mneID1, _ := uuid.Parse("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa") + mneID2, _ := uuid.Parse("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaab") + + transportOptions := returnBasicTransportOption() + + mne1, err := NewNetworkElement("testname", mneID1, &transportOptions, sbi) + if err != nil { + t.Error(err) + } + + mne2, err := NewNetworkElement("testname2", mneID2, &transportOptions, sbi) + if err != nil { + t.Error(err) + } + + inputNetworkElements := [2]networkelement.NetworkElement{mne1, mne2} + + for _, mne := range inputNetworkElements { + err := networkElementStore.Add(mne) + if err != nil { + t.Error(err) + } + } + + returnedNetworkElements, err := networkElementStore.GetAll() + if err != nil { + t.Error(err) + } + + length := len(returnedNetworkElements) + if length != 2 { + t.Errorf("GetAll() length of array = %v, want %v", length, 2) + } + + for i, mne := range returnedNetworkElements { + if mne.ID != inputNetworkElements[i].ID().String() { + t.Errorf("GetAll() = %v, want %v", mne.ID, inputNetworkElements[i].ID().String()) + } + if mne.Name != inputNetworkElements[i].Name() { + t.Errorf("GetAll() = %v, want %v", mne.Name, inputNetworkElements[i].Name()) + } + } +} + +func TestGetNetworkElement(t *testing.T) { + defer ensureStoreFileForTestsIsRemoved(store.NetworkElementFilenameSuffix) + + pndID, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad") + networkElementStore := NewNetworkElementStore(pndID) + + sbiID, _ := uuid.Parse("ssssssss-ssss-ssss-ssss-ssssssssssss") + sbi, _ := NewSBI(spb.Type_TYPE_OPENCONFIG, sbiID) + + mneID1, _ := uuid.Parse("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa") + mneID2, _ := uuid.Parse("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaab") + + trop := returnBasicTransportOption() + + mne1, err := NewNetworkElement("testname", mneID1, &trop, sbi) + if err != nil { + t.Error(err) + } + + mne2, err := NewNetworkElement("testname2", mneID2, &trop, sbi) + if err != nil { + t.Error(err) + } + + inputNetworkElements := [2]networkelement.NetworkElement{mne1, mne2} + + for _, mne := range inputNetworkElements { + err := networkElementStore.Add(mne) + if err != nil { + t.Error(err) + } + } + + returnNetworkElement, err := networkElementStore.Get(store.Query{ID: mneID2, Name: "testname2"}) + if err != nil { + t.Error(err) + } + + if returnNetworkElement.ID != inputNetworkElements[1].ID().String() { + t.Errorf("Get() = %v, want %v", returnNetworkElement.ID, inputNetworkElements[1].ID().String()) + } + if returnNetworkElement.Name != inputNetworkElements[1].Name() { + t.Errorf("Get() = %v, want %v", returnNetworkElement.Name, inputNetworkElements[1].Name()) + } +} + +func TestUpdateNetworkElement(t *testing.T) { + defer ensureStoreFileForTestsIsRemoved(store.NetworkElementFilenameSuffix) + + pndID, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad") + mneID, _ := uuid.Parse("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa") + sbiID1, _ := uuid.Parse("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa") + + trop := returnBasicTransportOption() + + updatedNetworkElementName := "testNetworkElement2" + + sbi1, _ := NewSBI(spb.Type_TYPE_OPENCONFIG, sbiID1) + + networkElementStore := NewNetworkElementStore(pndID) + mne, _ := NewNetworkElement("testNetworkElement", mneID, &trop, sbi1) + + err := networkElementStore.Add(mne) + if err != nil { + t.Error(err) + } + + mne, _ = NewNetworkElement(updatedNetworkElementName, mneID, &trop, sbi1) + + err = networkElementStore.Update(mne) + if err != nil { + t.Error(err) + } + + returnNetworkElement, err := networkElementStore.Get(store.Query{ID: mneID, Name: updatedNetworkElementName}) + if err != nil { + t.Error(err) + } + + if returnNetworkElement.ID != mneID.String() { + t.Errorf("Get() = %v, want %v", returnNetworkElement.ID, mneID.String()) + } + if returnNetworkElement.Name != updatedNetworkElementName { + t.Errorf("Get() = %v, want %v", returnNetworkElement.Name, updatedNetworkElementName) + } +} + +func TestDeleteNetworkElement(t *testing.T) { + defer ensureStoreFileForTestsIsRemoved(store.NetworkElementFilenameSuffix) + + pndID, _ := uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad") + networkElementStore := NewNetworkElementStore(pndID) + + sbiID, _ := uuid.Parse("ssssssss-ssss-ssss-ssss-ssssssssssss") + sbi, _ := NewSBI(spb.Type_TYPE_OPENCONFIG, sbiID) + + mneID1, _ := uuid.Parse("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa") + mneID2, _ := uuid.Parse("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaab") + + trop := returnBasicTransportOption() + + mne1, err := NewNetworkElement("testname", mneID1, &trop, sbi) + if err != nil { + t.Error(err) + } + + mne2, err := NewNetworkElement("testname2", mneID2, &trop, sbi) + if err != nil { + t.Error(err) + } + + inputNetworkElements := [2]networkelement.NetworkElement{mne1, mne2} + + for _, mne := range inputNetworkElements { + err := networkElementStore.Add(mne) + if err != nil { + t.Error(err) + } + } + + err = networkElementStore.Delete(mne1) + if err != nil { + t.Error(err) + } + + returnNetworkElements, err := networkElementStore.GetAll() + if err != nil { + t.Error(err) + } + + length := len(returnNetworkElements) + if length != 1 { + t.Errorf("GetAll() length of array = %v, want %v", length, 2) + } + + for _, mne := range returnNetworkElements { + if mne.ID != inputNetworkElements[1].ID().String() { + t.Errorf("GetAll() = %v, want %v", mne.ID, inputNetworkElements[1].ID().String()) + } + if mne.Name != inputNetworkElements[1].Name() { + t.Errorf("GetAll() = %v, want %v", mne.Name, inputNetworkElements[1].Name()) + } + } +} diff --git a/controller/nucleus/networkElementService.go b/controller/nucleus/networkElementService.go new file mode 100644 index 0000000000000000000000000000000000000000..19e6a9b23dbde38612cd821908769affa6fead2a --- /dev/null +++ b/controller/nucleus/networkElementService.go @@ -0,0 +1,212 @@ +package nucleus + +import ( + "fmt" + + spb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/southbound" + "code.fbi.h-da.de/danet/gosdn/controller/event" + eventInterfaces "code.fbi.h-da.de/danet/gosdn/controller/interfaces/event" + "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkelement" + "code.fbi.h-da.de/danet/gosdn/controller/interfaces/southbound" + "code.fbi.h-da.de/danet/gosdn/controller/store" + "github.com/google/uuid" + "github.com/openconfig/ygot/ygot" + + tpb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/transport" + log "github.com/sirupsen/logrus" +) + +const ( + // NetworkElementEventTopic is the used topic for network element related entity changes. + NetworkElementEventTopic = "managedNetworkElement" +) + +// NetworkElementService provides a network element service implementation. +// This services provides abstraction between the user (e.g a PND) and the matching store (e.g. networkElementStore). +type NetworkElementService struct { + networkElementStore networkelement.Store + sbiService southbound.Service + eventService eventInterfaces.Service +} + +// NewNetworkElementService creates a network element service. +func NewNetworkElementService( + networkElementStore networkelement.Store, + sbiService southbound.Service, + eventService eventInterfaces.Service, +) networkelement.Service { + return &NetworkElementService{ + networkElementStore: networkElementStore, + sbiService: sbiService, + eventService: eventService, + } +} + +// Get takes a network element's UUID or name and returns the network element. +func (s *NetworkElementService) Get(query store.Query) (networkelement.NetworkElement, error) { + loadedNetworkElement, err := s.networkElementStore.Get(query) + if err != nil { + return nil, err + } + + mne, err := s.createNetworkElementFromStore(loadedNetworkElement) + if err != nil { + return nil, err + } + + return mne, nil +} + +// GetAll returns all stored network elements. +func (s *NetworkElementService) GetAll() ([]networkelement.NetworkElement, error) { + var mnes []networkelement.NetworkElement + + loadedNetworkElements, err := s.networkElementStore.GetAll() + if err != nil { + return nil, err + } + + for _, loadedNetworkElement := range loadedNetworkElements { + mne, err := s.createNetworkElementFromStore(loadedNetworkElement) + if err != nil { + return nil, err + } + + mnes = append(mnes, mne) + } + + return mnes, nil +} + +// GetAllAsLoaded returns all stored network elements as LoadedNetworkElement. +// This method should be used if there is no need for a networkelement.NetworkElement, since +// requesting network element information through this method is a lot faster than the +// usual `GetAll` method. +func (s *NetworkElementService) GetAllAsLoaded() ([]networkelement.LoadedNetworkElement, error) { + loadedNetworkElements, err := s.networkElementStore.GetAll() + if err != nil { + return nil, err + } + + return loadedNetworkElements, nil +} + +// Add adds a network element to the network element store. +func (s *NetworkElementService) Add(networkElementToAdd networkelement.NetworkElement) error { + err := s.networkElementStore.Add(networkElementToAdd) + if err != nil { + return err + } + + if err := s.eventService.PublishEvent(NetworkElementEventTopic, event.NewAddEvent(networkElementToAdd.ID())); err != nil { + log.Error(err) + } + + return nil +} + +// UpdateModel updates a existing network element with a new model provided as string. +func (s *NetworkElementService) UpdateModel(networkElementToUpdate networkelement.NetworkElement, modelAsString string) error { + exisitingNetworkElement, err := s.Get(store.Query{ID: networkElementToUpdate.ID()}) + if err != nil { + return err + } + + // Create 'root' path to be able to load the whole model from the store. + path, err := ygot.StringToPath("/", ygot.StructuredPath) + if err != nil { + return err + } + + // Use unmarshall from the network elements SBI to unmarshall ygot json in go struct. + err = exisitingNetworkElement.SBI().Unmarshal([]byte(modelAsString), path, exisitingNetworkElement.GetModel()) + if err != nil { + return err + } + + err = s.networkElementStore.Update(exisitingNetworkElement) + if err != nil { + return err + } + + if err := s.eventService.PublishEvent(NetworkElementEventTopic, event.NewUpdateEvent(networkElementToUpdate.ID())); err != nil { + log.Error(err) + } + + return nil +} + +// Update updates a existing network element. +func (s *NetworkElementService) Update(networkElementToUpdate networkelement.NetworkElement) error { + err := s.networkElementStore.Update(networkElementToUpdate) + if err != nil { + return err + } + + if err := s.eventService.PublishEvent(NetworkElementEventTopic, event.NewUpdateEvent(networkElementToUpdate.ID())); err != nil { + log.Error(err) + } + + return nil +} + +// Delete deletes a network element from the network element store. +func (s *NetworkElementService) Delete(networkElementToDelete networkelement.NetworkElement) error { + err := s.networkElementStore.Delete(networkElementToDelete) + if err != nil { + return err + } + if networkElementToDelete.SBI().Type() == spb.Type_TYPE_PLUGIN { + err = s.sbiService.Delete(networkElementToDelete.SBI()) + if err != nil { + return err + } + } + + if err := s.eventService.PublishEvent(NetworkElementEventTopic, event.NewDeleteEvent(networkElementToDelete.ID())); err != nil { + log.Error(err) + } + + return nil +} + +func (s *NetworkElementService) createNetworkElementFromStore(loadedNetworkElement networkelement.LoadedNetworkElement) (networkelement.NetworkElement, error) { + if loadedNetworkElement.SBI == "" { + return nil, fmt.Errorf("no sbi found for network element") + } + + sbiForNetworkElement, err := s.sbiService.Get(store.Query{ID: uuid.MustParse(loadedNetworkElement.SBI)}) + if err != nil { + return nil, err + } + + mne, err := NewNetworkElement( + loadedNetworkElement.Name, + uuid.MustParse(loadedNetworkElement.ID), + &tpb.TransportOption{ + Address: loadedNetworkElement.TransportAddress, + Username: loadedNetworkElement.TransportUsername, + Password: loadedNetworkElement.TransportPassword, + TransportOption: &tpb.TransportOption_GnmiTransportOption{ + GnmiTransportOption: &tpb.GnmiTransportOption{}, + }, + Type: spb.Type_TYPE_OPENCONFIG, + }, sbiForNetworkElement) + if err != nil { + return nil, err + } + + // Create 'root' path to be able to load the whole model from the store. + path, err := ygot.StringToPath("/", ygot.StructuredPath) + if err != nil { + return nil, err + } + + // Use unmarshall from the network elements SBI to unmarshall ygot json in go struct. + err = mne.SBI().Unmarshal([]byte(loadedNetworkElement.Model), path, mne.GetModel()) + if err != nil { + return nil, err + } + + return mne, nil +} diff --git a/controller/nucleus/networkElementServiceMock.go b/controller/nucleus/networkElementServiceMock.go new file mode 100644 index 0000000000000000000000000000000000000000..dcdcea67d10f160715d28e5f7ee153f4c9285e27 --- /dev/null +++ b/controller/nucleus/networkElementServiceMock.go @@ -0,0 +1,115 @@ +package nucleus + +import ( + "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkelement" + "code.fbi.h-da.de/danet/gosdn/controller/store" + "github.com/google/uuid" +) + +// NetworkElementServiceMock provides a in-memory implementation for multiple stores. +type NetworkElementServiceMock struct { + Store map[uuid.UUID]networkelement.NetworkElement + nameLookupTable map[string]uuid.UUID +} + +// NewNetworkElementServiceMock returns a specific in-memory store for network element service. +func NewNetworkElementServiceMock() networkelement.Service { + return &NetworkElementServiceMock{ + Store: make(map[uuid.UUID]networkelement.NetworkElement), + nameLookupTable: make(map[string]uuid.UUID), + } +} + +// Add adds a item network element. +func (t *NetworkElementServiceMock) Add(item networkelement.NetworkElement) error { + _, ok := t.Store[item.ID()] + if ok { + return nil + } + + t.Store[item.ID()] = item + t.nameLookupTable[item.Name()] = item.ID() + + return nil +} + +// Update updates a item network element. +func (t *NetworkElementServiceMock) Update(item networkelement.NetworkElement) error { + _, ok := t.Store[item.ID()] + if ok { + return nil + } + + t.Store[item.ID()] = item + t.nameLookupTable[item.Name()] = item.ID() + + return nil +} + +// UpdateModel updates a item network element. +func (t *NetworkElementServiceMock) UpdateModel(item networkelement.NetworkElement, model string) error { + _, ok := t.Store[item.ID()] + if ok { + return nil + } + + t.Store[item.ID()] = item + t.nameLookupTable[item.Name()] = item.ID() + + return nil +} + +// Delete deletes a item network element. +func (t *NetworkElementServiceMock) Delete(item networkelement.NetworkElement) error { + delete(t.Store, item.ID()) + + return nil +} + +// Get gets a item network element. +func (t *NetworkElementServiceMock) Get(query store.Query) (networkelement.NetworkElement, error) { + // First search for direct hit on UUID. + item, ok := t.Store[query.ID] + if !ok { + // Second search for name + id, ok := t.nameLookupTable[query.Name] + if !ok { + return nil, nil + } + + item, ok := t.Store[id] + if !ok { + return nil, nil + } + + return item, nil + } + + return item, nil +} + +// GetAll gets all items. +func (t *NetworkElementServiceMock) GetAll() ([]networkelement.NetworkElement, error) { + var allItems []networkelement.NetworkElement + + for _, item := range t.Store { + allItems = append(allItems, item) + } + + return allItems, nil +} + +// GetAllAsLoaded gets all items as `networkelement.LoadedNetworkElement`. +func (t *NetworkElementServiceMock) GetAllAsLoaded() ([]networkelement.LoadedNetworkElement, error) { + var allItems []networkelement.LoadedNetworkElement + + for _, item := range t.Store { + allItems = append(allItems, networkelement.LoadedNetworkElement{ + ID: item.ID().String(), + Name: item.Name(), + SBI: item.SBI().ID().String(), + }) + } + + return allItems, nil +} diff --git a/controller/nucleus/networkElementService_test.go b/controller/nucleus/networkElementService_test.go new file mode 100644 index 0000000000000000000000000000000000000000..39aad46fa30d4cf6c9e5d7bc8619ae4b7cdfc6d6 --- /dev/null +++ b/controller/nucleus/networkElementService_test.go @@ -0,0 +1,112 @@ +package nucleus + +import ( + "testing" + + eventservice "code.fbi.h-da.de/danet/gosdn/controller/eventService" + "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkelement" + "code.fbi.h-da.de/danet/gosdn/controller/interfaces/southbound" + "code.fbi.h-da.de/danet/gosdn/controller/mocks" + "code.fbi.h-da.de/danet/gosdn/controller/store" + "github.com/google/uuid" + + spb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/southbound" +) + +func getMockNetworkElement(mneID uuid.UUID, sbi southbound.SouthboundInterface) networkelement.NetworkElement { + return &CommonNetworkElement{ + UUID: mneID, + Model: sbi.Schema().Root, + sbi: sbi, + transport: &mocks.Transport{}, + } +} + +func getNetworkElementTestStores(t *testing.T, mneID uuid.UUID) (networkelement.Service, southbound.Service, networkelement.NetworkElement, southbound.SouthboundInterface) { + eventService := eventservice.NewMockEventService() + sbiStore := NewMemorySbiStore() + networkElementStore := NewMemoryNetworkElementStore() + sbiService := NewSbiService(sbiStore, eventService) + networkElementService := NewNetworkElementService( + networkElementStore, + sbiService, + eventService, + ) + + sbi, err := NewSBI(spb.Type_TYPE_OPENCONFIG) + if err != nil { + t.Error("could not create sbi") + } + + err = sbiService.Add(sbi) + if err != nil { + t.Error("could not add sbi") + } + + mockNetworkElement := getMockNetworkElement(mneID, sbi) + err = networkElementService.Add(mockNetworkElement) + if err != nil { + t.Error("could not add network element") + } + + return networkElementService, sbiService, mockNetworkElement, sbi +} + +func TestNetworkElementService_Get(t *testing.T) { + mneID := uuid.New() + + networkElementService, _, mockNetworkElement, _ := getNetworkElementTestStores(t, mneID) + + mne, err := networkElementService.Get(store.Query{ + ID: mockNetworkElement.ID(), + Name: mockNetworkElement.Name(), + }) + if err != nil { + t.Error("could not get network element") + } + + if mockNetworkElement.ID() != mne.ID() { + t.Errorf("Expected ID=%s, got %s", mockNetworkElement.ID(), mne.ID()) + } +} + +func TestNetworkElementService_Delete(t *testing.T) { + mneID := uuid.New() + + networkElementService, _, mockNetworkElement, _ := getNetworkElementTestStores(t, mneID) + + mne, err := networkElementService.Get(store.Query{ + ID: mockNetworkElement.ID(), + Name: mockNetworkElement.Name(), + }) + if err != nil { + t.Error("could not get network element") + } + + err = networkElementService.Delete(mne) + if err != nil { + t.Error("could not delete network element") + } +} + +func TestNetworkElementService_GetAll(t *testing.T) { + mneID := uuid.New() + mneID2 := uuid.New() + + networkElementService, _, _, sbi := getNetworkElementTestStores(t, mneID) + mockNetworkElement2 := getMockNetworkElement(mneID2, sbi) + + err := networkElementService.Add(mockNetworkElement2) + if err != nil { + t.Error("could not add network element") + } + + mnes, err := networkElementService.GetAll() + if err != nil { + t.Error("could not get all network elements") + } + + if len(mnes) != 2 { + t.Errorf("Expected len(network elements)=2, got %d", len(mnes)) + } +} diff --git a/controller/nucleus/networkElementStore.go b/controller/nucleus/networkElementStore.go new file mode 100644 index 0000000000000000000000000000000000000000..72b663adbe7a82750386736c77f0987b3e1a12bc --- /dev/null +++ b/controller/nucleus/networkElementStore.go @@ -0,0 +1,28 @@ +package nucleus + +import ( + "fmt" + + "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkelement" + "code.fbi.h-da.de/danet/gosdn/controller/store" + + "github.com/google/uuid" + log "github.com/sirupsen/logrus" +) + +// NewNetworkElementStore returns a NetworkElementStore. +func NewNetworkElementStore(pndUUID uuid.UUID) networkelement.Store { + storeMode := store.GetStoreMode() + log.Debugf("StoreMode: %s", storeMode) + + switch storeMode { + case store.Database: + return &DatabaseNetworkElementStore{ + storeName: fmt.Sprintf("networkElement-store-%s.json", pndUUID.String()), + } + + default: + store := NewFilesystemNetworkElementStore(pndUUID) + return store + } +} diff --git a/controller/nucleus/deviceWatcher.go b/controller/nucleus/networkElementWatcher.go similarity index 62% rename from controller/nucleus/deviceWatcher.go rename to controller/nucleus/networkElementWatcher.go index 61e3f0897ef83dd418ef51a74f1255603c56cc4b..efbc97b3da1c84563ad78da31ed7559588565233 100644 --- a/controller/nucleus/deviceWatcher.go +++ b/controller/nucleus/networkElementWatcher.go @@ -5,8 +5,8 @@ import ( "fmt" "code.fbi.h-da.de/danet/gosdn/controller/customerrs" - "code.fbi.h-da.de/danet/gosdn/controller/interfaces/device" "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkdomain" + "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkelement" "code.fbi.h-da.de/danet/gosdn/controller/interfaces/transport" "code.fbi.h-da.de/danet/gosdn/controller/nucleus/types" "code.fbi.h-da.de/danet/gosdn/controller/store" @@ -23,9 +23,9 @@ const ( gNMIStreamMode string = "on_change" ) -// DeviceWatcher is a component that subscribes to devices via gNMI from within the controller and handles +// NetworkElementWatcher is a component that subscribes to devices via gNMI from within the controller and handles // responses by triggering the internal event process. -type DeviceWatcher struct { +type NetworkElementWatcher struct { pndStore networkdomain.PndStore deviceSubcriptions map[uuid.UUID]*deviceSubscriptionHelper } @@ -36,18 +36,18 @@ type deviceSubscriptionHelper struct { stopFunc context.CancelFunc } -// NewDeviceWatcher takes a pndStore to subscribe to device paths. -func NewDeviceWatcher(pndStore networkdomain.PndStore) *DeviceWatcher { - return &DeviceWatcher{ +// NewNetworkElementWatcher takes a pndStore to subscribe to network element paths. +func NewNetworkElementWatcher(pndStore networkdomain.PndStore) *NetworkElementWatcher { + return &NetworkElementWatcher{ pndStore: pndStore, deviceSubcriptions: make(map[uuid.UUID]*deviceSubscriptionHelper), } } -// SubToDevices subscribes to every available device in each network domain according to provided SubscribeOptions. +// SubToDevices subscribes to every available network element in each network domain according to provided SubscribeOptions. // Paths should be provided in the following format [][]string{{"system", "config", "hostname"}} // SubscribeOptions can be nil. Use nil for a fixed, pre-defined set of gNMI subscription options (streaming in sample mode each second). -func (d *DeviceWatcher) SubToDevices(paths [][]string, opts *gnmi.SubscribeOptions) { +func (d *NetworkElementWatcher) SubToDevices(paths [][]string, opts *gnmi.SubscribeOptions) { if opts == nil { opts = &gnmi.SubscribeOptions{ Mode: gNMISubscribeMode, @@ -67,8 +67,8 @@ func (d *DeviceWatcher) SubToDevices(paths [][]string, opts *gnmi.SubscribeOptio } } -func (d *DeviceWatcher) subscribeToPndDevices(pndID string, pnd networkdomain.NetworkDomain, opts *gnmi.SubscribeOptions) { - for _, device := range pnd.Devices() { +func (d *NetworkElementWatcher) subscribeToPndDevices(pndID string, pnd networkdomain.NetworkDomain, opts *gnmi.SubscribeOptions) { + for _, mne := range pnd.NetworkElements() { subID := uuid.New() stopContext, cancel := context.WithCancel(context.Background()) @@ -76,48 +76,48 @@ func (d *DeviceWatcher) subscribeToPndDevices(pndID string, pnd networkdomain.Ne stopSubscribeCtx: stopContext, stopFunc: cancel, }) - go d.callSubscribe(stopContext, pndID, device, opts) + go d.callSubscribe(stopContext, pndID, mne, opts) } } -func (d *DeviceWatcher) callSubscribe(stopContext context.Context, pndID string, device device.Device, opts *gnmi.SubscribeOptions) { +func (d *NetworkElementWatcher) callSubscribe(stopContext context.Context, pndID string, mne networkelement.NetworkElement, opts *gnmi.SubscribeOptions) { gNMIOptionsCtx := context.Background() gNMIOptionsCtx = context.WithValue(gNMIOptionsCtx, types.CtxKeyOpts, opts) - // SubscriptionInformation contains pnd ID, device ID and name to be used in the internal subscribe to check - // from which device a response was sent - if err := device.Transport().ControlPlaneSubscribe(gNMIOptionsCtx, d.handleSubscribeResponse, &transport.SubscriptionInformation{ + // SubscriptionInformation contains pnd ID, network element ID and name to be used in the internal subscribe to check + // from which network element a response was sent + if err := mne.Transport().ControlPlaneSubscribe(gNMIOptionsCtx, d.handleSubscribeResponse, &transport.SubscriptionInformation{ PndID: pndID, - DeviceID: device.ID().String(), - DeviceName: device.Name(), + DeviceID: mne.ID().String(), + DeviceName: mne.Name(), StopContext: stopContext, }); err != nil { log.Error(err) } } -func (d *DeviceWatcher) addToDeviceSubscriptions(subID uuid.UUID, devSub *deviceSubscriptionHelper) { +func (d *NetworkElementWatcher) addToDeviceSubscriptions(subID uuid.UUID, devSub *deviceSubscriptionHelper) { //TODO: improve handling of subscriptions, like be able to expose to apps so specific subscriptions instead of only all can be stopped in the future d.deviceSubcriptions[subID] = devSub } // StopAndRemoveAllDeviceSubscriptions stops and removes all the available running subscriptions. -func (d *DeviceWatcher) StopAndRemoveAllDeviceSubscriptions() { +func (d *NetworkElementWatcher) StopAndRemoveAllDeviceSubscriptions() { for key := range d.deviceSubcriptions { d.StopAndRemoveDeviceSubscription(key) } } // StopAndRemoveDeviceSubscription passes a subscription uuid to stop the running subscription go routing and removes the entry from the map -// of device subscriptions. -func (d *DeviceWatcher) StopAndRemoveDeviceSubscription(subID uuid.UUID) { +// of network element subscriptions. +func (d *NetworkElementWatcher) StopAndRemoveDeviceSubscription(subID uuid.UUID) { d.deviceSubcriptions[subID].stopFunc() delete(d.deviceSubcriptions, subID) } -// handleSubscribeResponse takes the subscribe response and additional information about the device to distinguish -// from which device a subscribe response was sent including improved error handling. -func (d *DeviceWatcher) handleSubscribeResponse(resp *gpb.SubscribeResponse, subscriptionInfo *transport.SubscriptionInformation) { +// handleSubscribeResponse takes the subscribe response and additional information about the network element to distinguish +// from which network element a subscribe response was sent including improved error handling. +func (d *NetworkElementWatcher) handleSubscribeResponse(resp *gpb.SubscribeResponse, subscriptionInfo *transport.SubscriptionInformation) { switch resp := resp.Response.(type) { case *gpb.SubscribeResponse_Error: log.Error(&customerrs.SubscribeResponseError{ @@ -141,7 +141,7 @@ func (d *DeviceWatcher) handleSubscribeResponse(resp *gpb.SubscribeResponse, sub } } -func (d *DeviceWatcher) handleSubscribeResponseUpdate(resp *gpb.SubscribeResponse_Update, subscriptionInfo *transport.SubscriptionInformation) { +func (d *NetworkElementWatcher) handleSubscribeResponseUpdate(resp *gpb.SubscribeResponse_Update, subscriptionInfo *transport.SubscriptionInformation) { pndID, err := uuid.Parse(subscriptionInfo.PndID) if err != nil { log.Error(err) @@ -152,16 +152,16 @@ func (d *DeviceWatcher) handleSubscribeResponseUpdate(resp *gpb.SubscribeRespons log.Error(err) } - device, err := pnd.GetDevice(subscriptionInfo.DeviceID) + mne, err := pnd.GetNetworkElement(subscriptionInfo.DeviceID) if err != nil { log.Error(err) } - err = device.Transport().ProcessControlPlaneSubscribeResponse(resp, device.GetModel(), device.SBI().Schema()) + err = mne.Transport().ProcessControlPlaneSubscribeResponse(resp, mne.GetModel(), mne.SBI().Schema()) if err != nil { log.Error(err) } else { - if err := pnd.UpdateDeviceAfterSubscribeResponse(device); err != nil { + if err := pnd.UpdateNetworkElementAfterSubscribeResponse(mne); err != nil { log.Error(err) } } diff --git a/controller/nucleus/device_test.go b/controller/nucleus/networkElement_test.go similarity index 77% rename from controller/nucleus/device_test.go rename to controller/nucleus/networkElement_test.go index 2ce8863613908f4ee9f9760d7e17e7a6b4f3b097..c6d80416f749c859553c99819ebec9ceb48f2e07 100644 --- a/controller/nucleus/device_test.go +++ b/controller/nucleus/networkElement_test.go @@ -14,7 +14,7 @@ import ( "github.com/openconfig/ygot/ygot" ) -func TestDevice_Id(t *testing.T) { +func TestNetworkElement_Id(t *testing.T) { type fields struct { Model ygot.ValidatedGoStruct SBI southbound.SouthboundInterface @@ -30,14 +30,14 @@ func TestDevice_Id(t *testing.T) { { name: "default", fields: fields{ - UUID: did, + UUID: mneid, }, - want: did, + want: mneid, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - d := &CommonDevice{ + d := &CommonNetworkElement{ Model: tt.fields.Model, sbi: tt.fields.SBI, transport: tt.fields.Transport, @@ -51,7 +51,7 @@ func TestDevice_Id(t *testing.T) { } } -func TestNewDevice(t *testing.T) { +func TestNewNetworkElement(t *testing.T) { sbi := &OpenConfig{} type args struct { sbi southbound.SouthboundInterface @@ -80,7 +80,7 @@ func TestNewDevice(t *testing.T) { }, }, }, - name: "MyDevice", + name: "MyNetworkElement", }, }, { @@ -92,7 +92,7 @@ func TestNewDevice(t *testing.T) { Username: "test", Password: "test", }, - name: "MyDevice", + name: "MyNetworkElement", }, wantErr: true, }, @@ -101,23 +101,23 @@ func TestNewDevice(t *testing.T) { tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() - resp, err := NewDevice(tt.args.name, uuid.Nil, tt.args.opts, tt.args.sbi) + resp, err := NewNetworkElement(tt.args.name, uuid.Nil, tt.args.opts, tt.args.sbi) if (err != nil) != tt.wantErr { - t.Errorf("NewDevice() error = %v, wantErr %v", err, tt.wantErr) + t.Errorf("NewNetworkElement() error = %v, wantErr %v", err, tt.wantErr) return } if resp != nil { if reflect.TypeOf(resp.GetModel()) != reflect.TypeOf(&openconfig.Device{}) { - t.Error("NewDevice() returned invalid GoStruct") + t.Error("NewNetworkElement() returned invalid GoStruct") } if reflect.TypeOf(resp.Transport()) != reflect.TypeOf(&Gnmi{}) { - t.Error("NewDevice() returned invalid transport") + t.Error("NewNetworkElement() returned invalid transport") } if reflect.TypeOf(resp.SBI()) != reflect.TypeOf(&OpenConfig{}) { - t.Error("NewDevice() returned invalid GoStruct") + t.Error("NewNetworkElement() returned invalid GoStruct") } - if resp.Name() != "MyDevice" { - t.Error("NewDevice() returned wrong name") + if resp.Name() != "MyNetworkElement" { + t.Error("NewNetworkElement() returned wrong name") } } }) diff --git a/controller/nucleus/pndFilesystemStore.go b/controller/nucleus/pndFilesystemStore.go index 524945a6a6c5f4006e7e58a2d5a6511d82aa0758..d7fb1f5978e3ac04b3dadc2fbf3def280f864019 100644 --- a/controller/nucleus/pndFilesystemStore.go +++ b/controller/nucleus/pndFilesystemStore.go @@ -7,8 +7,8 @@ import ( cpb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/csbi" "code.fbi.h-da.de/danet/gosdn/controller/customerrs" - "code.fbi.h-da.de/danet/gosdn/controller/interfaces/device" "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkdomain" + "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkelement" "code.fbi.h-da.de/danet/gosdn/controller/store" "github.com/google/uuid" log "github.com/sirupsen/logrus" @@ -19,7 +19,7 @@ import ( // FilesystemPndStore provides a filesystem implementation for a pnd store. type FilesystemPndStore struct { - pendingChannels map[uuid.UUID]chan device.Details + pendingChannels map[uuid.UUID]chan networkelement.Details csbiClient cpb.CsbiServiceClient pathToPndFile string fileMutex sync.Mutex @@ -32,7 +32,7 @@ func NewFilesystemPndStore() FilesystemPndStore { } return FilesystemPndStore{ - pendingChannels: make(map[uuid.UUID]chan device.Details), + pendingChannels: make(map[uuid.UUID]chan networkelement.Details), pathToPndFile: store.GetCompletePathToFileStore(store.PndFilename), fileMutex: sync.Mutex{}, } @@ -168,7 +168,7 @@ func (t *FilesystemPndStore) GetAll() ([]networkdomain.NetworkDomain, error) { // PendingChannels holds channels used communicate with pending // cSBI deployments. -func (t *FilesystemPndStore) PendingChannels(id uuid.UUID, parseErrors ...error) (chan device.Details, error) { +func (t *FilesystemPndStore) PendingChannels(id uuid.UUID, parseErrors ...error) (chan networkelement.Details, error) { ch, ok := t.pendingChannels[id] if !ok { return nil, &customerrs.CouldNotFindError{ID: id} @@ -177,7 +177,7 @@ func (t *FilesystemPndStore) PendingChannels(id uuid.UUID, parseErrors ...error) } // AddPendingChannel adds a pending channel to the map. -func (t *FilesystemPndStore) AddPendingChannel(id uuid.UUID, ch chan device.Details) { +func (t *FilesystemPndStore) AddPendingChannel(id uuid.UUID, ch chan networkelement.Details) { t.pendingChannels[id] = ch } @@ -186,7 +186,7 @@ func (t *FilesystemPndStore) RemovePendingChannel(id uuid.UUID) { delete(t.pendingChannels, id) } -func (t *FilesystemPndStore) callback(id uuid.UUID, ch chan device.Details) { +func (t *FilesystemPndStore) callback(id uuid.UUID, ch chan networkelement.Details) { if ch != nil { t.AddPendingChannel(id, ch) log.Infof("pending channel %v added", id) diff --git a/controller/nucleus/pndStore.go b/controller/nucleus/pndStore.go index 61f87daa9ff2b7522c6889aedc6441b741c771fd..c370e9273619e1ad83396ed62b1a7f832aedaa77 100644 --- a/controller/nucleus/pndStore.go +++ b/controller/nucleus/pndStore.go @@ -1,8 +1,8 @@ package nucleus import ( - "code.fbi.h-da.de/danet/gosdn/controller/interfaces/device" "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkdomain" + "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkelement" "code.fbi.h-da.de/danet/gosdn/controller/store" "github.com/google/uuid" log "github.com/sirupsen/logrus" @@ -28,7 +28,7 @@ func NewPndStore() networkdomain.PndStore { switch storeMode { case store.Database: return &DatabasePndStore{ - pendingChannels: make(map[uuid.UUID]chan device.Details), + pendingChannels: make(map[uuid.UUID]chan networkelement.Details), pndStoreName: "pnd-store.json", } diff --git a/controller/nucleus/principalNetworkDomain.go b/controller/nucleus/principalNetworkDomain.go index fe4b0f9ac6373339d5a5cf3c1599478811e3a88c..f47087040bdf6afa29f76efc66552a04f5213120 100644 --- a/controller/nucleus/principalNetworkDomain.go +++ b/controller/nucleus/principalNetworkDomain.go @@ -27,9 +27,9 @@ import ( "code.fbi.h-da.de/danet/gosdn/controller/customerrs" "code.fbi.h-da.de/danet/gosdn/controller/interfaces/change" - "code.fbi.h-da.de/danet/gosdn/controller/interfaces/device" eventInterfaces "code.fbi.h-da.de/danet/gosdn/controller/interfaces/event" "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkdomain" + "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkelement" "code.fbi.h-da.de/danet/gosdn/controller/interfaces/southbound" gGnmi "code.fbi.h-da.de/danet/gosdn/controller/nucleus/util/gnmi" @@ -55,7 +55,7 @@ func NewPND( description string, id uuid.UUID, c cpb.CsbiServiceClient, - callback func(uuid.UUID, chan device.Details), + callback func(uuid.UUID, chan networkelement.Details), ) (networkdomain.NetworkDomain, error) { eventService, err := eventservice.NewEventService() if err != nil { @@ -63,11 +63,11 @@ func NewPND( } sbiStore := NewSbiStore(id) - deviceStore := NewDeviceStore(id) + networkElementStore := NewNetworkElementStore(id) sbiService := NewSbiService(sbiStore, eventService) - deviceService := NewDeviceService( - deviceStore, + networkElementService := NewNetworkElementService( + networkElementStore, sbiService, eventService, ) @@ -79,12 +79,12 @@ func NewPND( } pnd := &pndImplementation{ - Name: name, - Description: description, - southboundService: sbiService, - deviceService: deviceService, - changes: changeStore, - Id: id, + Name: name, + Description: description, + southboundService: sbiService, + networkElementService: networkElementService, + changes: changeStore, + Id: id, csbiClient: c, callback: callback, @@ -108,16 +108,16 @@ func NewPND( } type pndImplementation struct { - Name string `json:"name,omitempty"` - Description string `json:"description,omitempty"` - southboundService southbound.Service - deviceService device.Service - changes *store.ChangeStore + Name string `json:"name,omitempty"` + Description string `json:"description,omitempty"` + southboundService southbound.Service + networkElementService networkelement.Service + changes *store.ChangeStore //nolint Id uuid.UUID `json:"id,omitempty"` csbiClient cpb.CsbiServiceClient - callback func(uuid.UUID, chan device.Details) + callback func(uuid.UUID, chan networkelement.Details) eventService eventInterfaces.Service } @@ -157,16 +157,16 @@ func (pnd *pndImplementation) ID() uuid.UUID { return pnd.Id } -func (pnd *pndImplementation) Devices() []device.Device { - allDevices, _ := pnd.deviceService.GetAll() +func (pnd *pndImplementation) NetworkElements() []networkelement.NetworkElement { + allNetworkElements, _ := pnd.networkElementService.GetAll() - return allDevices + return allNetworkElements } -func (pnd *pndImplementation) FlattenedDevices() []device.LoadedDevice { - allDevices, _ := pnd.deviceService.GetAllAsLoaded() +func (pnd *pndImplementation) FlattenedNetworkElements() []networkelement.LoadedNetworkElement { + allNetworkElements, _ := pnd.networkElementService.GetAllAsLoaded() - return allDevices + return allNetworkElements } // GetName returns the name of the PND. @@ -208,35 +208,35 @@ func (pnd *pndImplementation) AddSbi(s southbound.SouthboundInterface) error { } // RemoveSbi removes a SBI from the PND -// devices and remove the devices using this SBI. +// network elements and remove the network elements using this SBI. func (pnd *pndImplementation) RemoveSbi(sid uuid.UUID) error { - var associatedDevices []device.LoadedDevice + var associatedNetworkElements []networkelement.LoadedNetworkElement - allExistingDevices, err := pnd.deviceService.GetAllAsLoaded() + allExistingNetworkElements, err := pnd.networkElementService.GetAllAsLoaded() if err != nil { return err } - // range over all storable items within the device store - for _, device := range allExistingDevices { - // check if the device uses the provided SBI and add it to the devices + // range over all storable items within the network element store + for _, mne := range allExistingNetworkElements { + // check if the network element uses the provided SBI and add it to the network element // slice. - loadedSbiUUID, err := uuid.Parse(device.SBI) + loadedSbiUUID, err := uuid.Parse(mne.SBI) if err != nil { return err } if loadedSbiUUID == sid { - associatedDevices = append(associatedDevices, device) + associatedNetworkElements = append(associatedNetworkElements, mne) } } - // range over associated devices and remove each one of them - for _, d := range associatedDevices { - loadedDeviceUUID, err := uuid.Parse(d.ID) + // range over associated network elements and remove each one of them + for _, aMNE := range associatedNetworkElements { + loadedNetworkElementUUID, err := uuid.Parse(aMNE.ID) if err != nil { return err } - if err := pnd.removeDevice(loadedDeviceUUID); err != nil { + if err := pnd.removeNetworkElement(loadedNetworkElementUUID); err != nil { return err } } @@ -244,11 +244,11 @@ func (pnd *pndImplementation) RemoveSbi(sid uuid.UUID) error { return pnd.removeSbi(sid) } -// AddDevice adds a new device to the PND. -func (pnd *pndImplementation) AddDevice(name string, opt *tpb.TransportOption, sid uuid.UUID) (uuid.UUID, error) { +// AddNetworkElement adds a new network element to the PND. +func (pnd *pndImplementation) AddNetworkElement(name string, opt *tpb.TransportOption, sid uuid.UUID) (uuid.UUID, error) { labels := prometheus.Labels{"type": opt.Type.String()} - start := metrics.StartHook(labels, deviceCreationsTotal) - defer metrics.FinishHook(labels, start, deviceCreationDurationSecondsTotal, deviceCreationDurationSeconds) + start := metrics.StartHook(labels, networkElementCreationsTotal) + defer metrics.FinishHook(labels, start, networkElementCreationDurationSecondsTotal, networkElementCreationDurationSeconds) var sbi southbound.SouthboundInterface var err error @@ -268,48 +268,48 @@ func (pnd *pndImplementation) AddDevice(name string, opt *tpb.TransportOption, s } } - d, err := NewDevice(name, uuid.Nil, opt, sbi) + mne, err := NewNetworkElement(name, uuid.Nil, opt, sbi) if err != nil { return uuid.Nil, err } - return pnd.addDevice(d) + return pnd.addNetworkElement(mne) } // TODO: (maba): This should be changed to UUID. -func (pnd *pndImplementation) GetDevice(identifier string) (device.Device, error) { +func (pnd *pndImplementation) GetNetworkElement(identifier string) (networkelement.NetworkElement, error) { id, err := uuid.Parse(identifier) if err != nil { id = uuid.Nil } - d, err := pnd.deviceService.Get(store.Query{ + mne, err := pnd.networkElementService.Get(store.Query{ ID: id, Name: identifier, }) - if d == nil { - return nil, fmt.Errorf("no device found") + if mne == nil { + return nil, fmt.Errorf("no network element found") } if err != nil { return nil, err } - return d, nil + return mne, nil } -// RemoveDevice removes a device from the PND. -func (pnd *pndImplementation) RemoveDevice(uuid uuid.UUID) error { - return pnd.removeDevice(uuid) +// RemoveNetworkElement removes a network element from the PND. +func (pnd *pndImplementation) RemoveNetworkElement(uuid uuid.UUID) error { + return pnd.removeNetworkElement(uuid) } -// UpdateDeviceModel updates a device from the PND. -func (pnd *pndImplementation) UpdateDevice(device device.Device, modelAsString string) error { - err := pnd.deviceService.UpdateModel(device, modelAsString) +// UpdateNetworkElementModel updates a network element from the PND. +func (pnd *pndImplementation) UpdateNetworkElement(mne networkelement.NetworkElement, modelAsString string) error { + err := pnd.networkElementService.UpdateModel(mne, modelAsString) if err != nil { return err } - err = pnd.ensureIntendedConfigurationIsAppliedOnDevice(device.ID()) + err = pnd.ensureIntendedConfigurationIsAppliedOnNetworkElement(mne.ID()) if err != nil { return err } @@ -340,25 +340,25 @@ func (pnd *pndImplementation) removeSbi(id uuid.UUID) error { return pnd.southboundService.Delete(sbi) } -// addDevice adds a device to the PND's device store. -func (pnd *pndImplementation) addDevice(device device.Device) (uuid.UUID, error) { - err := pnd.deviceService.Add(device) +// addNetworkElement adds a network element to the PND's network element store. +func (pnd *pndImplementation) addNetworkElement(mne networkelement.NetworkElement) (uuid.UUID, error) { + err := pnd.networkElementService.Add(mne) if err != nil { return uuid.Nil, err } - if device.IsTransportValid() { - _, err = pnd.Request(device.ID(), "/interfaces") + if mne.IsTransportValid() { + _, err = pnd.Request(mne.ID(), "/interfaces") if err != nil { return uuid.Nil, err } } - return device.ID(), nil + return mne.ID(), nil } -func (pnd *pndImplementation) removeDevice(id uuid.UUID) error { - d, err := pnd.deviceService.Get(store.Query{ +func (pnd *pndImplementation) removeNetworkElement(id uuid.UUID) error { + mne, err := pnd.networkElementService.Get(store.Query{ ID: id, Name: id.String(), }) @@ -366,23 +366,23 @@ func (pnd *pndImplementation) removeDevice(id uuid.UUID) error { return err } - if d == nil { - return fmt.Errorf("no device found") + if mne == nil { + return fmt.Errorf("no network element found") } - labels := prometheus.Labels{"type": d.SBI().Type().String()} - start := metrics.StartHook(labels, deviceDeletionsTotal) - defer metrics.FinishHook(labels, start, deviceDeletionDurationSecondsTotal, deviceDeletionDurationSeconds) - switch d.(type) { - case *CsbiDevice: - return pnd.handleCsbiDeletion(d) + labels := prometheus.Labels{"type": mne.SBI().Type().String()} + start := metrics.StartHook(labels, networkElementDeletionsTotal) + defer metrics.FinishHook(labels, start, networkElementDeletionDurationSecondsTotal, networkElementDeletionDurationSeconds) + switch mne.(type) { + case *CsbiNetworkElement: + return pnd.handleCsbiDeletion(mne) default: - return pnd.deviceService.Delete(d) + return pnd.networkElementService.Delete(mne) } } -func (pnd *pndImplementation) MarshalDevice(identifier string) (string, error) { - foundDevice, err := pnd.deviceService.Get(store.Query{ +func (pnd *pndImplementation) MarshalNetworkElement(identifier string) (string, error) { + foundNetworkElement, err := pnd.networkElementService.Get(store.Query{ ID: uuid.MustParse(identifier), Name: identifier, }) @@ -390,33 +390,33 @@ func (pnd *pndImplementation) MarshalDevice(identifier string) (string, error) { return "", err } - jsonTree, err := json.MarshalIndent(foundDevice.GetModel(), "", "\t") + jsonTree, err := json.MarshalIndent(foundNetworkElement.GetModel(), "", "\t") if err != nil { return "", err } log.WithFields(log.Fields{ "pnd": pnd.Id, "Identifier": identifier, - "Name": foundDevice.Name, - }).Info("marshalled device") + "Name": foundNetworkElement.Name, + }).Info("marshalled network element") return string(jsonTree), nil } -// Request sends a get request to a specific device. +// Request sends a get request to a specific network element. func (pnd *pndImplementation) Request(uuid uuid.UUID, path string) (proto.Message, error) { - d, err := pnd.deviceService.Get(store.Query{ + mne, err := pnd.networkElementService.Get(store.Query{ ID: uuid, Name: uuid.String(), }) if err != nil { return nil, err } - if d == nil { - return nil, fmt.Errorf("no device found") + if mne == nil { + return nil, fmt.Errorf("no network element found") } ctx := context.Background() - res, err := d.Transport().Get(ctx, path) + res, err := mne.Transport().Get(ctx, path) if err != nil { return nil, err } @@ -427,12 +427,12 @@ func (pnd *pndImplementation) Request(uuid uuid.UUID, path string) (proto.Messag Type: (*proto.Message)(nil), } } - err = d.ProcessResponse(resp) + err = mne.ProcessResponse(resp) if err != nil { return nil, err } - err = pnd.deviceService.Update(d) + err = pnd.networkElementService.Update(mne) if err != nil { return nil, err } @@ -440,19 +440,19 @@ func (pnd *pndImplementation) Request(uuid uuid.UUID, path string) (proto.Messag return resp, nil } -// RequestAll sends a request for all registered devices. +// RequestAll sends a request for all registered network elements. func (pnd *pndImplementation) RequestAll(path string) error { - allDevices, err := pnd.deviceService.GetAllAsLoaded() + allNetworkElements, err := pnd.networkElementService.GetAllAsLoaded() if err != nil { return err } - for _, d := range allDevices { - deviceUUID, err := uuid.Parse(d.ID) + for _, mne := range allNetworkElements { + mneUUID, err := uuid.Parse(mne.ID) if err != nil { return err } - _, err = pnd.Request(deviceUUID, path) + _, err = pnd.Request(mneUUID, path) if err != nil { return err } @@ -462,19 +462,19 @@ func (pnd *pndImplementation) RequestAll(path string) error { log.WithFields(log.Fields{ "pnd": pnd.Id, "path": path, - }).Info("sent request to all devices") + }).Info("sent request to all network elements") return nil } -func (pnd *pndImplementation) ensureIntendedConfigurationIsAppliedOnDevice(deviceID uuid.UUID) error { - device, err := pnd.deviceService.Get(store.Query{ - ID: deviceID, +func (pnd *pndImplementation) ensureIntendedConfigurationIsAppliedOnNetworkElement(mneID uuid.UUID) error { + mne, err := pnd.networkElementService.Get(store.Query{ + ID: mneID, }) if err != nil { return err } - model, err := device.GetModelAsString() + model, err := mne.GetModelAsString() if err != nil { return err } @@ -492,29 +492,29 @@ func (pnd *pndImplementation) ensureIntendedConfigurationIsAppliedOnDevice(devic }, }} - response, err := device.Transport().CustomSet(context.Background(), req) + response, err := mne.Transport().CustomSet(context.Background(), req) if err != nil { - log.Errorf("Failed to apply model of device err=%+v, response=%+v", err, response) + log.Errorf("Failed to apply model of network element err=%+v, response=%+v", err, response) return err } return nil } -// ChangeOND creates a change from the provided Operation, path and value. +// ChangeMNE creates a change from the provided Operation, path and value. // The Change is Pending and times out after the specified timeout period. // // nolint:gocyclo -func (pnd *pndImplementation) ChangeOND(duid uuid.UUID, operation ppb.ApiOperation, path string, value ...string) (uuid.UUID, error) { +func (pnd *pndImplementation) ChangeMNE(duid uuid.UUID, operation ppb.ApiOperation, path string, value ...string) (uuid.UUID, error) { //TODO: check if we can get cyclomatic complexity from 16 to at least 15 - d, err := pnd.deviceService.Get(store.Query{ + mne, err := pnd.networkElementService.Get(store.Query{ ID: duid, }) if err != nil { return uuid.Nil, err } - validatedCpy, err := d.CreateModelCopy() + validatedCpy, err := mne.CreateModelCopy() if err != nil { return uuid.Nil, err } @@ -526,20 +526,20 @@ func (pnd *pndImplementation) ChangeOND(duid uuid.UUID, operation ppb.ApiOperati if operation != ppb.ApiOperation_API_OPERATION_DELETE && len(value) != 1 { return uuid.Nil, &customerrs.InvalidParametersError{ - Func: pnd.ChangeOND, + Func: pnd.ChangeMNE, Param: value, } } switch operation { case ppb.ApiOperation_API_OPERATION_UPDATE, ppb.ApiOperation_API_OPERATION_REPLACE: - _, entry, err := ytypes.GetOrCreateNode(d.SBI().Schema().RootSchema(), validatedCpy, p) + _, entry, err := ytypes.GetOrCreateNode(mne.SBI().Schema().RootSchema(), validatedCpy, p) if err != nil { return uuid.Nil, err } if entry.IsDir() { opts := []ytypes.UnmarshalOpt{&ytypes.IgnoreExtraFields{}} - if err := d.SBI().Unmarshal([]byte(value[0]), p, validatedCpy, opts...); err != nil { + if err := mne.SBI().Unmarshal([]byte(value[0]), p, validatedCpy, opts...); err != nil { return uuid.Nil, err } } else if entry.IsLeaf() { @@ -548,12 +548,12 @@ func (pnd *pndImplementation) ChangeOND(duid uuid.UUID, operation ppb.ApiOperati return uuid.Nil, err } opts := []ytypes.SetNodeOpt{&ytypes.InitMissingElements{}, &ytypes.TolerateJSONInconsistencies{}} - if err := ytypes.SetNode(d.SBI().Schema().RootSchema(), validatedCpy, p, typedValue, opts...); err != nil { + if err := ytypes.SetNode(mne.SBI().Schema().RootSchema(), validatedCpy, p, typedValue, opts...); err != nil { return uuid.Nil, err } } case ppb.ApiOperation_API_OPERATION_DELETE: - if err := ytypes.DeleteNode(d.SBI().Schema().RootSchema(), validatedCpy, p); err != nil { + if err := ytypes.DeleteNode(mne.SBI().Schema().RootSchema(), validatedCpy, p); err != nil { return uuid.Nil, err } default: @@ -565,11 +565,11 @@ func (pnd *pndImplementation) ChangeOND(duid uuid.UUID, operation ppb.ApiOperati ctx := context.WithValue(context.Background(), types.CtxKeyOperation, operation) // nolint payload := change.Payload{Original: original, Modified: modified} pathToSet := path - schema := d.SBI().Schema() - return d.Transport().Set(ctx, payload, pathToSet, schema) + schema := mne.SBI().Schema() + return mne.Transport().Set(ctx, payload, pathToSet, schema) } - ch := NewChange(duid, d.GetModel(), validatedCpy, callback) + ch := NewChange(duid, mne.GetModel(), validatedCpy, callback) if err := pnd.changes.Add(ch); err != nil { return uuid.Nil, err @@ -579,7 +579,7 @@ func (pnd *pndImplementation) ChangeOND(duid uuid.UUID, operation ppb.ApiOperati } func (pnd *pndImplementation) SubscribePath(uuid uuid.UUID, subList *ppb.SubscriptionList) error { - d, err := pnd.deviceService.Get(store.Query{ + mne, err := pnd.networkElementService.Get(store.Query{ ID: uuid, }) if err != nil { @@ -607,7 +607,7 @@ func (pnd *pndImplementation) SubscribePath(uuid uuid.UUID, subList *ppb.Subscri ctx := context.Background() ctx = context.WithValue(ctx, types.CtxKeyOpts, opts) - if err = d.Transport().Subscribe(ctx); err != nil { + if err = mne.Transport().Subscribe(ctx); err != nil { return err } } @@ -652,24 +652,24 @@ func handleRollbackError(id uuid.UUID, err error) { // TODO: Notion of invalid state needed. } -func (pnd *pndImplementation) handleCsbiDeletion(d device.Device) error { - log.Infof("csbi deletion triggered for %v", d.ID().String()) +func (pnd *pndImplementation) handleCsbiDeletion(mne networkelement.NetworkElement) error { + log.Infof("csbi deletion triggered for %v", mne.ID().String()) ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() req := &cpb.DeleteRequest{ Timestamp: time.Now().UnixNano(), - Did: []string{d.ID().String()}, + Did: []string{mne.ID().String()}, } resp, err := pnd.csbiClient.Delete(ctx, req) if err != nil { return err } - err = pnd.southboundService.Delete(d.SBI()) + err = pnd.southboundService.Delete(mne.SBI()) if err != nil { return err } log.WithFields(log.Fields{ - "uuid": d.ID().String(), + "uuid": mne.ID().String(), "status": resp.Status, }).Info("csbi deleted") return nil @@ -688,11 +688,11 @@ func (pnd *pndImplementation) handleCsbiEnrolment(name string, opt *tpb.Transpor return uuid.Nil, err } // the slice only contains one deployment - var devID uuid.UUID - for _, d := range resp.Deployments { - dCopy := d + var mneID uuid.UUID + for _, deployment := range resp.Deployments { + dCopy := deployment g.Go(func() error { - devID, err = pnd.createCsbiDevice(ctx, name, dCopy, opt) + mneID, err = pnd.createCsbiNetworkElement(ctx, name, dCopy, opt) if err != nil { return err } @@ -704,23 +704,23 @@ func (pnd *pndImplementation) handleCsbiEnrolment(name string, opt *tpb.Transpor return uuid.Nil, err } - return devID, nil + return mneID, nil } -// createCsbiDevice is a helper method for cSBI device creation. The method +// createCsbiNetworkElement is a helper method for cSBI network element creation. The method // waits for a SYN (which indicates that the cSBI is running and addressable) -// of the commissioned cSBI and creates the device within the controller. -func (pnd *pndImplementation) createCsbiDevice( +// of the commissioned cSBI and creates the network element within the controller. +func (pnd *pndImplementation) createCsbiNetworkElement( ctx context.Context, name string, - d *cpb.Deployment, + deployment *cpb.Deployment, opt *tpb.TransportOption, ) (uuid.UUID, error) { - id, err := uuid.Parse(d.Id) + id, err := uuid.Parse(deployment.Id) if err != nil { return uuid.Nil, err } - ch := make(chan device.Details, 1) + ch := make(chan networkelement.Details, 1) pnd.callback(id, ch) defer pnd.callback(id, nil) defer close(ch) @@ -729,17 +729,17 @@ func (pnd *pndImplementation) createCsbiDevice( select { case <-tickatus.C: log.WithFields(log.Fields{ - "id": d.Id, + "id": deployment.Id, "err": ctx.Err(), }).Error("csbi handshake timed out") - case deviceDetails := <-ch: - log.Infof("syn from csbi %v", deviceDetails.ID) - id, err := uuid.Parse(deviceDetails.ID) + case mneDetails := <-ch: + log.Infof("syn from csbi %v", mneDetails.ID) + id, err := uuid.Parse(mneDetails.ID) if err != nil { return uuid.Nil, err } csbiTransportOptions := &tpb.TransportOption{ - Address: deviceDetails.Address, + Address: mneDetails.Address, Username: opt.Username, Password: opt.Password, Tls: opt.Tls, @@ -757,7 +757,7 @@ func (pnd *pndImplementation) createCsbiDevice( for _, f := range files { req := &cpb.GetPayloadRequest{ Timestamp: time.Now().UnixNano(), - Did: d.Id, + Did: deployment.Id, File: f, } g.Go(func() error { @@ -786,13 +786,13 @@ func (pnd *pndImplementation) createCsbiDevice( if err != nil { return uuid.Nil, err } - d, err := NewDevice(name, uuid.Nil, csbiTransportOptions, csbi) + mne, err := NewNetworkElement(name, uuid.Nil, csbiTransportOptions, csbi) if err != nil { return uuid.Nil, err } - d.(*CsbiDevice).UUID = id - ch <- device.Details{TransportOption: opt} - if err := pnd.deviceService.Add(d); err != nil { + mne.(*CsbiNetworkElement).UUID = id + ch <- networkelement.Details{TransportOption: opt} + if err := pnd.networkElementService.Add(mne); err != nil { return uuid.Nil, err } return id, nil @@ -936,7 +936,7 @@ func saveStreamToFile[T StreamClient](sc T, filename string, id uuid.UUID) (err return nil } -// MarshalBSON implements the MarshalBSON interface to store a device as BSON. +// MarshalBSON implements the MarshalBSON interface to store a network element as BSON. func (pnd *pndImplementation) MarshalBSON() ([]byte, error) { return bson.Marshal(&struct { ID string `bson:"_id"` @@ -949,9 +949,9 @@ func (pnd *pndImplementation) MarshalBSON() ([]byte, error) { }) } -// UpdateONDAfterSubscribeResponse takes a device and forwards it to the device service to handle the update. -func (pnd *pndImplementation) UpdateDeviceAfterSubscribeResponse(device device.Device) error { - if err := pnd.deviceService.Update(device); err != nil { +// UpdateMNEAfterSubscribeResponse takes a network element and forwards it to the network element service to handle the update. +func (pnd *pndImplementation) UpdateNetworkElementAfterSubscribeResponse(mne networkelement.NetworkElement) error { + if err := pnd.networkElementService.Update(mne); err != nil { return err } diff --git a/controller/nucleus/principalNetworkDomain_test.go b/controller/nucleus/principalNetworkDomain_test.go index 214d3e767dfb93424cb1ccec586cfb7415dd30dc..f078ebae618c688e149a88eddca3a84b57a3eb3b 100644 --- a/controller/nucleus/principalNetworkDomain_test.go +++ b/controller/nucleus/principalNetworkDomain_test.go @@ -13,9 +13,9 @@ import ( spb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/southbound" tpb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/transport" eventservice "code.fbi.h-da.de/danet/gosdn/controller/eventService" - "code.fbi.h-da.de/danet/gosdn/controller/interfaces/device" eventInterfaces "code.fbi.h-da.de/danet/gosdn/controller/interfaces/event" "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkdomain" + "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkelement" "code.fbi.h-da.de/danet/gosdn/controller/interfaces/southbound" "code.fbi.h-da.de/danet/gosdn/controller/mocks" "code.fbi.h-da.de/danet/gosdn/controller/nucleus/util" @@ -89,7 +89,7 @@ func Test_destroy(t *testing.T) { } } -func Test_pndImplementation_AddDevice(t *testing.T) { +func Test_pndImplementation_AddNetworkElement(t *testing.T) { type args struct { name string opts *tpb.TransportOption @@ -119,22 +119,22 @@ func Test_pndImplementation_AddDevice(t *testing.T) { t.Error(err) } - _, err := pnd.AddDevice(tt.args.name, tt.args.opts, defaultSbiID) + _, err := pnd.AddNetworkElement(tt.args.name, tt.args.opts, defaultSbiID) if (err != nil) != tt.wantErr { - t.Errorf("AddDevice() error = %v, wantErr %v", err, tt.wantErr) + t.Errorf("AddNetworkElement() error = %v, wantErr %v", err, tt.wantErr) } if tt.name != "fails wrong type" { if err == nil { - d, err := pnd.deviceService.Get(store.Query{Name: tt.args.name}) + mne, err := pnd.networkElementService.Get(store.Query{Name: tt.args.name}) if err != nil { - t.Errorf("AddDevice() error = %v", err) + t.Errorf("AddNetworkElement() error = %v", err) return } - if d.Name() != tt.args.name { - t.Errorf("AddDevice() got = %v, want %v", d.Name(), tt.args.name) + if mne.Name() != tt.args.name { + t.Errorf("AddNetworkElement() got = %v, want %v", mne.Name(), tt.args.name) } - if err := pnd.deviceService.Delete(d); err != nil { + if err := pnd.networkElementService.Delete(mne); err != nil { t.Error(err) } } @@ -183,7 +183,7 @@ func Test_pndImplementation_AddSbi(t *testing.T) { if err == nil { sbi, err := pnd.southboundService.Get(store.Query{ID: defaultSbiID}) if err != nil { - t.Errorf("AddSbi() SBI %v not in device store %v", + t.Errorf("AddSbi() SBI %v not in network element store %v", tt.args.sbi, sbi) } if err := pnd.southboundService.Delete(sbi); err != nil { @@ -197,10 +197,10 @@ func Test_pndImplementation_AddSbi(t *testing.T) { func Test_pndImplementation_Destroy(t *testing.T) { type fields struct { - name string - description string - sbi southbound.Service - devices device.Service + name string + description string + sbi southbound.Service + networkElements networkelement.Service } tests := []struct { name string @@ -212,10 +212,10 @@ func Test_pndImplementation_Destroy(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { pnd := &pndImplementation{ - Name: tt.fields.name, - Description: tt.fields.description, - southboundService: tt.fields.sbi, - deviceService: tt.fields.devices, + Name: tt.fields.name, + Description: tt.fields.description, + southboundService: tt.fields.sbi, + networkElementService: tt.fields.networkElements, } if err := pnd.Destroy(); (err != nil) != tt.wantErr { t.Errorf("Destroy() error = %v, wantErr %v", err, tt.wantErr) @@ -258,7 +258,7 @@ func Test_pndImplementation_GetName(t *testing.T) { } } -func Test_pndImplementation_MarshalDevice(t *testing.T) { +func Test_pndImplementation_MarshalNetworkElement(t *testing.T) { type args struct { uuid uuid.UUID } @@ -270,7 +270,7 @@ func Test_pndImplementation_MarshalDevice(t *testing.T) { }{ { name: "default", - args: args{did}, + args: args{mneid}, want: "{\n\t\"Acl\": null,\n\t\"Bfd\": null,\n\t\"Components\": null,\n\t\"Interfaces\": null,\n\t\"Keychains\": null,\n\t\"Lldp\": null,\n\t\"LocalRoutes\": null,\n\t\"Messages\": null,\n\t\"NetworkInstances\": null,\n\t\"RoutingPolicy\": null,\n\t\"System\": null\n}", wantErr: false, }, @@ -288,32 +288,32 @@ func Test_pndImplementation_MarshalDevice(t *testing.T) { if err != nil { t.Error("could not add sbi") } - d := &CommonDevice{ + mne := &CommonNetworkElement{ UUID: tt.args.uuid, Model: &openconfig.Device{}, sbi: sbi, transport: nil, } - _, err = pnd.addDevice(d) + _, err = pnd.addNetworkElement(mne) if err != nil { t.Error(err) } - got, err := pnd.MarshalDevice(tt.args.uuid.String()) + got, err := pnd.MarshalNetworkElement(tt.args.uuid.String()) if (err != nil) != tt.wantErr { - t.Errorf("MarshalDevice() error = %v, wantErr %v", err, tt.wantErr) + t.Errorf("MarshalNetworkElement() error = %v, wantErr %v", err, tt.wantErr) return } if got != tt.want { - t.Errorf("MarshalDevice() got = %v, want %v", got, tt.want) + t.Errorf("MarshalNetworkElement() got = %v, want %v", got, tt.want) } - if err := pnd.deviceService.Delete(d); err != nil { + if err := pnd.networkElementService.Delete(mne); err != nil { t.Error(err) } }) } } -func Test_pndImplementation_RemoveDevice(t *testing.T) { +func Test_pndImplementation_RemoveNetworkElement(t *testing.T) { type args struct { uuid uuid.UUID } @@ -322,7 +322,7 @@ func Test_pndImplementation_RemoveDevice(t *testing.T) { args args wantErr bool }{ - {name: "default", args: args{uuid: did}, wantErr: false}, + {name: "default", args: args{uuid: mneid}, wantErr: false}, {name: "fails", args: args{uuid: uuid.New()}, wantErr: true}, } @@ -340,18 +340,18 @@ func Test_pndImplementation_RemoveDevice(t *testing.T) { if err != nil { t.Error("could not add sbi") } - d := &CommonDevice{ - UUID: did, + mne := &CommonNetworkElement{ + UUID: mneid, Model: &openconfig.Device{}, sbi: sbi, transport: nil, } - _, err = pnd.addDevice(d) + _, err = pnd.addNetworkElement(mne) if err != nil { t.Error(err) } - if err := pnd.RemoveDevice(tt.args.uuid); (err != nil) != tt.wantErr { - t.Errorf("RemoveDevice() error = %v, wantErr %v", err, tt.wantErr) + if err := pnd.RemoveNetworkElement(tt.args.uuid); (err != nil) != tt.wantErr { + t.Errorf("RemoveNetworkElement() error = %v, wantErr %v", err, tt.wantErr) } }) } @@ -375,16 +375,16 @@ func Test_pndImplementation_RemoveSbi(t *testing.T) { t.Parallel() eventService := eventservice.NewMockEventService() sbiStore := NewMemorySbiStore() - deviceStore := NewMemoryDeviceStore() + networkElementStore := NewMemoryNetworkElementStore() sbiService := NewSbiService(sbiStore, eventService) - deviceService := NewDeviceService(deviceStore, sbiService, eventService) + networkElementService := NewNetworkElementService(networkElementStore, sbiService, eventService) pnd := &pndImplementation{ - Name: "test-remove-sbi", - Description: "test-remove-sbi", - southboundService: sbiService, - deviceService: deviceService, - Id: defaultPndID, + Name: "test-remove-sbi", + Description: "test-remove-sbi", + southboundService: sbiService, + networkElementService: networkElementService, + Id: defaultPndID, } sbi, err := NewSBI(spb.Type_TYPE_OPENCONFIG, defaultSbiID) @@ -406,22 +406,22 @@ func Test_pndImplementation_RemoveSbi(t *testing.T) { t.Errorf("RemoveSbi() SBI still in SBI store %v", pnd.southboundService) } - if tt.name == "exclusively remove associated devices" { - allDevices, _ := pnd.deviceService.GetAll() - if len(allDevices) != 1 { - t.Errorf("RemoveSbi() non associated devices should remain in the storage %v", allDevices) + if tt.name == "exclusively remove associated network elements" { + allNetworkElements, _ := pnd.networkElementService.GetAll() + if len(allNetworkElements) != 1 { + t.Errorf("RemoveSbi() non associated network elements should remain in the storage %v", allNetworkElements) } } else { - allDevices, _ := pnd.deviceService.GetAll() - if len(allDevices) != 0 { - t.Errorf("RemoveSbi() associated devices have not been removed correctly %v", len(allDevices)) + allNetworkElements, _ := pnd.networkElementService.GetAll() + if len(allNetworkElements) != 0 { + t.Errorf("RemoveSbi() associated network elements have not been removed correctly %v", len(allNetworkElements)) } } }) } } -func Test_pndImplementation_RemoveSbiWithAssociatedDevices(t *testing.T) { +func Test_pndImplementation_RemoveSbiWithAssociatedNetworkElements(t *testing.T) { opts := &tpb.TransportOption{ TransportOption: &tpb.TransportOption_GnmiTransportOption{ GnmiTransportOption: &tpb.GnmiTransportOption{}, @@ -435,7 +435,7 @@ func Test_pndImplementation_RemoveSbiWithAssociatedDevices(t *testing.T) { args args wantErr bool }{ - {name: "exclusively remove associated devices", args: args{id: defaultSbiID}, wantErr: false}, + {name: "exclusively remove associated network elements", args: args{id: defaultSbiID}, wantErr: false}, } for _, tt := range tests { tt := tt @@ -443,16 +443,16 @@ func Test_pndImplementation_RemoveSbiWithAssociatedDevices(t *testing.T) { t.Parallel() eventService := eventservice.NewMockEventService() sbiStore := NewMemorySbiStore() - deviceStore := NewMemoryDeviceStore() + networkElementStore := NewMemoryNetworkElementStore() sbiService := NewSbiService(sbiStore, eventService) - deviceService := NewDeviceService(deviceStore, sbiService, eventService) + networkElementService := NewNetworkElementService(networkElementStore, sbiService, eventService) pnd := &pndImplementation{ - Name: "test-remove-sbi", - Description: "test-remove-sbi", - southboundService: sbiService, - deviceService: deviceService, - Id: defaultPndID, + Name: "test-remove-sbi", + Description: "test-remove-sbi", + southboundService: sbiService, + networkElementService: networkElementService, + Id: defaultPndID, } sbi, err := NewSBI(spb.Type_TYPE_OPENCONFIG, defaultSbiID) @@ -468,20 +468,20 @@ func Test_pndImplementation_RemoveSbiWithAssociatedDevices(t *testing.T) { if err := pnd.addSbi(&OpenConfig{id: defaultSbiID}); err != nil { t.Error(err) } - _, err = pnd.AddDevice("associatedDevice", opts, tt.args.id) + _, err = pnd.AddNetworkElement("associatedNetworkElement", opts, tt.args.id) if err != nil { t.Error(err) } - _, err = pnd.AddDevice("associatedDevice2", opts, tt.args.id) + _, err = pnd.AddNetworkElement("associatedNetworkElement2", opts, tt.args.id) if err != nil { t.Error(err) } - if tt.name == "exclusively remove associated devices" { + if tt.name == "exclusively remove associated network elements" { newID := uuid.New() if err := pnd.addSbi(&OpenConfig{id: newID}); err != nil { t.Error(err) } - _, err := pnd.AddDevice("associatedDevice2", opts, newID) + _, err := pnd.AddNetworkElement("associatedNetworkElement2", opts, newID) if err != nil { t.Error(err) } @@ -496,15 +496,15 @@ func Test_pndImplementation_RemoveSbiWithAssociatedDevices(t *testing.T) { t.Errorf("RemoveSbi() SBI still in SBI store %v", pnd.southboundService) } - if tt.name == "exclusively remove associated devices" { - allDevices, _ := pnd.southboundService.GetAll() - if len(allDevices) != 1 { - t.Errorf("RemoveSbi() non associated devices should remain in the storage %v", allDevices) + if tt.name == "exclusively remove associated network elements" { + allNetworkElements, _ := pnd.southboundService.GetAll() + if len(allNetworkElements) != 1 { + t.Errorf("RemoveSbi() non associated network elements should remain in the storage %v", allNetworkElements) } } else { - allDevices, _ := pnd.southboundService.GetAll() - if len(allDevices) != 0 { - t.Errorf("RemoveSbi() associated devices have not been removed correctly %v", len(allDevices)) + allNetworkElements, _ := pnd.southboundService.GetAll() + if len(allNetworkElements) != 0 { + t.Errorf("RemoveSbi() associated network elements have not been removed correctly %v", len(allNetworkElements)) } } }) @@ -534,7 +534,7 @@ func Test_pndImplementation_Request(t *testing.T) { { name: "error", args: args{ - uuid: did, + uuid: mneid, path: "", rErr: errors.New("deliberate test fail"), }, @@ -547,15 +547,15 @@ func Test_pndImplementation_Request(t *testing.T) { t.Run(tt.name, func(t *testing.T) { t.Parallel() sbiService := NewGenericService[southbound.SouthboundInterface]() - deviceService := NewDeviceServiceMock() + networkElementService := NewNetworkElementServiceMock() pnd := pndImplementation{ - Name: "default", - Description: "default test pnd", - southboundService: &sbiService, - deviceService: deviceService, - changes: store.NewChangeStore(), - Id: defaultPndID, + Name: "default", + Description: "default test pnd", + southboundService: &sbiService, + networkElementService: networkElementService, + changes: store.NewChangeStore(), + Id: defaultPndID, } sbi, err := NewSBI(spb.Type_TYPE_OPENCONFIG) @@ -572,25 +572,25 @@ func Test_pndImplementation_Request(t *testing.T) { transport.On("Get", mockContext, mock.Anything).Return(&gpb.GetResponse{}, tt.args.rErr) transport.On("ProcessResponse", mock.Anything, mock.Anything, mock.Anything).Return(tt.args.rErr) - deviceWithMockTransport := &CommonDevice{ + networkElementWithMockTransport := &CommonNetworkElement{ UUID: mdid, Model: &openconfig.Device{}, sbi: sbi, transport: &transport, } - _, _ = pnd.addDevice(deviceWithMockTransport) + _, _ = pnd.addNetworkElement(networkElementWithMockTransport) _, err = pnd.Request(tt.args.uuid, tt.args.path) if (err != nil) != tt.wantErr { t.Errorf("Request() error = %v, wantErr %v", err, tt.wantErr) } - device, _ := pnd.deviceService.Get(store.Query{ID: mdid}) - if device == nil { + mne, _ := pnd.networkElementService.Get(store.Query{ID: mdid}) + if mne == nil { return } - if err := pnd.deviceService.Delete(device); err != nil { + if err := pnd.networkElementService.Delete(mne); err != nil { t.Error(err) } }) @@ -620,7 +620,7 @@ func Test_pndImplementation_RequestAll(t *testing.T) { { name: "error", args: args{ - uuid: did, + uuid: mneid, path: "", rErr: errors.New("deliberate test fail"), }, @@ -633,15 +633,15 @@ func Test_pndImplementation_RequestAll(t *testing.T) { t.Run(tt.name, func(t *testing.T) { t.Parallel() sbiService := NewGenericService[southbound.SouthboundInterface]() - deviceService := NewDeviceServiceMock() + networkElementService := NewNetworkElementServiceMock() pnd := pndImplementation{ - Name: "default", - Description: "default test pnd", - southboundService: &sbiService, - deviceService: deviceService, - changes: store.NewChangeStore(), - Id: defaultPndID, + Name: "default", + Description: "default test pnd", + southboundService: &sbiService, + networkElementService: networkElementService, + changes: store.NewChangeStore(), + Id: defaultPndID, } sbi, err := NewSBI(spb.Type_TYPE_OPENCONFIG) @@ -658,27 +658,27 @@ func Test_pndImplementation_RequestAll(t *testing.T) { transport.On("Get", mockContext, mock.Anything).Return(&gpb.GetResponse{}, tt.args.rErr) transport.On("ProcessResponse", mock.Anything, mock.Anything, mock.Anything).Return(tt.args.rErr) - deviceWithMockTransport := &CommonDevice{ + networkElementWithMockTransport := &CommonNetworkElement{ UUID: mdid, Model: &openconfig.Device{}, sbi: sbi, transport: &transport, } - _, _ = pnd.addDevice(deviceWithMockTransport) + _, _ = pnd.addNetworkElement(networkElementWithMockTransport) - device, _ := pnd.deviceService.Get(store.Query{ID: mdid}) - if device == nil { + mne, _ := pnd.networkElementService.Get(store.Query{ID: mdid}) + if mne == nil { return } - if err := pnd.deviceService.Delete(device); err != nil { + if err := pnd.networkElementService.Delete(mne); err != nil { t.Error(err) } }) } } -func Test_pndImplementation_ChangeOND(t *testing.T) { +func Test_pndImplementation_ChangeMNE(t *testing.T) { opts := &tpb.TransportOption{ TransportOption: &tpb.TransportOption_GnmiTransportOption{ GnmiTransportOption: &tpb.GnmiTransportOption{}, @@ -764,7 +764,7 @@ func Test_pndImplementation_ChangeOND(t *testing.T) { wantErr: true, }, { - name: "device not found", + name: "network element not found", args: args{ operation: ppb.ApiOperation_API_OPERATION_UPDATE, }, @@ -779,41 +779,41 @@ func Test_pndImplementation_ChangeOND(t *testing.T) { if err := pnd.addSbi(&OpenConfig{id: defaultSbiID}); err != nil { t.Error(err) } - _, err := pnd.AddDevice("testdevice", opts, defaultSbiID) + _, err := pnd.AddNetworkElement("testnetworkElement", opts, defaultSbiID) if err != nil { t.Error(err) return } - devices, err := pnd.deviceService.GetAllAsLoaded() + networkElements, err := pnd.networkElementService.GetAllAsLoaded() if err != nil { - err := errors.New("error fetching device") + err := errors.New("error fetching network element") t.Error(err) return } - deviceUUID, err := uuid.Parse(devices[0].ID) + neUUID, err := uuid.Parse(networkElements[0].ID) if err != nil { - err := errors.New("error parsing device uuid") + err := errors.New("error parsing network element uuid") t.Error(err) return } - _, err = pnd.ChangeOND(deviceUUID, tt.args.operation, tt.args.path, tt.args.value...) + _, err = pnd.ChangeMNE(neUUID, tt.args.operation, tt.args.path, tt.args.value...) if (err != nil) != tt.wantErr { - t.Errorf("ChangeOND() error = %v, wantErr %v", err, tt.wantErr) + t.Errorf("ChangeMNE() error = %v, wantErr %v", err, tt.wantErr) return } if !tt.wantErr { if len(pnd.changes.Store) != 1 { - t.Errorf("ChangeOND() unexpected change count. got %v, want 1", len(pnd.changes.Store)) + t.Errorf("ChangeMNE() unexpected change count. got %v, want 1", len(pnd.changes.Store)) } } }) } } -func Test_pndImplementation_GetDevice(t *testing.T) { +func Test_pndImplementation_GetNetworkElement(t *testing.T) { opts := &tpb.TransportOption{ Address: "", Username: "test", @@ -834,12 +834,12 @@ func Test_pndImplementation_GetDevice(t *testing.T) { t.Error(err) return } - d, err := NewDevice("default", did, opts, sbi) + mne, err := NewNetworkElement("default", mneid, opts, sbi) if err != nil { t.Error(err) return } - _, err = pnd.addDevice(d) + _, err = pnd.addNetworkElement(mne) if err != nil { t.Error(err) return @@ -856,12 +856,12 @@ func Test_pndImplementation_GetDevice(t *testing.T) { }{ { name: "default", - args: args{uuid: did}, + args: args{uuid: mneid}, want: sbi.Schema().Root, wantErr: false, }, { - name: "device not found", + name: "network element not found", args: args{uuid: mdid}, want: nil, wantErr: true, @@ -871,21 +871,21 @@ func Test_pndImplementation_GetDevice(t *testing.T) { tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() - foundDevice, err := pnd.GetDevice(tt.args.uuid.String()) + foundNetworkElement, err := pnd.GetNetworkElement(tt.args.uuid.String()) if (err != nil) != tt.wantErr { - t.Errorf("GetDevice() error = %v, wantErr %v", err, tt.wantErr) + t.Errorf("GetNetworkElement() error = %v, wantErr %v", err, tt.wantErr) return } - if foundDevice != nil { - if !reflect.DeepEqual(foundDevice.(device.Device).GetModel(), tt.want) { - t.Errorf("GetDevice() got = %v, want %v", foundDevice.(device.Device).GetModel(), tt.want) + if foundNetworkElement != nil { + if !reflect.DeepEqual(foundNetworkElement.(networkelement.NetworkElement).GetModel(), tt.want) { + t.Errorf("GetNetworkElement() got = %v, want %v", foundNetworkElement.(networkelement.NetworkElement).GetModel(), tt.want) } } }) } } -func Test_pndImplementation_GetDeviceByName(t *testing.T) { +func Test_pndImplementation_GetNetworkElementByName(t *testing.T) { opts := &tpb.TransportOption{ Address: "", Username: "test", @@ -906,12 +906,12 @@ func Test_pndImplementation_GetDeviceByName(t *testing.T) { t.Error(err) return } - d, err := NewDevice("my-device", did, opts, sbi) + mne, err := NewNetworkElement("my-mne", mneid, opts, sbi) if err != nil { t.Error(err) return } - _, err = pnd.addDevice(d) + _, err = pnd.addNetworkElement(mne) if err != nil { t.Error(err) return @@ -927,13 +927,13 @@ func Test_pndImplementation_GetDeviceByName(t *testing.T) { }{ { name: "default", - args: args{name: d.Name()}, + args: args{name: mne.Name()}, want: sbi.Schema().Root, wantErr: false, }, { - name: "device not found", - args: args{name: "test-device"}, + name: "network element not found", + args: args{name: "test-mne"}, want: nil, wantErr: true, }, @@ -942,14 +942,14 @@ func Test_pndImplementation_GetDeviceByName(t *testing.T) { tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() - foundDevice, err := pnd.GetDevice(tt.args.name) + foundNetworkElement, err := pnd.GetNetworkElement(tt.args.name) if (err != nil) != tt.wantErr { - t.Errorf("GetDeviceByName() error = %v, wantErr %v", err, tt.wantErr) + t.Errorf("GetNetworkElementByName() error = %v, wantErr %v", err, tt.wantErr) return } - if foundDevice != nil { - if !reflect.DeepEqual(foundDevice.(device.Device).GetModel(), tt.want) { - t.Errorf("GetDeviceByName() got = %v, want %v", foundDevice.(device.Device).GetModel(), tt.want) + if foundNetworkElement != nil { + if !reflect.DeepEqual(foundNetworkElement.(networkelement.NetworkElement).GetModel(), tt.want) { + t.Errorf("GetNetworkElementByName() got = %v, want %v", foundNetworkElement.(networkelement.NetworkElement).GetModel(), tt.want) } } }) @@ -976,30 +976,30 @@ func Test_pndImplementation_Confirm(t *testing.T) { t.Run(tt.name, func(t *testing.T) { t.Parallel() sbiService := NewGenericService[southbound.SouthboundInterface]() - deviceService := NewDeviceServiceMock() + networkElementService := NewNetworkElementServiceMock() pnd := pndImplementation{ - Name: "default", - Description: "default test pnd", - southboundService: &sbiService, - deviceService: deviceService, - changes: store.NewChangeStore(), - Id: defaultPndID, + Name: "default", + Description: "default test pnd", + southboundService: &sbiService, + networkElementService: networkElementService, + changes: store.NewChangeStore(), + Id: defaultPndID, } - d := mockDevice() - tr, ok := d.Transport().(*mocks.Transport) + mne := mockNetworkElement() + tr, ok := mne.Transport().(*mocks.Transport) if !ok { log.Errorf("Confirm(), failed type conversion: %v", ok) } tr.On("Set", mockContext, mock.Anything, mock.Anything, mock.Anything).Return(nil) - _, err := pnd.addDevice(d) + _, err := pnd.addNetworkElement(mne) if err != nil { t.Error(err) return } - _, err = pnd.ChangeOND(d.ID(), ppb.ApiOperation_API_OPERATION_UPDATE, "system/config/hostname", "ceos3000") + _, err = pnd.ChangeMNE(mne.ID(), ppb.ApiOperation_API_OPERATION_UPDATE, "system/config/hostname", "ceos3000") if err != nil { t.Error(err) return @@ -1026,7 +1026,7 @@ func Test_pndImplementation_PendingChanges(t *testing.T) { } store := store.NewChangeStore() - pending := NewChange(did, &openconfig.Device{}, &openconfig.Device{}, callback) + pending := NewChange(mneid, &openconfig.Device{}, &openconfig.Device{}, callback) if err := store.Add(pending); err != nil { t.Error(err) return @@ -1059,7 +1059,7 @@ func Test_pndImplementation_CommittedChanges(t *testing.T) { } store := store.NewChangeStore() - committed := NewChange(did, &openconfig.Device{}, &openconfig.Device{}, callback) + committed := NewChange(mneid, &openconfig.Device{}, &openconfig.Device{}, callback) if err := committed.Commit(); err != nil { t.Error(err) return @@ -1095,7 +1095,7 @@ func Test_pndImplementation_ConfirmedChanges(t *testing.T) { return nil } store := store.NewChangeStore() - confirmed := NewChange(did, &openconfig.Device{}, &openconfig.Device{}, callback) + confirmed := NewChange(mneid, &openconfig.Device{}, &openconfig.Device{}, callback) if err := confirmed.Commit(); err != nil { t.Error(err) return @@ -1237,15 +1237,15 @@ func Test_pndImplementation_saveGoStructsToFile(t *testing.T) { func Test_pndImplementation_SubscribePath(t *testing.T) { type fields struct { - Name string - Description string - southboundService southbound.Service - deviceService device.Service - changes *store.ChangeStore - ID uuid.UUID - csbiClient cpb.CsbiServiceClient - callback func(uuid.UUID, chan device.Details) - eventService eventInterfaces.Service + Name string + Description string + southboundService southbound.Service + networkElementService networkelement.Service + changes *store.ChangeStore + ID uuid.UUID + csbiClient cpb.CsbiServiceClient + callback func(uuid.UUID, chan networkelement.Details) + eventService eventInterfaces.Service } type args struct { uuid uuid.UUID @@ -1261,7 +1261,7 @@ func Test_pndImplementation_SubscribePath(t *testing.T) { // { // name: "default", // args: args{ - // uuid: did, + // uuid: mneid, // subList: &ppb.SubscriptionList{ // Subscription: []*ppb.Subscription{ // { @@ -1278,15 +1278,15 @@ func Test_pndImplementation_SubscribePath(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { pnd := &pndImplementation{ - Name: tt.fields.Name, - Description: tt.fields.Description, - southboundService: tt.fields.southboundService, - deviceService: tt.fields.deviceService, - changes: tt.fields.changes, - Id: tt.fields.ID, - csbiClient: tt.fields.csbiClient, - callback: tt.fields.callback, - eventService: tt.fields.eventService, + Name: tt.fields.Name, + Description: tt.fields.Description, + southboundService: tt.fields.southboundService, + networkElementService: tt.fields.networkElementService, + changes: tt.fields.changes, + Id: tt.fields.ID, + csbiClient: tt.fields.csbiClient, + callback: tt.fields.callback, + eventService: tt.fields.eventService, } if err := pnd.SubscribePath(tt.args.uuid, tt.args.subList); (err != nil) != tt.wantErr { t.Errorf("pndImplementation.SubscribePath() error = %v, wantErr %v", err, tt.wantErr) diff --git a/controller/nucleus/sbiFilesystemStore_test.go b/controller/nucleus/sbiFilesystemStore_test.go index 24ab4dae94443d461fd561f5539434a6fc1d5a17..44d74096a3286f0c931f15d273ba4451639e750a 100644 --- a/controller/nucleus/sbiFilesystemStore_test.go +++ b/controller/nucleus/sbiFilesystemStore_test.go @@ -11,7 +11,7 @@ import ( func ensureStoreFilesForTestsAreRemoved() { ensureStoreFileForTestsIsRemoved(store.SbiFilenameSuffix) - ensureStoreFileForTestsIsRemoved(store.DeviceFilenameSuffix) + ensureStoreFileForTestsIsRemoved(store.NetworkElementFilenameSuffix) } func TestAddSbi(t *testing.T) { diff --git a/controller/nucleus/sbiService.go b/controller/nucleus/sbiService.go index 8c1902431e900c177b99baaed58cabba778e59dc..1b68b9017eba06fb9c59d7a4b27fd4ee52714ebf 100644 --- a/controller/nucleus/sbiService.go +++ b/controller/nucleus/sbiService.go @@ -37,12 +37,12 @@ func (s *SbiService) Get(query store.Query) (southbound.SouthboundInterface, err return nil, err } - device, err := s.createSbiFromStore(loadedSbi) + sbi, err := s.createSbiFromStore(loadedSbi) if err != nil { return nil, err } - return device, nil + return sbi, nil } // GetAll returns all stored SBIs. diff --git a/controller/nucleus/util/pluginVariables.go b/controller/nucleus/util/pluginVariables.go index 27d876432384af855d766fd8e8b351d8523dfdc2..5b9283e0146b1f68d34afd6564e1061214722960 100644 --- a/controller/nucleus/util/pluginVariables.go +++ b/controller/nucleus/util/pluginVariables.go @@ -2,14 +2,14 @@ package util const ( // GoStructName references the name of a generated gostruct file that has - // been requested while creating a new device of type plugin/csbi. + // been requested while creating a new network element of type plugin/csbi. GoStructName string = "gostructs.go" // ManifestFileName references the name of a manifest file that has been - // requested while creating a new device of type plugin/csbi. + // requested while creating a new network element of type plugin/csbi. ManifestFileName string = "plugin.yml" // GoStructAdditionsName references the name of a additional file // containing the sbi specific methods. It is provided in the process of - // creating a new device of type plugin/csbi. + // creating a new network element of type plugin/csbi. GoStructAdditionsName string = "csbiAdditions.go" // PluginOutputName references the name of a generated plugin. PluginOutputName string = "plugin.so" diff --git a/controller/store/filesystem-settings.go b/controller/store/filesystem-settings.go index cba093e64af2b7ebde453dfc6e553f80bbb2d3b7..cc622e72805349f33e40bc315e6b6d814207559e 100644 --- a/controller/store/filesystem-settings.go +++ b/controller/store/filesystem-settings.go @@ -3,8 +3,8 @@ package store const ( // PndFilename is the name of the file where the pnds are stored. PndFilename string = "pndStore.json" - // DeviceFilenameSuffix is the suffix of the file where the devices are stored. - DeviceFilenameSuffix string = "deviceStore.json" + // NetworkElementFilenameSuffix is the suffix of the file where the network elements are stored. + NetworkElementFilenameSuffix string = "networkElementStore.json" // SbiFilenameSuffix is the suffix of the file where the sbis are stored. SbiFilenameSuffix string = "sbiStore.json" // UserFilename is the name of the file where the users are stored. diff --git a/controller/store/utils.go b/controller/store/utils.go index 06bc41d5e1014d6144113ae046afa7274c8da7ff..09746a91b72c123be7d8e8db14b426de9c2cf4b7 100644 --- a/controller/store/utils.go +++ b/controller/store/utils.go @@ -15,7 +15,7 @@ import ( func FromString(id string) (uuid.UUID, error) { idAsUUID, err := uuid.Parse(id) - // id is no UUID therefore it could be a device name. + // id is no UUID therefore it could be a network element name. // The name will be returned within the error. if err != nil { log.WithFields(log.Fields{ diff --git a/controller/test/integration/nucleusIntegration_test.go b/controller/test/integration/nucleusIntegration_test.go index 5cf80f4c2ea16e2a7c5076e87b99e729d81cb190..62c56e8afd9d4b1a358767777c2cad8383e038ea 100644 --- a/controller/test/integration/nucleusIntegration_test.go +++ b/controller/test/integration/nucleusIntegration_test.go @@ -186,12 +186,12 @@ func TestGnmi_SetValidIntegration(t *testing.T) { t.Error(err) return } - _, err = pnd.AddDevice("test", opt, sbi.ID()) + _, err = pnd.AddNetworkElement("test", opt, sbi.ID()) if err != nil { t.Error(err) return } - device, err := pnd.GetDevice("test") + mne, err := pnd.GetNetworkElement("test") if err != nil { t.Error(err) return @@ -228,7 +228,7 @@ func TestGnmi_SetValidIntegration(t *testing.T) { tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() - cuid, err := pnd.ChangeOND(device.ID(), tt.apiOp, tt.path, tt.value) + cuid, err := pnd.ChangeMNE(mne.ID(), tt.apiOp, tt.path, tt.value) if err != nil { t.Error(err) return @@ -242,7 +242,7 @@ func TestGnmi_SetValidIntegration(t *testing.T) { return } if tt.name != "delete" { - resp, err := pnd.Request(device.ID(), tt.path) + resp, err := pnd.Request(mne.ID(), tt.path) if err != nil { t.Error(err) return @@ -257,7 +257,7 @@ func TestGnmi_SetValidIntegration(t *testing.T) { } got := r.Notification[0].Update[0].Val.GetStringVal() if !reflect.DeepEqual(got, tt.want) { - t.Errorf("GetDevice() got = %v, want %v", got, tt.want) + t.Errorf("GetNetworkElement() got = %v, want %v", got, tt.want) } } }) diff --git a/controller/test/targets.go b/controller/test/targets.go index 3088f26fd57ed0548ac46d5402d174b82dde3faf..783c5feb75643275e1dea8067ceab23b37da4207 100644 --- a/controller/test/targets.go +++ b/controller/test/targets.go @@ -20,7 +20,7 @@ type server struct { } func callback(newConfig ygot.ValidatedGoStruct) error { - // Apply the config to your device and return nil if success. return error if fails. + // Apply the config to your network element and return nil if success. return error if fails. // // Do something ... return nil diff --git a/controller/topology/ports/portStore.go b/controller/topology/ports/portStore.go index 70ce2dfa90f0047b5b45b278f5f049a52251d857..024c0f9114f2d2c297a433df163f8b00d97b22e6 100644 --- a/controller/topology/ports/portStore.go +++ b/controller/topology/ports/portStore.go @@ -4,7 +4,7 @@ import ( "fmt" "code.fbi.h-da.de/danet/gosdn/controller/customerrs" - "code.fbi.h-da.de/danet/gosdn/controller/interfaces/device" + "code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkelement" "code.fbi.h-da.de/danet/gosdn/controller/nucleus/database" query "code.fbi.h-da.de/danet/gosdn/controller/store" @@ -164,7 +164,7 @@ func (s *DatabasePortStore) Add(port Port) (err error) { // Update updates a existing port. func (s *DatabasePortStore) Update(port Port) (err error) { - var updatedLoadedDevice device.LoadedDevice + var updatedLoadedNetworkElement networkelement.LoadedNetworkElement client, ctx, cancel := database.GetMongoConnection() defer cancel() @@ -188,7 +188,7 @@ func (s *DatabasePortStore) Update(port Port) (err error) { Collection(s.storeName). FindOneAndUpdate( ctx, bson.M{"_id": port.ID.String()}, update, &opt). - Decode(&updatedLoadedDevice) + Decode(&updatedLoadedNetworkElement) if err != nil { return customerrs.CouldNotUpdateError{Identifier: port.ID, Type: port, Err: err} } diff --git a/controller/topology/routing-tables/route.go b/controller/topology/routing-tables/route.go index 4f85f99b3f1587dd97e065dba854df941fc0500d..ad7da495d82a6a2fafa7fb938fdb39c1ea68c8cd 100644 --- a/controller/topology/routing-tables/route.go +++ b/controller/topology/routing-tables/route.go @@ -4,7 +4,7 @@ import ( "github.com/google/uuid" ) -// Route is a routing table entry on a device. +// Route is a routing table entry on a network element. type Route struct { ID uuid.UUID `bson:"_id"` TargetIPRange string `bson:"target_ip_range"` diff --git a/controller/topology/routing-tables/routingTable.go b/controller/topology/routing-tables/routingTable.go index 92e35bd30cd884e1bad45ce18bcf770b9700bcd5..832fa7435517804cf6c77c8698daa37458bb490b 100644 --- a/controller/topology/routing-tables/routingTable.go +++ b/controller/topology/routing-tables/routingTable.go @@ -2,7 +2,7 @@ package routingtables import "github.com/google/uuid" -// RoutingTable is the routing table of a device. +// RoutingTable is the routing table of a network element. type RoutingTable struct { ID uuid.UUID `bson:"_id"` NodeID uuid.UUID `bson:"node_id"` diff --git a/scripts/test-add-device.sh b/scripts/test-add-device.sh index bc02f14fd9b1cafabb094171134253a954669b9a..0882428992d8522d0a0b604a4fadff815924f560 100755 --- a/scripts/test-add-device.sh +++ b/scripts/test-add-device.sh @@ -5,5 +5,5 @@ if [ $# -eq 0 ] fi ./artifacts/gosdnc login --controller 127.0.0.1:55055 --u admin --p $1 ./artifacts/gosdnc pnd use 5f20f34b-cbd0-4511-9ddc-c50cf6a3b49d -./artifacts/gosdnc device create -a 172.100.0.11:6030 -u admin -p admin --name="test-ceos-1" -./artifacts/gosdnc device list +./artifacts/gosdnc mne create -a 172.100.0.11:6030 -u admin -p admin --name="test-ceos-1" +./artifacts/gosdnc mne list diff --git a/scripts/test-add-multiple-devices.sh b/scripts/test-add-multiple-devices.sh index 58c6a49445e16fdb7c2903ad0e3e428a013db1b1..00c592a8647348aaaccce0b6dbc97301fdd69f66 100755 --- a/scripts/test-add-multiple-devices.sh +++ b/scripts/test-add-multiple-devices.sh @@ -1,6 +1,6 @@ if [ $# -eq 0 ] then - echo 'you need to provide the password for the admin user and the amount of devices to add' + echo 'you need to provide the password for the admin user and the amount of network elements to add' exit 1 fi @@ -9,7 +9,7 @@ fi for i in $(seq 1 $2) do - ./artifacts/gosdnc device create -a 172.100.0.11:6030 -u admin -p admin --name="test-ceos-$i" + ./artifacts/gosdnc mne create -a 172.100.0.11:6030 -u admin -p admin --name="test-ceos-$i" done -./artifacts/gosdnc device list +./artifacts/gosdnc mne list diff --git a/scripts/test-add-two-devices.sh b/scripts/test-add-two-devices.sh index 3506c86b4f6d4df5cfeaf99151ee79af80729876..c3cf5d7530b5fa2319f65753ffbaf2cb21b77772 100755 --- a/scripts/test-add-two-devices.sh +++ b/scripts/test-add-two-devices.sh @@ -5,6 +5,6 @@ if [ $# -eq 0 ] fi ./artifacts/gosdnc login --controller 127.0.0.1:55055 --u admin --p $1 ./artifacts/gosdnc pnd use 5f20f34b-cbd0-4511-9ddc-c50cf6a3b49d -./artifacts/gosdnc device create -a 172.100.0.11:6030 -u admin -p admin --name="ceos0" -./artifacts/gosdnc device create -a 172.100.0.12:6030 -u admin -p admin --name="ceos1a" -./artifacts/gosdnc device list +./artifacts/gosdnc mne create -a 172.100.0.11:6030 -u admin -p admin --name="ceos0" +./artifacts/gosdnc mne create -a 172.100.0.12:6030 -u admin -p admin --name="ceos1a" +./artifacts/gosdnc mne list diff --git a/scripts/test-list-devices.sh b/scripts/test-list-devices.sh index 39a1c08b28bc8489b4010885fb6e3ed6eeec6c6b..8162d000e540a5dcf89c2e94ba7ed2e9592a6c9e 100755 --- a/scripts/test-list-devices.sh +++ b/scripts/test-list-devices.sh @@ -6,4 +6,4 @@ fi ./artifacts/gosdnc login --controller 127.0.0.1:55055 --u admin --p $1 ./artifacts/gosdnc pnd use 5f20f34b-cbd0-4511-9ddc-c50cf6a3b49d -./artifacts/gosdnc device list +./artifacts/gosdnc mne list