From 3aa4b9c578f57469828f558e6e76ff516b3b087b Mon Sep 17 00:00:00 2001 From: Kevin Date: Tue, 28 May 2024 18:12:51 +0000 Subject: [PATCH 1/3] PB Operations --- Makefile | 3 + cns/grpc/cnsv1alpha/server.pb.go | 409 ++++++++++++++++++++++++++ cns/grpc/cnsv1alpha/server_grpc.pb.go | 152 ++++++++++ cns/grpc/proto/server.proto | 43 +++ 4 files changed, 607 insertions(+) create mode 100644 cns/grpc/cnsv1alpha/server.pb.go create mode 100644 cns/grpc/cnsv1alpha/server_grpc.pb.go create mode 100644 cns/grpc/proto/server.proto diff --git a/Makefile b/Makefile index 90a723d753..0ee7c64b5e 100644 --- a/Makefile +++ b/Makefile @@ -903,3 +903,6 @@ tools: acncli gocov gocov-xml go-junit-report golangci-lint gofumpt protoc ## Bu help: ## Display this help @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[0-9a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) + +proto-gen: ## Generates source code from protobuf files + protoc --go_out=. --go-grpc_out=. cns/grpc/proto/server.proto diff --git a/cns/grpc/cnsv1alpha/server.pb.go b/cns/grpc/cnsv1alpha/server.pb.go new file mode 100644 index 0000000000..647b1730b5 --- /dev/null +++ b/cns/grpc/cnsv1alpha/server.pb.go @@ -0,0 +1,409 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.1 +// protoc v3.12.4 +// source: cns/grpc/proto/server.proto + +package cnsv1alpha + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + 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) +) + +// SetOrchestratorInfoRequest is the request message for setting the orchestrator information. +type SetOrchestratorInfoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DncPartitionKey string `protobuf:"bytes,1,opt,name=dncPartitionKey,proto3" json:"dncPartitionKey,omitempty"` // The partition key for DNC. + NodeID string `protobuf:"bytes,2,opt,name=nodeID,proto3" json:"nodeID,omitempty"` // The node ID. + OrchestratorType string `protobuf:"bytes,3,opt,name=orchestratorType,proto3" json:"orchestratorType,omitempty"` // The type of the orchestrator. +} + +func (x *SetOrchestratorInfoRequest) Reset() { + *x = SetOrchestratorInfoRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cns_grpc_proto_server_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetOrchestratorInfoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetOrchestratorInfoRequest) ProtoMessage() {} + +func (x *SetOrchestratorInfoRequest) ProtoReflect() protoreflect.Message { + mi := &file_cns_grpc_proto_server_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 SetOrchestratorInfoRequest.ProtoReflect.Descriptor instead. +func (*SetOrchestratorInfoRequest) Descriptor() ([]byte, []int) { + return file_cns_grpc_proto_server_proto_rawDescGZIP(), []int{0} +} + +func (x *SetOrchestratorInfoRequest) GetDncPartitionKey() string { + if x != nil { + return x.DncPartitionKey + } + return "" +} + +func (x *SetOrchestratorInfoRequest) GetNodeID() string { + if x != nil { + return x.NodeID + } + return "" +} + +func (x *SetOrchestratorInfoRequest) GetOrchestratorType() string { + if x != nil { + return x.OrchestratorType + } + return "" +} + +// SetOrchestratorInfoResponse is the response message for setting the orchestrator information. +type SetOrchestratorInfoResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SetOrchestratorInfoResponse) Reset() { + *x = SetOrchestratorInfoResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cns_grpc_proto_server_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetOrchestratorInfoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetOrchestratorInfoResponse) ProtoMessage() {} + +func (x *SetOrchestratorInfoResponse) ProtoReflect() protoreflect.Message { + mi := &file_cns_grpc_proto_server_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 SetOrchestratorInfoResponse.ProtoReflect.Descriptor instead. +func (*SetOrchestratorInfoResponse) Descriptor() ([]byte, []int) { + return file_cns_grpc_proto_server_proto_rawDescGZIP(), []int{1} +} + +// NodeInfoRequest is the request message for retrieving detailed information about a specific node. +type NodeInfoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeID string `protobuf:"bytes,1,opt,name=nodeID,proto3" json:"nodeID,omitempty"` // The node ID to identify the specific node. +} + +func (x *NodeInfoRequest) Reset() { + *x = NodeInfoRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cns_grpc_proto_server_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NodeInfoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NodeInfoRequest) ProtoMessage() {} + +func (x *NodeInfoRequest) ProtoReflect() protoreflect.Message { + mi := &file_cns_grpc_proto_server_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 NodeInfoRequest.ProtoReflect.Descriptor instead. +func (*NodeInfoRequest) Descriptor() ([]byte, []int) { + return file_cns_grpc_proto_server_proto_rawDescGZIP(), []int{2} +} + +func (x *NodeInfoRequest) GetNodeID() string { + if x != nil { + return x.NodeID + } + return "" +} + +// NodeInfoResponse is the response message containing detailed information about a specific node. +type NodeInfoResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeID string `protobuf:"bytes,1,opt,name=nodeID,proto3" json:"nodeID,omitempty"` // The node ID. + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // The name of the node. + Ip string `protobuf:"bytes,3,opt,name=ip,proto3" json:"ip,omitempty"` // The IP address of the node. + IsHealthy bool `protobuf:"varint,4,opt,name=isHealthy,proto3" json:"isHealthy,omitempty"` // Indicates whether the node is healthy or not. + Status string `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"` // The current status of the node (e.g., running, stopped). + Message string `protobuf:"bytes,6,opt,name=message,proto3" json:"message,omitempty"` // Additional information about the node's health or status. +} + +func (x *NodeInfoResponse) Reset() { + *x = NodeInfoResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cns_grpc_proto_server_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NodeInfoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NodeInfoResponse) ProtoMessage() {} + +func (x *NodeInfoResponse) ProtoReflect() protoreflect.Message { + mi := &file_cns_grpc_proto_server_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 NodeInfoResponse.ProtoReflect.Descriptor instead. +func (*NodeInfoResponse) Descriptor() ([]byte, []int) { + return file_cns_grpc_proto_server_proto_rawDescGZIP(), []int{3} +} + +func (x *NodeInfoResponse) GetNodeID() string { + if x != nil { + return x.NodeID + } + return "" +} + +func (x *NodeInfoResponse) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *NodeInfoResponse) GetIp() string { + if x != nil { + return x.Ip + } + return "" +} + +func (x *NodeInfoResponse) GetIsHealthy() bool { + if x != nil { + return x.IsHealthy + } + return false +} + +func (x *NodeInfoResponse) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *NodeInfoResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +var File_cns_grpc_proto_server_proto protoreflect.FileDescriptor + +var file_cns_grpc_proto_server_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x63, 0x6e, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03, 0x63, + 0x6e, 0x73, 0x22, 0x8a, 0x01, 0x0a, 0x1a, 0x53, 0x65, 0x74, 0x4f, 0x72, 0x63, 0x68, 0x65, 0x73, + 0x74, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x28, 0x0a, 0x0f, 0x64, 0x6e, 0x63, 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x4b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x64, 0x6e, 0x63, 0x50, + 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x6e, + 0x6f, 0x64, 0x65, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6e, 0x6f, 0x64, + 0x65, 0x49, 0x44, 0x12, 0x2a, 0x0a, 0x10, 0x6f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, + 0x74, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6f, + 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x22, + 0x1d, 0x0a, 0x1b, 0x53, 0x65, 0x74, 0x4f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, + 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, + 0x0a, 0x0f, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x44, 0x22, 0x9e, 0x01, 0x0a, 0x10, 0x4e, 0x6f, + 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x73, + 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, + 0x73, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x32, 0xa2, 0x01, 0x0a, 0x0a, 0x43, + 0x4e, 0x53, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x58, 0x0a, 0x13, 0x53, 0x65, 0x74, + 0x4f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x1f, 0x2e, 0x63, 0x6e, 0x73, 0x2e, 0x53, 0x65, 0x74, 0x4f, 0x72, 0x63, 0x68, 0x65, 0x73, + 0x74, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x20, 0x2e, 0x63, 0x6e, 0x73, 0x2e, 0x53, 0x65, 0x74, 0x4f, 0x72, 0x63, 0x68, 0x65, + 0x73, 0x74, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x14, 0x2e, 0x63, 0x6e, 0x73, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x63, 0x6e, 0x73, 0x2e, 0x4e, + 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, + 0x15, 0x5a, 0x13, 0x63, 0x6e, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x6e, 0x73, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cns_grpc_proto_server_proto_rawDescOnce sync.Once + file_cns_grpc_proto_server_proto_rawDescData = file_cns_grpc_proto_server_proto_rawDesc +) + +func file_cns_grpc_proto_server_proto_rawDescGZIP() []byte { + file_cns_grpc_proto_server_proto_rawDescOnce.Do(func() { + file_cns_grpc_proto_server_proto_rawDescData = protoimpl.X.CompressGZIP(file_cns_grpc_proto_server_proto_rawDescData) + }) + return file_cns_grpc_proto_server_proto_rawDescData +} + +var file_cns_grpc_proto_server_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_cns_grpc_proto_server_proto_goTypes = []interface{}{ + (*SetOrchestratorInfoRequest)(nil), // 0: cns.SetOrchestratorInfoRequest + (*SetOrchestratorInfoResponse)(nil), // 1: cns.SetOrchestratorInfoResponse + (*NodeInfoRequest)(nil), // 2: cns.NodeInfoRequest + (*NodeInfoResponse)(nil), // 3: cns.NodeInfoResponse +} +var file_cns_grpc_proto_server_proto_depIdxs = []int32{ + 0, // 0: cns.CNSService.SetOrchestratorInfo:input_type -> cns.SetOrchestratorInfoRequest + 2, // 1: cns.CNSService.GetNodeInfo:input_type -> cns.NodeInfoRequest + 1, // 2: cns.CNSService.SetOrchestratorInfo:output_type -> cns.SetOrchestratorInfoResponse + 3, // 3: cns.CNSService.GetNodeInfo:output_type -> cns.NodeInfoResponse + 2, // [2:4] is the sub-list for method output_type + 0, // [0:2] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_cns_grpc_proto_server_proto_init() } +func file_cns_grpc_proto_server_proto_init() { + if File_cns_grpc_proto_server_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cns_grpc_proto_server_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetOrchestratorInfoRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cns_grpc_proto_server_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetOrchestratorInfoResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cns_grpc_proto_server_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NodeInfoRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cns_grpc_proto_server_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NodeInfoResponse); 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_cns_grpc_proto_server_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_cns_grpc_proto_server_proto_goTypes, + DependencyIndexes: file_cns_grpc_proto_server_proto_depIdxs, + MessageInfos: file_cns_grpc_proto_server_proto_msgTypes, + }.Build() + File_cns_grpc_proto_server_proto = out.File + file_cns_grpc_proto_server_proto_rawDesc = nil + file_cns_grpc_proto_server_proto_goTypes = nil + file_cns_grpc_proto_server_proto_depIdxs = nil +} diff --git a/cns/grpc/cnsv1alpha/server_grpc.pb.go b/cns/grpc/cnsv1alpha/server_grpc.pb.go new file mode 100644 index 0000000000..7afef2ce0f --- /dev/null +++ b/cns/grpc/cnsv1alpha/server_grpc.pb.go @@ -0,0 +1,152 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v3.12.4 +// source: cns/grpc/proto/server.proto + +package cnsv1alpha + +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 + +const ( + CNSService_SetOrchestratorInfo_FullMethodName = "/cns.CNSService/SetOrchestratorInfo" + CNSService_GetNodeInfo_FullMethodName = "/cns.CNSService/GetNodeInfo" +) + +// CNSServiceClient is the client API for CNSService 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 CNSServiceClient interface { + // Sets the orchestrator information for a node. + SetOrchestratorInfo(ctx context.Context, in *SetOrchestratorInfoRequest, opts ...grpc.CallOption) (*SetOrchestratorInfoResponse, error) + // Retrieves detailed information about a specific node. + // Primarily used for health checks. + GetNodeInfo(ctx context.Context, in *NodeInfoRequest, opts ...grpc.CallOption) (*NodeInfoResponse, error) +} + +type cNSServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewCNSServiceClient(cc grpc.ClientConnInterface) CNSServiceClient { + return &cNSServiceClient{cc} +} + +func (c *cNSServiceClient) SetOrchestratorInfo(ctx context.Context, in *SetOrchestratorInfoRequest, opts ...grpc.CallOption) (*SetOrchestratorInfoResponse, error) { + out := new(SetOrchestratorInfoResponse) + err := c.cc.Invoke(ctx, CNSService_SetOrchestratorInfo_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *cNSServiceClient) GetNodeInfo(ctx context.Context, in *NodeInfoRequest, opts ...grpc.CallOption) (*NodeInfoResponse, error) { + out := new(NodeInfoResponse) + err := c.cc.Invoke(ctx, CNSService_GetNodeInfo_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// CNSServiceServer is the server API for CNSService service. +// All implementations must embed UnimplementedCNSServiceServer +// for forward compatibility +type CNSServiceServer interface { + // Sets the orchestrator information for a node. + SetOrchestratorInfo(context.Context, *SetOrchestratorInfoRequest) (*SetOrchestratorInfoResponse, error) + // Retrieves detailed information about a specific node. + // Primarily used for health checks. + GetNodeInfo(context.Context, *NodeInfoRequest) (*NodeInfoResponse, error) + mustEmbedUnimplementedCNSServiceServer() +} + +// UnimplementedCNSServiceServer must be embedded to have forward compatible implementations. +type UnimplementedCNSServiceServer struct { +} + +func (UnimplementedCNSServiceServer) SetOrchestratorInfo(context.Context, *SetOrchestratorInfoRequest) (*SetOrchestratorInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetOrchestratorInfo not implemented") +} +func (UnimplementedCNSServiceServer) GetNodeInfo(context.Context, *NodeInfoRequest) (*NodeInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNodeInfo not implemented") +} +func (UnimplementedCNSServiceServer) mustEmbedUnimplementedCNSServiceServer() {} + +// UnsafeCNSServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to CNSServiceServer will +// result in compilation errors. +type UnsafeCNSServiceServer interface { + mustEmbedUnimplementedCNSServiceServer() +} + +func RegisterCNSServiceServer(s grpc.ServiceRegistrar, srv CNSServiceServer) { + s.RegisterService(&CNSService_ServiceDesc, srv) +} + +func _CNSService_SetOrchestratorInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetOrchestratorInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CNSServiceServer).SetOrchestratorInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: CNSService_SetOrchestratorInfo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CNSServiceServer).SetOrchestratorInfo(ctx, req.(*SetOrchestratorInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _CNSService_GetNodeInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NodeInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CNSServiceServer).GetNodeInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: CNSService_GetNodeInfo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CNSServiceServer).GetNodeInfo(ctx, req.(*NodeInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// CNSService_ServiceDesc is the grpc.ServiceDesc for CNSService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var CNSService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "cns.CNSService", + HandlerType: (*CNSServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SetOrchestratorInfo", + Handler: _CNSService_SetOrchestratorInfo_Handler, + }, + { + MethodName: "GetNodeInfo", + Handler: _CNSService_GetNodeInfo_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cns/grpc/proto/server.proto", +} diff --git a/cns/grpc/proto/server.proto b/cns/grpc/proto/server.proto new file mode 100644 index 0000000000..c08a02ef7b --- /dev/null +++ b/cns/grpc/proto/server.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; + +package cns; + +option go_package = "cns/grpc/cnsv1alpha"; + +// The Container Network Service (CNS) exposes a set of operations that allow the Delegated Network Controller (DNC) to manage +// and monitor nodes in an orchestrator's infrastructure. + +// CNSService defines the gRPC service exposed by CNS to interact with DNC. +service CNSService { + // Sets the orchestrator information for a node. + rpc SetOrchestratorInfo(SetOrchestratorInfoRequest) returns (SetOrchestratorInfoResponse); + + // Retrieves detailed information about a specific node. + // Primarily used for health checks. + rpc GetNodeInfo(NodeInfoRequest) returns (NodeInfoResponse); +} + +// SetOrchestratorInfoRequest is the request message for setting the orchestrator information. +message SetOrchestratorInfoRequest { + string dncPartitionKey = 1; // The partition key for DNC. + string nodeID = 2; // The node ID. + string orchestratorType = 3; // The type of the orchestrator. +} + +// SetOrchestratorInfoResponse is the response message for setting the orchestrator information. +message SetOrchestratorInfoResponse {} + +// NodeInfoRequest is the request message for retrieving detailed information about a specific node. +message NodeInfoRequest { + string nodeID = 1; // The node ID to identify the specific node. +} + +// NodeInfoResponse is the response message containing detailed information about a specific node. +message NodeInfoResponse { + string nodeID = 1; // The node ID. + string name = 2; // The name of the node. + string ip = 3; // The IP address of the node. + bool isHealthy = 4; // Indicates whether the node is healthy or not. + string status = 5; // The current status of the node (e.g., running, stopped). + string message = 6; // Additional information about the node's health or status. +} From 48d449d9e9dd26238ba0cb9154049fc9780a97bf Mon Sep 17 00:00:00 2001 From: Kevin Date: Wed, 29 May 2024 17:07:04 +0000 Subject: [PATCH 2/3] Updated Protobuf Service Name --- cns/grpc/cnsv1alpha/server.pb.go | 34 ++++++------ cns/grpc/cnsv1alpha/server_grpc.pb.go | 80 +++++++++++++-------------- cns/grpc/proto/server.proto | 4 +- 3 files changed, 59 insertions(+), 59 deletions(-) diff --git a/cns/grpc/cnsv1alpha/server.pb.go b/cns/grpc/cnsv1alpha/server.pb.go index 647b1730b5..468650dcf7 100644 --- a/cns/grpc/cnsv1alpha/server.pb.go +++ b/cns/grpc/cnsv1alpha/server.pb.go @@ -287,19 +287,19 @@ var file_cns_grpc_proto_server_proto_rawDesc = []byte{ 0x73, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x32, 0xa2, 0x01, 0x0a, 0x0a, 0x43, - 0x4e, 0x53, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x58, 0x0a, 0x13, 0x53, 0x65, 0x74, - 0x4f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, - 0x12, 0x1f, 0x2e, 0x63, 0x6e, 0x73, 0x2e, 0x53, 0x65, 0x74, 0x4f, 0x72, 0x63, 0x68, 0x65, 0x73, - 0x74, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x20, 0x2e, 0x63, 0x6e, 0x73, 0x2e, 0x53, 0x65, 0x74, 0x4f, 0x72, 0x63, 0x68, 0x65, - 0x73, 0x74, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, - 0x66, 0x6f, 0x12, 0x14, 0x2e, 0x63, 0x6e, 0x73, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x63, 0x6e, 0x73, 0x2e, 0x4e, - 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, - 0x15, 0x5a, 0x13, 0x63, 0x6e, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x6e, 0x73, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x32, 0x9b, 0x01, 0x0a, 0x03, 0x43, + 0x4e, 0x53, 0x12, 0x58, 0x0a, 0x13, 0x53, 0x65, 0x74, 0x4f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1f, 0x2e, 0x63, 0x6e, 0x73, 0x2e, + 0x53, 0x65, 0x74, 0x4f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x63, 0x6e, 0x73, + 0x2e, 0x53, 0x65, 0x74, 0x4f, 0x72, 0x63, 0x68, 0x65, 0x73, 0x74, 0x72, 0x61, 0x74, 0x6f, 0x72, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x0b, + 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x2e, 0x63, 0x6e, + 0x73, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x15, 0x2e, 0x63, 0x6e, 0x73, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x15, 0x5a, 0x13, 0x63, 0x6e, 0x73, 0x2f, + 0x67, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x6e, 0x73, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -322,10 +322,10 @@ var file_cns_grpc_proto_server_proto_goTypes = []interface{}{ (*NodeInfoResponse)(nil), // 3: cns.NodeInfoResponse } var file_cns_grpc_proto_server_proto_depIdxs = []int32{ - 0, // 0: cns.CNSService.SetOrchestratorInfo:input_type -> cns.SetOrchestratorInfoRequest - 2, // 1: cns.CNSService.GetNodeInfo:input_type -> cns.NodeInfoRequest - 1, // 2: cns.CNSService.SetOrchestratorInfo:output_type -> cns.SetOrchestratorInfoResponse - 3, // 3: cns.CNSService.GetNodeInfo:output_type -> cns.NodeInfoResponse + 0, // 0: cns.CNS.SetOrchestratorInfo:input_type -> cns.SetOrchestratorInfoRequest + 2, // 1: cns.CNS.GetNodeInfo:input_type -> cns.NodeInfoRequest + 1, // 2: cns.CNS.SetOrchestratorInfo:output_type -> cns.SetOrchestratorInfoResponse + 3, // 3: cns.CNS.GetNodeInfo:output_type -> cns.NodeInfoResponse 2, // [2:4] is the sub-list for method output_type 0, // [0:2] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name diff --git a/cns/grpc/cnsv1alpha/server_grpc.pb.go b/cns/grpc/cnsv1alpha/server_grpc.pb.go index 7afef2ce0f..1a45e235da 100644 --- a/cns/grpc/cnsv1alpha/server_grpc.pb.go +++ b/cns/grpc/cnsv1alpha/server_grpc.pb.go @@ -19,14 +19,14 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - CNSService_SetOrchestratorInfo_FullMethodName = "/cns.CNSService/SetOrchestratorInfo" - CNSService_GetNodeInfo_FullMethodName = "/cns.CNSService/GetNodeInfo" + CNS_SetOrchestratorInfo_FullMethodName = "/cns.CNS/SetOrchestratorInfo" + CNS_GetNodeInfo_FullMethodName = "/cns.CNS/GetNodeInfo" ) -// CNSServiceClient is the client API for CNSService service. +// CNSClient is the client API for CNS 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 CNSServiceClient interface { +type CNSClient interface { // Sets the orchestrator information for a node. SetOrchestratorInfo(ctx context.Context, in *SetOrchestratorInfoRequest, opts ...grpc.CallOption) (*SetOrchestratorInfoResponse, error) // Retrieves detailed information about a specific node. @@ -34,117 +34,117 @@ type CNSServiceClient interface { GetNodeInfo(ctx context.Context, in *NodeInfoRequest, opts ...grpc.CallOption) (*NodeInfoResponse, error) } -type cNSServiceClient struct { +type cNSClient struct { cc grpc.ClientConnInterface } -func NewCNSServiceClient(cc grpc.ClientConnInterface) CNSServiceClient { - return &cNSServiceClient{cc} +func NewCNSClient(cc grpc.ClientConnInterface) CNSClient { + return &cNSClient{cc} } -func (c *cNSServiceClient) SetOrchestratorInfo(ctx context.Context, in *SetOrchestratorInfoRequest, opts ...grpc.CallOption) (*SetOrchestratorInfoResponse, error) { +func (c *cNSClient) SetOrchestratorInfo(ctx context.Context, in *SetOrchestratorInfoRequest, opts ...grpc.CallOption) (*SetOrchestratorInfoResponse, error) { out := new(SetOrchestratorInfoResponse) - err := c.cc.Invoke(ctx, CNSService_SetOrchestratorInfo_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, CNS_SetOrchestratorInfo_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *cNSServiceClient) GetNodeInfo(ctx context.Context, in *NodeInfoRequest, opts ...grpc.CallOption) (*NodeInfoResponse, error) { +func (c *cNSClient) GetNodeInfo(ctx context.Context, in *NodeInfoRequest, opts ...grpc.CallOption) (*NodeInfoResponse, error) { out := new(NodeInfoResponse) - err := c.cc.Invoke(ctx, CNSService_GetNodeInfo_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, CNS_GetNodeInfo_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -// CNSServiceServer is the server API for CNSService service. -// All implementations must embed UnimplementedCNSServiceServer +// CNSServer is the server API for CNS service. +// All implementations must embed UnimplementedCNSServer // for forward compatibility -type CNSServiceServer interface { +type CNSServer interface { // Sets the orchestrator information for a node. SetOrchestratorInfo(context.Context, *SetOrchestratorInfoRequest) (*SetOrchestratorInfoResponse, error) // Retrieves detailed information about a specific node. // Primarily used for health checks. GetNodeInfo(context.Context, *NodeInfoRequest) (*NodeInfoResponse, error) - mustEmbedUnimplementedCNSServiceServer() + mustEmbedUnimplementedCNSServer() } -// UnimplementedCNSServiceServer must be embedded to have forward compatible implementations. -type UnimplementedCNSServiceServer struct { +// UnimplementedCNSServer must be embedded to have forward compatible implementations. +type UnimplementedCNSServer struct { } -func (UnimplementedCNSServiceServer) SetOrchestratorInfo(context.Context, *SetOrchestratorInfoRequest) (*SetOrchestratorInfoResponse, error) { +func (UnimplementedCNSServer) SetOrchestratorInfo(context.Context, *SetOrchestratorInfoRequest) (*SetOrchestratorInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SetOrchestratorInfo not implemented") } -func (UnimplementedCNSServiceServer) GetNodeInfo(context.Context, *NodeInfoRequest) (*NodeInfoResponse, error) { +func (UnimplementedCNSServer) GetNodeInfo(context.Context, *NodeInfoRequest) (*NodeInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetNodeInfo not implemented") } -func (UnimplementedCNSServiceServer) mustEmbedUnimplementedCNSServiceServer() {} +func (UnimplementedCNSServer) mustEmbedUnimplementedCNSServer() {} -// UnsafeCNSServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to CNSServiceServer will +// UnsafeCNSServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to CNSServer will // result in compilation errors. -type UnsafeCNSServiceServer interface { - mustEmbedUnimplementedCNSServiceServer() +type UnsafeCNSServer interface { + mustEmbedUnimplementedCNSServer() } -func RegisterCNSServiceServer(s grpc.ServiceRegistrar, srv CNSServiceServer) { - s.RegisterService(&CNSService_ServiceDesc, srv) +func RegisterCNSServer(s grpc.ServiceRegistrar, srv CNSServer) { + s.RegisterService(&CNS_ServiceDesc, srv) } -func _CNSService_SetOrchestratorInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _CNS_SetOrchestratorInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SetOrchestratorInfoRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(CNSServiceServer).SetOrchestratorInfo(ctx, in) + return srv.(CNSServer).SetOrchestratorInfo(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: CNSService_SetOrchestratorInfo_FullMethodName, + FullMethod: CNS_SetOrchestratorInfo_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CNSServiceServer).SetOrchestratorInfo(ctx, req.(*SetOrchestratorInfoRequest)) + return srv.(CNSServer).SetOrchestratorInfo(ctx, req.(*SetOrchestratorInfoRequest)) } return interceptor(ctx, in, info, handler) } -func _CNSService_GetNodeInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _CNS_GetNodeInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(NodeInfoRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(CNSServiceServer).GetNodeInfo(ctx, in) + return srv.(CNSServer).GetNodeInfo(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: CNSService_GetNodeInfo_FullMethodName, + FullMethod: CNS_GetNodeInfo_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CNSServiceServer).GetNodeInfo(ctx, req.(*NodeInfoRequest)) + return srv.(CNSServer).GetNodeInfo(ctx, req.(*NodeInfoRequest)) } return interceptor(ctx, in, info, handler) } -// CNSService_ServiceDesc is the grpc.ServiceDesc for CNSService service. +// CNS_ServiceDesc is the grpc.ServiceDesc for CNS service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) -var CNSService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "cns.CNSService", - HandlerType: (*CNSServiceServer)(nil), +var CNS_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "cns.CNS", + HandlerType: (*CNSServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SetOrchestratorInfo", - Handler: _CNSService_SetOrchestratorInfo_Handler, + Handler: _CNS_SetOrchestratorInfo_Handler, }, { MethodName: "GetNodeInfo", - Handler: _CNSService_GetNodeInfo_Handler, + Handler: _CNS_GetNodeInfo_Handler, }, }, Streams: []grpc.StreamDesc{}, diff --git a/cns/grpc/proto/server.proto b/cns/grpc/proto/server.proto index c08a02ef7b..9ddce60284 100644 --- a/cns/grpc/proto/server.proto +++ b/cns/grpc/proto/server.proto @@ -7,8 +7,8 @@ option go_package = "cns/grpc/cnsv1alpha"; // The Container Network Service (CNS) exposes a set of operations that allow the Delegated Network Controller (DNC) to manage // and monitor nodes in an orchestrator's infrastructure. -// CNSService defines the gRPC service exposed by CNS to interact with DNC. -service CNSService { +// CNS defines the gRPC service exposed by CNS to interact with DNC. +service CNS { // Sets the orchestrator information for a node. rpc SetOrchestratorInfo(SetOrchestratorInfoRequest) returns (SetOrchestratorInfoResponse); From 98c5163d10375b981650268a3ba99cbdeecbd579 Mon Sep 17 00:00:00 2001 From: Kevin Date: Fri, 31 May 2024 15:15:25 +0000 Subject: [PATCH 3/3] Package Rename --- cns/grpc/proto/server.proto | 2 +- cns/grpc/{cnsv1alpha => v1alpha}/server.pb.go | 8 ++++---- cns/grpc/{cnsv1alpha => v1alpha}/server_grpc.pb.go | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) rename cns/grpc/{cnsv1alpha => v1alpha}/server.pb.go (98%) rename cns/grpc/{cnsv1alpha => v1alpha}/server_grpc.pb.go (99%) diff --git a/cns/grpc/proto/server.proto b/cns/grpc/proto/server.proto index 9ddce60284..a5754797e2 100644 --- a/cns/grpc/proto/server.proto +++ b/cns/grpc/proto/server.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package cns; -option go_package = "cns/grpc/cnsv1alpha"; +option go_package = "cns/grpc/v1alpha"; // The Container Network Service (CNS) exposes a set of operations that allow the Delegated Network Controller (DNC) to manage // and monitor nodes in an orchestrator's infrastructure. diff --git a/cns/grpc/cnsv1alpha/server.pb.go b/cns/grpc/v1alpha/server.pb.go similarity index 98% rename from cns/grpc/cnsv1alpha/server.pb.go rename to cns/grpc/v1alpha/server.pb.go index 468650dcf7..59e4abb977 100644 --- a/cns/grpc/cnsv1alpha/server.pb.go +++ b/cns/grpc/v1alpha/server.pb.go @@ -4,7 +4,7 @@ // protoc v3.12.4 // source: cns/grpc/proto/server.proto -package cnsv1alpha +package v1alpha import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -297,9 +297,9 @@ var file_cns_grpc_proto_server_proto_rawDesc = []byte{ 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x2e, 0x63, 0x6e, 0x73, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x63, 0x6e, 0x73, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x15, 0x5a, 0x13, 0x63, 0x6e, 0x73, 0x2f, - 0x67, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x6e, 0x73, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x12, 0x5a, 0x10, 0x63, 0x6e, 0x73, 0x2f, + 0x67, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/cns/grpc/cnsv1alpha/server_grpc.pb.go b/cns/grpc/v1alpha/server_grpc.pb.go similarity index 99% rename from cns/grpc/cnsv1alpha/server_grpc.pb.go rename to cns/grpc/v1alpha/server_grpc.pb.go index 1a45e235da..07bd93496f 100644 --- a/cns/grpc/cnsv1alpha/server_grpc.pb.go +++ b/cns/grpc/v1alpha/server_grpc.pb.go @@ -4,7 +4,7 @@ // - protoc v3.12.4 // source: cns/grpc/proto/server.proto -package cnsv1alpha +package v1alpha import ( context "context"