diff --git a/api/go/gosdn/topology/topology.pb.go b/api/go/gosdn/topology/topology.pb.go index 9119f79b6fa8e77fdd44a9ce358ef434382937f8..1fd6654fca6b7af7baf4bc126bd2ecbf510c3505 100644 --- a/api/go/gosdn/topology/topology.pb.go +++ b/api/go/gosdn/topology/topology.pb.go @@ -119,7 +119,6 @@ func (x *Topology) GetLinks() []*Link { return nil } -// AddLink type AddLinkRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -230,7 +229,6 @@ func (x *AddLinkResponse) GetStatus() Status { return Status_STATUS_UNSPECIFIED } -// GetTopology type GetTopologyRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -341,6 +339,226 @@ func (x *GetTopologyResponse) GetToplogy() *Topology { return nil } +type UpdateLinkRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Link *Link `protobuf:"bytes,2,opt,name=link,proto3" json:"link,omitempty"` +} + +func (x *UpdateLinkRequest) Reset() { + *x = UpdateLinkRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_topology_topology_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateLinkRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateLinkRequest) ProtoMessage() {} + +func (x *UpdateLinkRequest) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_topology_topology_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 UpdateLinkRequest.ProtoReflect.Descriptor instead. +func (*UpdateLinkRequest) Descriptor() ([]byte, []int) { + return file_gosdn_topology_topology_proto_rawDescGZIP(), []int{5} +} + +func (x *UpdateLinkRequest) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *UpdateLinkRequest) GetLink() *Link { + if x != nil { + return x.Link + } + return nil +} + +type UpdateLinkResponse 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.topology.Status" json:"status,omitempty"` +} + +func (x *UpdateLinkResponse) Reset() { + *x = UpdateLinkResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_topology_topology_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateLinkResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateLinkResponse) ProtoMessage() {} + +func (x *UpdateLinkResponse) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_topology_topology_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 UpdateLinkResponse.ProtoReflect.Descriptor instead. +func (*UpdateLinkResponse) Descriptor() ([]byte, []int) { + return file_gosdn_topology_topology_proto_rawDescGZIP(), []int{6} +} + +func (x *UpdateLinkResponse) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *UpdateLinkResponse) GetStatus() Status { + if x != nil { + return x.Status + } + return Status_STATUS_UNSPECIFIED +} + +type DeleteLinkRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *DeleteLinkRequest) Reset() { + *x = DeleteLinkRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_topology_topology_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteLinkRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteLinkRequest) ProtoMessage() {} + +func (x *DeleteLinkRequest) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_topology_topology_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 DeleteLinkRequest.ProtoReflect.Descriptor instead. +func (*DeleteLinkRequest) Descriptor() ([]byte, []int) { + return file_gosdn_topology_topology_proto_rawDescGZIP(), []int{7} +} + +func (x *DeleteLinkRequest) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *DeleteLinkRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type DeleteLinkResponse 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.topology.Status" json:"status,omitempty"` +} + +func (x *DeleteLinkResponse) Reset() { + *x = DeleteLinkResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gosdn_topology_topology_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteLinkResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteLinkResponse) ProtoMessage() {} + +func (x *DeleteLinkResponse) ProtoReflect() protoreflect.Message { + mi := &file_gosdn_topology_topology_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 DeleteLinkResponse.ProtoReflect.Descriptor instead. +func (*DeleteLinkResponse) Descriptor() ([]byte, []int) { + return file_gosdn_topology_topology_proto_rawDescGZIP(), []int{8} +} + +func (x *DeleteLinkResponse) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +func (x *DeleteLinkResponse) GetStatus() Status { + if x != nil { + return x.Status + } + return Status_STATUS_UNSPECIFIED +} + var File_gosdn_topology_topology_proto protoreflect.FileDescriptor var file_gosdn_topology_topology_proto_rawDesc = []byte{ @@ -383,30 +601,66 @@ var file_gosdn_topology_topology_proto_rawDesc = []byte{ 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x32, 0x0a, 0x07, 0x74, 0x6f, 0x70, 0x6c, 0x6f, 0x67, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x74, 0x6f, 0x70, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x2e, 0x54, 0x6f, 0x70, 0x6f, 0x6c, 0x6f, - 0x67, 0x79, 0x52, 0x07, 0x74, 0x6f, 0x70, 0x6c, 0x6f, 0x67, 0x79, 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, 0xe5, - 0x01, 0x0a, 0x0f, 0x54, 0x6f, 0x70, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x12, 0x67, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x1e, 0x2e, - 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x74, 0x6f, 0x70, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x2e, 0x41, - 0x64, 0x64, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, - 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x74, 0x6f, 0x70, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x2e, 0x41, - 0x64, 0x64, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x3a, 0x01, 0x2a, 0x22, 0x10, 0x2f, 0x74, 0x6f, 0x70, 0x6f, - 0x6c, 0x6f, 0x67, 0x79, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x69, 0x0a, 0x0b, 0x47, - 0x65, 0x74, 0x54, 0x6f, 0x70, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x12, 0x22, 0x2e, 0x67, 0x6f, 0x73, - 0x64, 0x6e, 0x2e, 0x74, 0x6f, 0x70, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x54, - 0x6f, 0x70, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, + 0x67, 0x79, 0x52, 0x07, 0x74, 0x6f, 0x70, 0x6c, 0x6f, 0x67, 0x79, 0x22, 0x5b, 0x0a, 0x11, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 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, 0x28, + 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, + 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x74, 0x6f, 0x70, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x2e, 0x4c, 0x69, + 0x6e, 0x6b, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x22, 0x62, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 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, 0x2e, 0x0a, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x67, + 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x74, 0x6f, 0x70, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x2e, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x41, 0x0a, 0x11, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 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, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, + 0x62, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 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, 0x2e, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x74, 0x6f, 0x70, 0x6f, + 0x6c, 0x6f, 0x67, 0x79, 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, 0xc6, 0x03, 0x0a, 0x0f, 0x54, 0x6f, 0x70, 0x6f, 0x6c, + 0x6f, 0x67, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x67, 0x0a, 0x07, 0x41, 0x64, + 0x64, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x74, 0x6f, + 0x70, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x74, 0x6f, + 0x70, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x3a, 0x01, + 0x2a, 0x22, 0x10, 0x2f, 0x74, 0x6f, 0x70, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x2f, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x12, 0x69, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x70, 0x6f, 0x6c, 0x6f, + 0x67, 0x79, 0x12, 0x22, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x74, 0x6f, 0x70, 0x6f, 0x6c, + 0x6f, 0x67, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x70, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x74, + 0x6f, 0x70, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x70, 0x6f, 0x6c, + 0x6f, 0x67, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x11, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x0b, 0x12, 0x09, 0x2f, 0x74, 0x6f, 0x70, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x12, 0x70, + 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x21, 0x2e, 0x67, + 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x74, 0x6f, 0x70, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x22, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x74, 0x6f, 0x70, 0x6f, 0x6c, 0x6f, 0x67, 0x79, + 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x3a, 0x01, 0x2a, 0x22, 0x10, + 0x2f, 0x74, 0x6f, 0x70, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x12, 0x6d, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x21, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x74, 0x6f, 0x70, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x2e, - 0x47, 0x65, 0x74, 0x54, 0x6f, 0x70, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x11, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x12, 0x09, 0x2f, 0x74, 0x6f, - 0x70, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x42, 0x34, 0x5a, 0x32, 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, 0x74, 0x6f, 0x70, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x22, 0x2e, 0x67, 0x6f, 0x73, 0x64, 0x6e, 0x2e, 0x74, 0x6f, 0x70, 0x6f, 0x6c, 0x6f, + 0x67, 0x79, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x2a, 0x10, 0x2f, + 0x74, 0x6f, 0x70, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, + 0x34, 0x5a, 0x32, 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, 0x74, 0x6f, 0x70, + 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -422,7 +676,7 @@ func file_gosdn_topology_topology_proto_rawDescGZIP() []byte { } var file_gosdn_topology_topology_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_gosdn_topology_topology_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_gosdn_topology_topology_proto_msgTypes = make([]protoimpl.MessageInfo, 9) var file_gosdn_topology_topology_proto_goTypes = []interface{}{ (Status)(0), // 0: gosdn.topology.Status (*Topology)(nil), // 1: gosdn.topology.Topology @@ -430,23 +684,34 @@ var file_gosdn_topology_topology_proto_goTypes = []interface{}{ (*AddLinkResponse)(nil), // 3: gosdn.topology.AddLinkResponse (*GetTopologyRequest)(nil), // 4: gosdn.topology.GetTopologyRequest (*GetTopologyResponse)(nil), // 5: gosdn.topology.GetTopologyResponse - (*Link)(nil), // 6: gosdn.topology.Link + (*UpdateLinkRequest)(nil), // 6: gosdn.topology.UpdateLinkRequest + (*UpdateLinkResponse)(nil), // 7: gosdn.topology.UpdateLinkResponse + (*DeleteLinkRequest)(nil), // 8: gosdn.topology.DeleteLinkRequest + (*DeleteLinkResponse)(nil), // 9: gosdn.topology.DeleteLinkResponse + (*Link)(nil), // 10: gosdn.topology.Link } var file_gosdn_topology_topology_proto_depIdxs = []int32{ - 6, // 0: gosdn.topology.Topology.links:type_name -> gosdn.topology.Link - 6, // 1: gosdn.topology.AddLinkRequest.link:type_name -> gosdn.topology.Link - 0, // 2: gosdn.topology.AddLinkResponse.status:type_name -> gosdn.topology.Status - 0, // 3: gosdn.topology.GetTopologyResponse.status:type_name -> gosdn.topology.Status - 1, // 4: gosdn.topology.GetTopologyResponse.toplogy:type_name -> gosdn.topology.Topology - 2, // 5: gosdn.topology.TopologyService.AddLink:input_type -> gosdn.topology.AddLinkRequest - 4, // 6: gosdn.topology.TopologyService.GetTopology:input_type -> gosdn.topology.GetTopologyRequest - 3, // 7: gosdn.topology.TopologyService.AddLink:output_type -> gosdn.topology.AddLinkResponse - 5, // 8: gosdn.topology.TopologyService.GetTopology:output_type -> gosdn.topology.GetTopologyResponse - 7, // [7:9] is the sub-list for method output_type - 5, // [5:7] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 10, // 0: gosdn.topology.Topology.links:type_name -> gosdn.topology.Link + 10, // 1: gosdn.topology.AddLinkRequest.link:type_name -> gosdn.topology.Link + 0, // 2: gosdn.topology.AddLinkResponse.status:type_name -> gosdn.topology.Status + 0, // 3: gosdn.topology.GetTopologyResponse.status:type_name -> gosdn.topology.Status + 1, // 4: gosdn.topology.GetTopologyResponse.toplogy:type_name -> gosdn.topology.Topology + 10, // 5: gosdn.topology.UpdateLinkRequest.link:type_name -> gosdn.topology.Link + 0, // 6: gosdn.topology.UpdateLinkResponse.status:type_name -> gosdn.topology.Status + 0, // 7: gosdn.topology.DeleteLinkResponse.status:type_name -> gosdn.topology.Status + 2, // 8: gosdn.topology.TopologyService.AddLink:input_type -> gosdn.topology.AddLinkRequest + 4, // 9: gosdn.topology.TopologyService.GetTopology:input_type -> gosdn.topology.GetTopologyRequest + 6, // 10: gosdn.topology.TopologyService.UpdateLink:input_type -> gosdn.topology.UpdateLinkRequest + 8, // 11: gosdn.topology.TopologyService.DeleteLink:input_type -> gosdn.topology.DeleteLinkRequest + 3, // 12: gosdn.topology.TopologyService.AddLink:output_type -> gosdn.topology.AddLinkResponse + 5, // 13: gosdn.topology.TopologyService.GetTopology:output_type -> gosdn.topology.GetTopologyResponse + 7, // 14: gosdn.topology.TopologyService.UpdateLink:output_type -> gosdn.topology.UpdateLinkResponse + 9, // 15: gosdn.topology.TopologyService.DeleteLink:output_type -> gosdn.topology.DeleteLinkResponse + 12, // [12:16] is the sub-list for method output_type + 8, // [8:12] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name } func init() { file_gosdn_topology_topology_proto_init() } @@ -516,6 +781,54 @@ func file_gosdn_topology_topology_proto_init() { return nil } } + file_gosdn_topology_topology_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateLinkRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_topology_topology_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateLinkResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_topology_topology_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteLinkRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gosdn_topology_topology_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteLinkResponse); 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{ @@ -523,7 +836,7 @@ func file_gosdn_topology_topology_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_gosdn_topology_topology_proto_rawDesc, NumEnums: 1, - NumMessages: 5, + NumMessages: 9, NumExtensions: 0, NumServices: 1, }, diff --git a/api/go/gosdn/topology/topology.pb.gw.go b/api/go/gosdn/topology/topology.pb.gw.go index 0bd7ba238d02ab3d564dd579a3fc89a28623642d..44945a07e842b8144a5f2d64ec0b719c7853d816 100644 --- a/api/go/gosdn/topology/topology.pb.gw.go +++ b/api/go/gosdn/topology/topology.pb.gw.go @@ -101,6 +101,76 @@ func local_request_TopologyService_GetTopology_0(ctx context.Context, marshaler } +func request_TopologyService_UpdateLink_0(ctx context.Context, marshaler runtime.Marshaler, client TopologyServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateLinkRequest + 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.UpdateLink(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_TopologyService_UpdateLink_0(ctx context.Context, marshaler runtime.Marshaler, server TopologyServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateLinkRequest + 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.UpdateLink(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_TopologyService_DeleteLink_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_TopologyService_DeleteLink_0(ctx context.Context, marshaler runtime.Marshaler, client TopologyServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteLinkRequest + 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_TopologyService_DeleteLink_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DeleteLink(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_TopologyService_DeleteLink_0(ctx context.Context, marshaler runtime.Marshaler, server TopologyServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteLinkRequest + 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_TopologyService_DeleteLink_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DeleteLink(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterTopologyServiceHandlerServer registers the http handlers for service TopologyService to "mux". // UnaryRPC :call TopologyServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -153,6 +223,52 @@ func RegisterTopologyServiceHandlerServer(ctx context.Context, mux *runtime.Serv }) + mux.Handle("POST", pattern_TopologyService_UpdateLink_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.topology.TopologyService/UpdateLink", runtime.WithHTTPPathPattern("/topology/update")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_TopologyService_UpdateLink_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_TopologyService_UpdateLink_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_TopologyService_DeleteLink_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.topology.TopologyService/DeleteLink", runtime.WithHTTPPathPattern("/topology/delete")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_TopologyService_DeleteLink_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_TopologyService_DeleteLink_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -234,6 +350,46 @@ func RegisterTopologyServiceHandlerClient(ctx context.Context, mux *runtime.Serv }) + mux.Handle("POST", pattern_TopologyService_UpdateLink_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.topology.TopologyService/UpdateLink", runtime.WithHTTPPathPattern("/topology/update")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_TopologyService_UpdateLink_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_TopologyService_UpdateLink_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_TopologyService_DeleteLink_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.topology.TopologyService/DeleteLink", runtime.WithHTTPPathPattern("/topology/delete")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_TopologyService_DeleteLink_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_TopologyService_DeleteLink_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -241,10 +397,18 @@ var ( pattern_TopologyService_AddLink_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"topology", "create"}, "")) pattern_TopologyService_GetTopology_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"topology"}, "")) + + pattern_TopologyService_UpdateLink_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"topology", "update"}, "")) + + pattern_TopologyService_DeleteLink_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"topology", "delete"}, "")) ) var ( forward_TopologyService_AddLink_0 = runtime.ForwardResponseMessage forward_TopologyService_GetTopology_0 = runtime.ForwardResponseMessage + + forward_TopologyService_UpdateLink_0 = runtime.ForwardResponseMessage + + forward_TopologyService_DeleteLink_0 = runtime.ForwardResponseMessage ) diff --git a/api/go/gosdn/topology/topology_grpc.pb.go b/api/go/gosdn/topology/topology_grpc.pb.go index 646a8ebf30a472792a1af1e4267fbf8b65fdd054..804c1c406231536e5918c899b23b5a9065d06068 100644 --- a/api/go/gosdn/topology/topology_grpc.pb.go +++ b/api/go/gosdn/topology/topology_grpc.pb.go @@ -18,12 +18,10 @@ const _ = grpc.SupportPackageIsVersion7 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type TopologyServiceClient interface { - // Creates roles, requires login beforehand. - // Requires highest permissions. AddLink(ctx context.Context, in *AddLinkRequest, opts ...grpc.CallOption) (*AddLinkResponse, error) - // Requests all roles with their permissions, requires login beforehand. - // Requires highest permissions. GetTopology(ctx context.Context, in *GetTopologyRequest, opts ...grpc.CallOption) (*GetTopologyResponse, error) + UpdateLink(ctx context.Context, in *UpdateLinkRequest, opts ...grpc.CallOption) (*UpdateLinkResponse, error) + DeleteLink(ctx context.Context, in *DeleteLinkRequest, opts ...grpc.CallOption) (*DeleteLinkResponse, error) } type topologyServiceClient struct { @@ -52,16 +50,32 @@ func (c *topologyServiceClient) GetTopology(ctx context.Context, in *GetTopology return out, nil } +func (c *topologyServiceClient) UpdateLink(ctx context.Context, in *UpdateLinkRequest, opts ...grpc.CallOption) (*UpdateLinkResponse, error) { + out := new(UpdateLinkResponse) + err := c.cc.Invoke(ctx, "/gosdn.topology.TopologyService/UpdateLink", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *topologyServiceClient) DeleteLink(ctx context.Context, in *DeleteLinkRequest, opts ...grpc.CallOption) (*DeleteLinkResponse, error) { + out := new(DeleteLinkResponse) + err := c.cc.Invoke(ctx, "/gosdn.topology.TopologyService/DeleteLink", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // TopologyServiceServer is the server API for TopologyService service. // All implementations must embed UnimplementedTopologyServiceServer // for forward compatibility type TopologyServiceServer interface { - // Creates roles, requires login beforehand. - // Requires highest permissions. AddLink(context.Context, *AddLinkRequest) (*AddLinkResponse, error) - // Requests all roles with their permissions, requires login beforehand. - // Requires highest permissions. GetTopology(context.Context, *GetTopologyRequest) (*GetTopologyResponse, error) + UpdateLink(context.Context, *UpdateLinkRequest) (*UpdateLinkResponse, error) + DeleteLink(context.Context, *DeleteLinkRequest) (*DeleteLinkResponse, error) mustEmbedUnimplementedTopologyServiceServer() } @@ -75,6 +89,12 @@ func (UnimplementedTopologyServiceServer) AddLink(context.Context, *AddLinkReque func (UnimplementedTopologyServiceServer) GetTopology(context.Context, *GetTopologyRequest) (*GetTopologyResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetTopology not implemented") } +func (UnimplementedTopologyServiceServer) UpdateLink(context.Context, *UpdateLinkRequest) (*UpdateLinkResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateLink not implemented") +} +func (UnimplementedTopologyServiceServer) DeleteLink(context.Context, *DeleteLinkRequest) (*DeleteLinkResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteLink not implemented") +} func (UnimplementedTopologyServiceServer) mustEmbedUnimplementedTopologyServiceServer() {} // UnsafeTopologyServiceServer may be embedded to opt out of forward compatibility for this service. @@ -124,6 +144,42 @@ func _TopologyService_GetTopology_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _TopologyService_UpdateLink_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateLinkRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TopologyServiceServer).UpdateLink(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gosdn.topology.TopologyService/UpdateLink", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TopologyServiceServer).UpdateLink(ctx, req.(*UpdateLinkRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _TopologyService_DeleteLink_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteLinkRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TopologyServiceServer).DeleteLink(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gosdn.topology.TopologyService/DeleteLink", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TopologyServiceServer).DeleteLink(ctx, req.(*DeleteLinkRequest)) + } + return interceptor(ctx, in, info, handler) +} + // TopologyService_ServiceDesc is the grpc.ServiceDesc for TopologyService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -139,6 +195,14 @@ var TopologyService_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetTopology", Handler: _TopologyService_GetTopology_Handler, }, + { + MethodName: "UpdateLink", + Handler: _TopologyService_UpdateLink_Handler, + }, + { + MethodName: "DeleteLink", + Handler: _TopologyService_DeleteLink_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "gosdn/topology/topology.proto", diff --git a/api/openapiv2/gosdn_northbound.swagger.json b/api/openapiv2/gosdn_northbound.swagger.json index 4699ec6d2ae28af477e34ddd32223b7678b7405f..70ae5297cb3f380a9051c87b1a286993be569818 100644 --- a/api/openapiv2/gosdn_northbound.swagger.json +++ b/api/openapiv2/gosdn_northbound.swagger.json @@ -1042,7 +1042,6 @@ }, "/topology": { "get": { - "summary": "Requests all roles with their permissions, requires login beforehand.\nRequires highest permissions.", "operationId": "TopologyService_GetTopology", "responses": { "200": { @@ -1074,7 +1073,6 @@ }, "/topology/create": { "post": { - "summary": "Creates roles, requires login beforehand.\nRequires highest permissions.", "operationId": "TopologyService_AddLink", "responses": { "200": { @@ -1105,6 +1103,75 @@ ] } }, + "/topology/delete": { + "delete": { + "operationId": "TopologyService_DeleteLink", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/topologyDeleteLinkResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + }, + "parameters": [ + { + "name": "timestamp", + "in": "query", + "required": false, + "type": "string", + "format": "int64" + }, + { + "name": "id", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "TopologyService" + ] + } + }, + "/topology/update": { + "post": { + "operationId": "TopologyService_UpdateLink", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/topologyUpdateLinkResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/googlerpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/topologyUpdateLinkRequest" + } + } + ], + "tags": [ + "TopologyService" + ] + } + }, "/users": { "get": { "summary": "Requests information about available users, requires login beforehand.\nRequires highest possible permissions.", @@ -3281,8 +3348,7 @@ "link": { "$ref": "#/definitions/topologyLink" } - }, - "title": "AddLink" + } }, "topologyAddLinkResponse": { "type": "object", @@ -3296,6 +3362,18 @@ } } }, + "topologyDeleteLinkResponse": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "int64" + }, + "status": { + "$ref": "#/definitions/gosdntopologyStatus" + } + } + }, "topologyGetTopologyResponse": { "type": "object", "properties": { @@ -3364,6 +3442,30 @@ } } }, + "topologyUpdateLinkRequest": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "int64" + }, + "link": { + "$ref": "#/definitions/topologyLink" + } + } + }, + "topologyUpdateLinkResponse": { + "type": "object", + "properties": { + "timestamp": { + "type": "string", + "format": "int64" + }, + "status": { + "$ref": "#/definitions/gosdntopologyStatus" + } + } + }, "transportGnmiTransportOption": { "type": "object", "properties": { diff --git a/api/proto/buf.lock b/api/proto/buf.lock index 5075172a4997e3b8a056da53b859e06e8fdd9ad1..59d0351e5defc566d6ab6c72b98bcff7ca981af1 100644 --- a/api/proto/buf.lock +++ b/api/proto/buf.lock @@ -4,7 +4,7 @@ deps: - remote: buf.build owner: googleapis repository: googleapis - commit: 868034942d3c4d24b722f6a834dd7bb2 + commit: 18d0a6e7027c4a75811cd43a894346fe - remote: buf.build owner: grpc-ecosystem repository: grpc-gateway diff --git a/api/proto/gosdn/topology/topology.proto b/api/proto/gosdn/topology/topology.proto index d4a71d696d68bca0f5190152043e0afae64bea93..649744f6c58c93bdd82ea5040938ca1688806a0f 100644 --- a/api/proto/gosdn/topology/topology.proto +++ b/api/proto/gosdn/topology/topology.proto @@ -12,8 +12,6 @@ import "gosdn/topology/link.proto"; option go_package = "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/topology"; service TopologyService { - // Creates roles, requires login beforehand. - // Requires highest permissions. rpc AddLink(AddLinkRequest) returns (AddLinkResponse) { option (google.api.http) = { post: "/topology/create" @@ -21,38 +19,24 @@ service TopologyService { }; } - // Requests one role with its permissions, requires login beforehand. - // Requires highest permissions. - // rpc GetRole(GetRoleRequest) returns (GetRoleResponse) { - // option (google.api.http) = { - // get: "/roles/get" - // }; - // } - - // Requests all roles with their permissions, requires login beforehand. - // Requires highest permissions. rpc GetTopology(GetTopologyRequest) returns (GetTopologyResponse) { option (google.api.http) = { get: "/topology" }; } - // // Updates roles by setting the provided permissions, requires login beforehand. - // // Requires highest permissions. - // rpc UpdateLink(UpdateRolesRequest) returns (UpdateRolesResponse) { - // option (google.api.http) = { - // post: "/topology/update" - // body: "*" - // }; - // } - - // // Deletes roles with their permissions, requires login beforehand. - // // Requires highest permissions. - // rpc DeleteLink(DeleteRolesRequest) returns (DeleteRolesResponse) { - // option (google.api.http) = { - // delete: "/topology/delete" - // }; - // } + rpc UpdateLink(UpdateLinkRequest) returns (UpdateLinkResponse) { + option (google.api.http) = { + post: "/topology/update" + body: "*" + }; + } + + rpc DeleteLink(DeleteLinkRequest) returns (DeleteLinkResponse) { + option (google.api.http) = { + delete: "/topology/delete" + }; + } } enum Status { @@ -65,7 +49,6 @@ message Topology { repeated Link links = 1; } -// AddLink message AddLinkRequest { int64 timestamp = 1; Link link = 2; @@ -76,19 +59,6 @@ message AddLinkResponse { Status status = 2; } -// // GetRole -// message GetRoleRequest { -// int64 timestamp = 1; -// string role_name = 2; -// } - -// message GetRoleResponse { -// int64 timestamp = 1; -// Status status = 2; -// Role role = 3; -// } - -// GetTopology message GetTopologyRequest { int64 timestamp = 1; } @@ -99,36 +69,23 @@ message GetTopologyResponse { Topology toplogy = 3; } -// // UpdateRoles -// message UpdateRolesRequest { -// int64 timestamp = 1; -// repeated Role roles = 2; -// } - -// message UpdateRolesResponse { -// int64 timestamp = 1; -// Status status = 2; -// } - -// // DeletePermissionsForRole -// message DeletePermissionsForRoleRequest { -// int64 timestamp = 1; -// string role_name = 2; -// repeated string permissions_to_delete = 3; -// } - -// message DeletePermissionsForRoleResponse { -// int64 timestamp = 1; -// Status status = 2; -// } - -// // DeleteRoles -// message DeleteRolesRequest { -// int64 timestamp = 1; -// repeated string role_name = 2; -// } - -// message DeleteRolesResponse { -// int64 timestamp = 1; -// Status status = 2; -// } +message UpdateLinkRequest { + int64 timestamp = 1; + Link link = 2; +} + +message UpdateLinkResponse { + int64 timestamp = 1; + Status status = 2; +} + +message DeleteLinkRequest { + int64 timestamp = 1; + string id = 2; +} + +message DeleteLinkResponse { + int64 timestamp = 1; + Status status = 2; +} +