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.pb.gw.go b/api/go/gosdn/device/device.pb.gw.go deleted file mode 100644 index 64ca57255f446d0de326e6fa388a479d7416c998..0000000000000000000000000000000000000000 --- a/api/go/gosdn/device/device.pb.gw.go +++ /dev/null @@ -1,414 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: gosdn/device/device.proto - -/* -Package device is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package device - -import ( - "context" - "io" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "google.golang.org/protobuf/proto" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -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 - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Add(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -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 - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Add(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_DeviceService_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 - 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 { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Get(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -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 - 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 { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Get(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_DeviceService_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 - 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 { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -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 - 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 { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetAll(ctx, &protoReq) - return msg, metadata, err - -} - -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 - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Update(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -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 - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Update(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterDeviceServiceHandlerServer registers the http handlers for service DeviceService to "mux". -// UnaryRPC :call DeviceServiceServer 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 { - - mux.Handle("POST", pattern_DeviceService_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")) - 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) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - 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()...) - - }) - - mux.Handle("GET", pattern_DeviceService_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")) - 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) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - 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()...) - - }) - - mux.Handle("GET", pattern_DeviceService_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")) - 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) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - 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()...) - - }) - - mux.Handle("POST", pattern_DeviceService_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")) - 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) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - 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()...) - - }) - - return nil -} - -// RegisterDeviceServiceHandlerFromEndpoint is same as RegisterDeviceServiceHandler 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) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterDeviceServiceHandler(ctx, mux, conn) -} - -// RegisterDeviceServiceHandler registers the http handlers for service DeviceService 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)) -} - -// 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" -// 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 { - - mux.Handle("POST", pattern_DeviceService_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")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_DeviceService_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()...) - - }) - - mux.Handle("GET", pattern_DeviceService_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")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_DeviceService_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()...) - - }) - - mux.Handle("GET", pattern_DeviceService_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")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_DeviceService_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()...) - - }) - - mux.Handle("POST", pattern_DeviceService_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")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_DeviceService_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()...) - - }) - - return nil -} - -var ( - pattern_DeviceService_Add_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"device", "create"}, "")) - - pattern_DeviceService_Get_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"device"}, "")) - - pattern_DeviceService_GetAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"device", "all"}, "")) - - pattern_DeviceService_Update_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"device", "update"}, "")) -) - -var ( - forward_DeviceService_Add_0 = runtime.ForwardResponseMessage - - forward_DeviceService_Get_0 = runtime.ForwardResponseMessage - - forward_DeviceService_GetAll_0 = runtime.ForwardResponseMessage - - forward_DeviceService_Update_0 = runtime.ForwardResponseMessage -) 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/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/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/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 0634fc43089671fb986cc1841b8eb3db5b920bf3..305869cda7aaef001935ef5ac8383b79d17aa621 100644 --- a/cli/adapter/PndAdapter.go +++ b/cli/adapter/PndAdapter.go @@ -45,9 +45,9 @@ 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.SetMneListResponse, error) { +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,9 +64,9 @@ 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.GetMneResponse, error) { +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 @@ -74,10 +74,10 @@ func (p *PndAdapter) GetDevice(ctx context.Context, identifier string) (*ppb.Get 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.GetFlattenedMneListResponse, error) { +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 @@ -85,8 +85,8 @@ func (p *PndAdapter) GetFlattenedDevices(ctx context.Context) (*ppb.GetFlattened return resp, nil } -// RemoveDevice removes a device from the controller. -func (p *PndAdapter) RemoveDevice(ctx context.Context, did uuid.UUID) (*ppb.DeleteMneResponse, error) { +// 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 @@ -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 5998d4d818dfc2622117c38aa31755b3cd54ff13..dac74096cf41fb9334408f257ed6a8e36484403b 100644 --- a/cli/adapter/PndAdapter_test.go +++ b/cli/adapter/PndAdapter_test.go @@ -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 @@ -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,8 +188,8 @@ 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) } }) } @@ -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/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 79% rename from cli/cmd/deviceDelete.go rename to cli/cmd/networkElementDelete.go index a2a4d6096a2553bbc7b186d879210bd6473cbe9f..134972c4eca504afdb8210dc99c3688ea1636656 100644 --- a/cli/cmd/deviceDelete.go +++ b/cli/cmd/networkElementDelete.go @@ -38,17 +38,17 @@ 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 @@ -56,7 +56,7 @@ The device UUID and request path must be specified as a positional arguments.`, 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 86% rename from cli/cmd/deviceGet.go rename to cli/cmd/networkElementGet.go index cddccf18d53274843a379c3c324e881f10742736..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 { @@ -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 cb3357a062b0bcc1198c0ed425761ab26c573f82..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.GetMne() { - 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 78% rename from cli/cmd/deviceSet.go rename to cli/cmd/networkElementSet.go index 03d9bf5d8e8926085b724f3ff4b64d91cfbab83f..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) } @@ -85,7 +85,7 @@ To enable replacing behaviour (destructive!), set the --replace flag."`, 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 c6df2b4b7dc487ce05ab108e0ecc721fbf9ff659..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.GetMne() + 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 98% rename from cli/cmd/deviceSubscribe.go rename to cli/cmd/networkElementSubscribe.go index d4ab6cf7de1d60cf9d00b5993e7bd34aa423b4fd..e2b98b2c51ee58578f1cc239c41de8d4bee29318 100644 --- a/cli/cmd/deviceSubscribe.go +++ b/cli/cmd/networkElementSubscribe.go @@ -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 cb1d69c6dd79b4541d55096c4056ab00f6373ea8..d8bc1a817a75c5445abe60e8e8f0067e7c3234cf 100644 --- a/cli/cmd/prompt.go +++ b/cli/cmd/prompt.go @@ -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,7 +241,7 @@ 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 @@ -260,7 +260,7 @@ 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 diff --git a/controller/ARCHITECTURE.md b/controller/ARCHITECTURE.md index 162998c7ab36bb9a0f92f2bc09cf108c22270b87..6169399944780c0d92c441690b438c42b6d5ebde 100644 --- a/controller/ARCHITECTURE.md +++ b/controller/ARCHITECTURE.md @@ -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 `managedNetworkElement` -### `nucleus/device` +### `nucleus/network element` -This is the representation of an `managedNetworkElement` (MNE). An `managedNetworkElement` 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` @@ -51,4 +51,4 @@ Transport between goSDN and MNEs. Current core implementations are gNMI and REST 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 0bd449e43133d3fad4e9aec0cf8e1392143709bc..3670c8f478bc127622f61caa3dc4d67a363492e4 100644 --- a/controller/README.md +++ b/controller/README.md @@ -35,7 +35,7 @@ The PND is the single source of truth within a network. Its state is held and ma ## 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 fa88b2b6dc9d1776213855adc436cd57b7225d73..e9c98b20c036bfd611b4edc1288c03dfad5a4cee 100644 --- a/controller/api/apiIntegration_test.go +++ b/controller/api/apiIntegration_test.go @@ -60,21 +60,21 @@ func TestApiIntegration(t *testing.T) { 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 = GetNetworkElement( context.TODO(), testAPIEndpoint, cliPnd, - did, + mneid, ) if (err != nil) != tt.wantErr { t.Errorf("gosdn cli request error = %v, wantErr %v", err, tt.wantErr) @@ -85,10 +85,10 @@ func TestApiIntegration(t *testing.T) { 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, 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/networkelement/device.go b/controller/interfaces/networkelement/networkElement.go similarity index 100% rename from controller/interfaces/networkelement/device.go rename to controller/interfaces/networkelement/networkElement.go diff --git a/controller/interfaces/networkelement/deviceService.go b/controller/interfaces/networkelement/networkElementService.go similarity index 100% rename from controller/interfaces/networkelement/deviceService.go rename to controller/interfaces/networkelement/networkElementService.go diff --git a/controller/interfaces/networkelement/deviceStore.go b/controller/interfaces/networkelement/networkElementStore.go similarity index 100% rename from controller/interfaces/networkelement/deviceStore.go rename to controller/interfaces/networkelement/networkElementStore.go 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/northbound/server/device.go b/controller/northbound/server/networkElement.go similarity index 70% rename from controller/northbound/server/device.go rename to controller/northbound/server/networkElement.go index fcbf1a443265332f956f1da67a4b07a59828a894..ebbb79d746e19817d3fb613d91a74ec70783bbf0 100644 --- a/controller/northbound/server/device.go +++ b/controller/northbound/server/networkElement.go @@ -25,14 +25,14 @@ func NewNetworkElementServer(networkDomain networkdomain.NetworkDomain) *Network } } -// Add adds a new device. -func (d *NetworkElementServer) Add(ctx context.Context, request *mnepb.AddNetworkElementRequest) (*mnepb.AddNetworkElementResponse, error) { +// 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 := d.networkDomain.AddNetworkElement( + id, err := s.networkDomain.AddNetworkElement( request.NetworkElement.NetworkElementName, request.NetworkElement.TransportOption, sbiID, @@ -48,21 +48,21 @@ func (d *NetworkElementServer) Add(ctx context.Context, request *mnepb.AddNetwor }, nil } -// GetAll returns all stored devices. -func (d *NetworkElementServer) GetAll(ctx context.Context, request *mnepb.GetAllNetworkElementRequest) (*mnepb.GetAllNetworkElementResponse, error) { - devices := d.networkDomain.NetworkElements() +// 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 _, device := range devices { - ygotStructAsJSON, err := device.GetModelAsString() + 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: device.ID().String(), - Name: device.Name(), + Id: mne.ID().String(), + Name: mne.Name(), Model: ygotStructAsJSON, }) } @@ -74,43 +74,43 @@ func (d *NetworkElementServer) GetAll(ctx context.Context, request *mnepb.GetAll }, nil } -// Get returns a device. -func (d *NetworkElementServer) Get(ctx context.Context, request *mnepb.GetNetworkElementRequest) (*mnepb.GetNetworkElementResponse, error) { - device, err := d.networkDomain.GetNetworkElement(request.NetworkElementId) +// 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 := device.GetModelAsString() + ygotStructAsJSON, err := mne.GetModelAsString() if err != nil { log.Error(err) return nil, status.Errorf(codes.Aborted, "%v", err) } - mne := &mnepb.NetworkElement{ - Id: device.ID().String(), - Name: device.Name(), + networkElement := &mnepb.NetworkElement{ + Id: mne.ID().String(), + Name: mne.Name(), Model: ygotStructAsJSON, - TransportAddress: device.TransportAddress(), + TransportAddress: mne.TransportAddress(), } return &mnepb.GetNetworkElementResponse{ Timestamp: time.Now().UnixNano(), Status: mnepb.Status_STATUS_OK, - NetworkElement: mne, + NetworkElement: networkElement, }, nil } -// Update updates a device. -func (d *NetworkElementServer) Update(ctx context.Context, request *mnepb.UpdateNetworkElementRequest) (*mnepb.UpdateNetworkElementResponse, error) { - deviceID, err := uuid.Parse(request.NetworkElement.Id) +// 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 } - device, err := d.networkDomain.GetNetworkElement(deviceID.String()) + mne, err := s.networkDomain.GetNetworkElement(mneID.String()) if err != nil { return &mnepb.UpdateNetworkElementResponse{ Timestamp: time.Now().UnixNano(), @@ -118,7 +118,7 @@ func (d *NetworkElementServer) Update(ctx context.Context, request *mnepb.Update }, err } - err = d.networkDomain.UpdateNetworkElement(device, request.NetworkElement.Model) + err = s.networkDomain.UpdateNetworkElement(mne, request.NetworkElement.Model) if err != nil { return &mnepb.UpdateNetworkElementResponse{ Timestamp: time.Now().UnixNano(), diff --git a/controller/nucleus/change.go b/controller/nucleus/change.go index a01117a4696afb9734b2fa2f27f35900429b44ba..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, diff --git a/controller/nucleus/databaseDeviceStore.go b/controller/nucleus/databaseNetworkElementStore.go similarity index 89% rename from controller/nucleus/databaseDeviceStore.go rename to controller/nucleus/databaseNetworkElementStore.go index 0297e80c3daecdd615584a4eb1c15d5a5af1bb36..5a42a3730bcfa0662d216a05b66703d59ca5461b 100644 --- a/controller/nucleus/databaseDeviceStore.go +++ b/controller/nucleus/databaseNetworkElementStore.go @@ -20,7 +20,7 @@ type DatabaseNetworkElementStore struct { storeName string } -// NewDatabaseDeviceStore returns a DeviceStore. +// NewDatabaseNetworkElementStore returns a NetworkElementStore. func NewDatabaseNetworkElementStore(pndUUID uuid.UUID) networkelement.Store { return &DatabaseNetworkElementStore{ storeName: fmt.Sprintf("networkElement-store-%s.json", pndUUID.String()), @@ -48,7 +48,7 @@ func (s *DatabaseNetworkElementStore) Get(query store.Query) (networkelement.Loa return loadedNetworkElement, nil } -func (s *DatabaseNetworkElementStore) getByID(idOfDevice uuid.UUID) (loadedNetworkElement networkelement.LoadedNetworkElement, err error) { +func (s *DatabaseNetworkElementStore) getByID(idOfNetworkElement uuid.UUID) (loadedNetworkElement networkelement.LoadedNetworkElement, err error) { client, ctx, cancel := database.GetMongoConnection() defer cancel() defer func() { @@ -59,21 +59,21 @@ func (s *DatabaseNetworkElementStore) getByID(idOfDevice uuid.UUID) (loadedNetwo }() db := client.Database(database.DatabaseName) collection := db.Collection(s.storeName) - result := collection.FindOne(ctx, bson.D{primitive.E{Key: "_id", Value: idOfDevice.String()}}) + result := collection.FindOne(ctx, bson.D{primitive.E{Key: "_id", Value: idOfNetworkElement.String()}}) if result == nil { - return loadedNetworkElement, customerrs.CouldNotFindError{ID: idOfDevice} + return loadedNetworkElement, customerrs.CouldNotFindError{ID: idOfNetworkElement} } err = result.Decode(&loadedNetworkElement) if err != nil { log.Printf("Failed marshalling %v", err) - return loadedNetworkElement, customerrs.CouldNotMarshallError{Identifier: idOfDevice, Type: loadedNetworkElement, Err: err} + return loadedNetworkElement, customerrs.CouldNotMarshallError{Identifier: idOfNetworkElement, Type: loadedNetworkElement, Err: err} } return loadedNetworkElement, nil } -func (s *DatabaseNetworkElementStore) getByName(nameOfDevice string) (loadedNetworkElement networkelement.LoadedNetworkElement, err error) { +func (s *DatabaseNetworkElementStore) getByName(nameOfNetworkElement string) (loadedNetworkElement networkelement.LoadedNetworkElement, err error) { client, ctx, cancel := database.GetMongoConnection() defer cancel() defer func() { @@ -84,15 +84,15 @@ func (s *DatabaseNetworkElementStore) getByName(nameOfDevice string) (loadedNetw }() db := client.Database(database.DatabaseName) collection := db.Collection(s.storeName) - result := collection.FindOne(ctx, bson.D{primitive.E{Key: "name", Value: nameOfDevice}}) + result := collection.FindOne(ctx, bson.D{primitive.E{Key: "name", Value: nameOfNetworkElement}}) if result == nil { - return loadedNetworkElement, customerrs.CouldNotFindError{Name: nameOfDevice} + return loadedNetworkElement, customerrs.CouldNotFindError{Name: nameOfNetworkElement} } err = result.Decode(&loadedNetworkElement) if err != nil { log.Printf("Failed marshalling %v", err) - return loadedNetworkElement, customerrs.CouldNotMarshallError{Identifier: nameOfDevice, Type: loadedNetworkElement, Err: err} + return loadedNetworkElement, customerrs.CouldNotMarshallError{Identifier: nameOfNetworkElement, Type: loadedNetworkElement, Err: err} } return loadedNetworkElement, nil @@ -157,7 +157,7 @@ func (s *DatabaseNetworkElementStore) Add(networkElementToAdd networkelement.Net // Update updates a existing network element. func (s *DatabaseNetworkElementStore) Update(networkElementToUpdate networkelement.NetworkElement) (err error) { - var updatedLoadedDevice networkelement.LoadedNetworkElement + var updatedLoadedNetworkElement networkelement.LoadedNetworkElement client, ctx, cancel := database.GetMongoConnection() defer cancel() @@ -181,7 +181,7 @@ func (s *DatabaseNetworkElementStore) Update(networkElementToUpdate networkeleme Collection(s.storeName). FindOneAndUpdate( ctx, bson.M{"_id": networkElementToUpdate.ID().String()}, update, &opt). - Decode(&updatedLoadedDevice) + Decode(&updatedLoadedNetworkElement) if err != nil { log.Printf("Could not update NetworkElement: %v", err) 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/memoryDeviceStore.go b/controller/nucleus/memoryNetworkElementStore.go similarity index 100% rename from controller/nucleus/memoryDeviceStore.go rename to controller/nucleus/memoryNetworkElementStore.go diff --git a/controller/nucleus/metrics.go b/controller/nucleus/metrics.go index aa5062fab1041fe6b3b154295070dc1d2439284b..d8a4b3b04eedc4b818a8c859f295e168f65746f9 100644 --- a/controller/nucleus/metrics.go +++ b/controller/nucleus/metrics.go @@ -25,7 +25,7 @@ var ( 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"}, ) @@ -49,7 +49,7 @@ var ( 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/device.go b/controller/nucleus/networkElement.go similarity index 100% rename from controller/nucleus/device.go rename to controller/nucleus/networkElement.go diff --git a/controller/nucleus/networkElementService.go b/controller/nucleus/networkElementService.go index 2e3159020175d8dba2296171c45d09c9a97c4f3f..19e6a9b23dbde38612cd821908769affa6fead2a 100644 --- a/controller/nucleus/networkElementService.go +++ b/controller/nucleus/networkElementService.go @@ -18,7 +18,7 @@ import ( const ( // NetworkElementEventTopic is the used topic for network element related entity changes. - NetworkElementEventTopic = "managed network element" + NetworkElementEventTopic = "managedNetworkElement" ) // NetworkElementService provides a network element service implementation. diff --git a/controller/nucleus/networkElementWatcher.go b/controller/nucleus/networkElementWatcher.go index 0fd4774da83b49d031dfd7addd99ec09c7f61beb..0ac3cba6be9a96fcfa5d1a945558c6c779ffe035 100644 --- a/controller/nucleus/networkElementWatcher.go +++ b/controller/nucleus/networkElementWatcher.go @@ -36,7 +36,7 @@ type deviceSubscriptionHelper struct { stopFunc context.CancelFunc } -// NewDeviceWatcher takes a pndStore to subscribe to device paths. +// NewDeviceWatcher takes a pndStore to subscribe to network element paths. func NewDeviceWatcher(pndStore networkdomain.PndStore) *NetworkElementWatcher { return &NetworkElementWatcher{ pndStore: pndStore, @@ -44,7 +44,7 @@ func NewDeviceWatcher(pndStore networkdomain.PndStore) *NetworkElementWatcher { } } -// 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 *NetworkElementWatcher) SubToDevices(paths [][]string, opts *gnmi.SubscribeOptions) { @@ -68,7 +68,7 @@ func (d *NetworkElementWatcher) SubToDevices(paths [][]string, opts *gnmi.Subscr } func (d *NetworkElementWatcher) subscribeToPndDevices(pndID string, pnd networkdomain.NetworkDomain, opts *gnmi.SubscribeOptions) { - for _, device := range pnd.NetworkElements() { + for _, mne := range pnd.NetworkElements() { subID := uuid.New() stopContext, cancel := context.WithCancel(context.Background()) @@ -76,7 +76,7 @@ func (d *NetworkElementWatcher) subscribeToPndDevices(pndID string, pnd networkd stopSubscribeCtx: stopContext, stopFunc: cancel, }) - go d.callSubscribe(stopContext, pndID, device, opts) + go d.callSubscribe(stopContext, pndID, mne, opts) } } @@ -84,8 +84,8 @@ func (d *NetworkElementWatcher) callSubscribe(stopContext context.Context, pndID 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 + // 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: mne.ID().String(), @@ -109,14 +109,14 @@ func (d *NetworkElementWatcher) StopAndRemoveAllDeviceSubscriptions() { } // StopAndRemoveDeviceSubscription passes a subscription uuid to stop the running subscription go routing and removes the entry from the map -// of device subscriptions. +// 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. +// 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: @@ -152,16 +152,16 @@ func (d *NetworkElementWatcher) handleSubscribeResponseUpdate(resp *gpb.Subscrib log.Error(err) } - device, err := pnd.GetNetworkElement(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.UpdateNetworkElementAfterSubscribeResponse(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 82% rename from controller/nucleus/device_test.go rename to controller/nucleus/networkElement_test.go index 10edf57cbb2d3ee790d47ad118f8e5b34ff70be6..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 @@ -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, }, @@ -103,21 +103,21 @@ func TestNewDevice(t *testing.T) { t.Parallel() 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/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/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/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/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