diff --git a/go.mod b/go.mod index cc8c4ad3..a4f94810 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/go-redis/redis v6.15.8+incompatible // indirect github.com/go-yaml/yaml v2.1.0+incompatible github.com/golang/protobuf v1.4.2 - github.com/iwind/TeaGo v0.0.0-20200816132655-f784df8e9c42 + github.com/iwind/TeaGo v0.0.0-20200822074248-b1cf7248c98a github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.1 // indirect github.com/pquerna/ffjson v0.0.0-20190930134022-aa0246cd15f7 // indirect diff --git a/go.sum b/go.sum index d36ec3b9..9fae3cf9 100644 --- a/go.sum +++ b/go.sum @@ -47,6 +47,8 @@ github.com/iwind/TeaGo v0.0.0-20200723131229-30dff10543ad h1:EVwLRNPYoCNCinN/J9F github.com/iwind/TeaGo v0.0.0-20200723131229-30dff10543ad/go.mod h1:zjM7k+b+Jthhf0T0fKwuF0iy4TWb5SsU1gmKR2l+OmE= github.com/iwind/TeaGo v0.0.0-20200816132655-f784df8e9c42 h1:X58QYxjoTstHR4sQEwx4ChAFRYtlWAfqwimQ3d2osT0= github.com/iwind/TeaGo v0.0.0-20200816132655-f784df8e9c42/go.mod h1:KU4mS7QNiZ7QWEuDBk1zw0/Q2LrAPZv3tycEFBsuUwc= +github.com/iwind/TeaGo v0.0.0-20200822074248-b1cf7248c98a h1:VaWcMNOzHHT1y8MeTA2fWhG6GEfAdy6CwF2tW+KiY5Y= +github.com/iwind/TeaGo v0.0.0-20200822074248-b1cf7248c98a/go.mod h1:KU4mS7QNiZ7QWEuDBk1zw0/Q2LrAPZv3tycEFBsuUwc= github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= diff --git a/internal/rpc/pb/model_api_node.pb.go b/internal/rpc/pb/model_api_node.pb.go new file mode 100644 index 00000000..e41c5d59 --- /dev/null +++ b/internal/rpc/pb/model_api_node.pb.go @@ -0,0 +1,222 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.12.3 +// source: model_api_node.proto + +package pb + +import ( + proto "github.com/golang/protobuf/proto" + 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) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type APINode struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + IsOn bool `protobuf:"varint,2,opt,name=isOn,proto3" json:"isOn,omitempty"` + ClusterId int64 `protobuf:"varint,3,opt,name=clusterId,proto3" json:"clusterId,omitempty"` + UniqueId string `protobuf:"bytes,4,opt,name=uniqueId,proto3" json:"uniqueId,omitempty"` + Secret string `protobuf:"bytes,5,opt,name=secret,proto3" json:"secret,omitempty"` + Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,7,opt,name=description,proto3" json:"description,omitempty"` + Host string `protobuf:"bytes,8,opt,name=host,proto3" json:"host,omitempty"` + Port int32 `protobuf:"varint,9,opt,name=port,proto3" json:"port,omitempty"` +} + +func (x *APINode) Reset() { + *x = APINode{} + if protoimpl.UnsafeEnabled { + mi := &file_model_api_node_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *APINode) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*APINode) ProtoMessage() {} + +func (x *APINode) ProtoReflect() protoreflect.Message { + mi := &file_model_api_node_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 APINode.ProtoReflect.Descriptor instead. +func (*APINode) Descriptor() ([]byte, []int) { + return file_model_api_node_proto_rawDescGZIP(), []int{0} +} + +func (x *APINode) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *APINode) GetIsOn() bool { + if x != nil { + return x.IsOn + } + return false +} + +func (x *APINode) GetClusterId() int64 { + if x != nil { + return x.ClusterId + } + return 0 +} + +func (x *APINode) GetUniqueId() string { + if x != nil { + return x.UniqueId + } + return "" +} + +func (x *APINode) GetSecret() string { + if x != nil { + return x.Secret + } + return "" +} + +func (x *APINode) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *APINode) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *APINode) GetHost() string { + if x != nil { + return x.Host + } + return "" +} + +func (x *APINode) GetPort() int32 { + if x != nil { + return x.Port + } + return 0 +} + +var File_model_api_node_proto protoreflect.FileDescriptor + +var file_model_api_node_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x6e, 0x6f, 0x64, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xdd, 0x01, 0x0a, 0x07, 0x41, + 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, + 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, + 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x6e, 0x69, 0x71, + 0x75, 0x65, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x6e, 0x69, 0x71, + 0x75, 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, + 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_model_api_node_proto_rawDescOnce sync.Once + file_model_api_node_proto_rawDescData = file_model_api_node_proto_rawDesc +) + +func file_model_api_node_proto_rawDescGZIP() []byte { + file_model_api_node_proto_rawDescOnce.Do(func() { + file_model_api_node_proto_rawDescData = protoimpl.X.CompressGZIP(file_model_api_node_proto_rawDescData) + }) + return file_model_api_node_proto_rawDescData +} + +var file_model_api_node_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_model_api_node_proto_goTypes = []interface{}{ + (*APINode)(nil), // 0: pb.APINode +} +var file_model_api_node_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] 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_model_api_node_proto_init() } +func file_model_api_node_proto_init() { + if File_model_api_node_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_model_api_node_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*APINode); 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_model_api_node_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_model_api_node_proto_goTypes, + DependencyIndexes: file_model_api_node_proto_depIdxs, + MessageInfos: file_model_api_node_proto_msgTypes, + }.Build() + File_model_api_node_proto = out.File + file_model_api_node_proto_rawDesc = nil + file_model_api_node_proto_goTypes = nil + file_model_api_node_proto_depIdxs = nil +} diff --git a/internal/rpc/pb/model_node.pb.go b/internal/rpc/pb/model_node.pb.go index 561d6e55..bbe3b28a 100644 --- a/internal/rpc/pb/model_node.pb.go +++ b/internal/rpc/pb/model_node.pb.go @@ -30,11 +30,16 @@ type Node struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` - Cluster *NodeCluster `protobuf:"bytes,32,opt,name=cluster,proto3" json:"cluster,omitempty"` - Login *NodeLogin `protobuf:"bytes,33,opt,name=login,proto3" json:"login,omitempty"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` + InstallDir string `protobuf:"bytes,4,opt,name=installDir,proto3" json:"installDir,omitempty"` + IsInstalled bool `protobuf:"varint,5,opt,name=isInstalled,proto3" json:"isInstalled,omitempty"` + Code string `protobuf:"bytes,6,opt,name=code,proto3" json:"code,omitempty"` + UniqueId string `protobuf:"bytes,7,opt,name=uniqueId,proto3" json:"uniqueId,omitempty"` + Secret string `protobuf:"bytes,8,opt,name=secret,proto3" json:"secret,omitempty"` + Cluster *NodeCluster `protobuf:"bytes,32,opt,name=cluster,proto3" json:"cluster,omitempty"` + Login *NodeLogin `protobuf:"bytes,33,opt,name=login,proto3" json:"login,omitempty"` } func (x *Node) Reset() { @@ -90,6 +95,41 @@ func (x *Node) GetStatus() string { return "" } +func (x *Node) GetInstallDir() string { + if x != nil { + return x.InstallDir + } + return "" +} + +func (x *Node) GetIsInstalled() bool { + if x != nil { + return x.IsInstalled + } + return false +} + +func (x *Node) GetCode() string { + if x != nil { + return x.Code + } + return "" +} + +func (x *Node) GetUniqueId() string { + if x != nil { + return x.UniqueId + } + return "" +} + +func (x *Node) GetSecret() string { + if x != nil { + return x.Secret + } + return "" +} + func (x *Node) GetCluster() *NodeCluster { if x != nil { return x.Cluster @@ -111,17 +151,26 @@ var file_model_node_proto_rawDesc = []byte{ 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x18, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6c, 0x6f, 0x67, - 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x92, 0x01, 0x0a, 0x04, 0x4e, 0x6f, 0x64, + 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9c, 0x02, 0x0a, 0x04, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 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, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x29, 0x0a, - 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x20, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, - 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, - 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x05, 0x6c, 0x6f, 0x67, 0x69, - 0x6e, 0x18, 0x21, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, - 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x05, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x42, 0x06, 0x5a, - 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1e, 0x0a, + 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x12, 0x20, 0x0a, + 0x0b, 0x69, 0x73, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0b, 0x69, 0x73, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x12, + 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, + 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x64, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x64, 0x12, + 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x29, 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x18, 0x20, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, + 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x12, 0x23, 0x0a, 0x05, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x21, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, + 0x52, 0x05, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/internal/rpc/pb/model_node_cluster.pb.go b/internal/rpc/pb/model_node_cluster.pb.go index c71f5191..4c4ec07c 100644 --- a/internal/rpc/pb/model_node_cluster.pb.go +++ b/internal/rpc/pb/model_node_cluster.pb.go @@ -30,9 +30,11 @@ type NodeCluster struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - CreatedAt int64 `protobuf:"varint,3,opt,name=createdAt,proto3" json:"createdAt,omitempty"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + CreatedAt int64 `protobuf:"varint,3,opt,name=createdAt,proto3" json:"createdAt,omitempty"` + GrantId int64 `protobuf:"varint,4,opt,name=grantId,proto3" json:"grantId,omitempty"` + InstallDir string `protobuf:"bytes,5,opt,name=installDir,proto3" json:"installDir,omitempty"` } func (x *NodeCluster) Reset() { @@ -88,17 +90,35 @@ func (x *NodeCluster) GetCreatedAt() int64 { return 0 } +func (x *NodeCluster) GetGrantId() int64 { + if x != nil { + return x.GrantId + } + return 0 +} + +func (x *NodeCluster) GetInstallDir() string { + if x != nil { + return x.InstallDir + } + return "" +} + var File_model_node_cluster_proto protoreflect.FileDescriptor var file_model_node_cluster_proto_rawDesc = []byte{ 0x0a, 0x18, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x63, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x4f, - 0x0a, 0x0b, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 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, 0x1c, 0x0a, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x42, - 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x89, + 0x01, 0x0a, 0x0b, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 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, 0x1c, 0x0a, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, + 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x6e, + 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, + 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/internal/rpc/pb/service_api_node.pb.go b/internal/rpc/pb/service_api_node.pb.go new file mode 100644 index 00000000..7105fb6c --- /dev/null +++ b/internal/rpc/pb/service_api_node.pb.go @@ -0,0 +1,1385 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.12.3 +// source: service_api_node.proto + +package pb + +import ( + context "context" + proto "github.com/golang/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + 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) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +// 创建API节点 +type CreateAPINodeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Host string `protobuf:"bytes,3,opt,name=host,proto3" json:"host,omitempty"` + Port int32 `protobuf:"varint,4,opt,name=port,proto3" json:"port,omitempty"` +} + +func (x *CreateAPINodeRequest) Reset() { + *x = CreateAPINodeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_api_node_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateAPINodeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateAPINodeRequest) ProtoMessage() {} + +func (x *CreateAPINodeRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_api_node_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 CreateAPINodeRequest.ProtoReflect.Descriptor instead. +func (*CreateAPINodeRequest) Descriptor() ([]byte, []int) { + return file_service_api_node_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateAPINodeRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreateAPINodeRequest) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *CreateAPINodeRequest) GetHost() string { + if x != nil { + return x.Host + } + return "" +} + +func (x *CreateAPINodeRequest) GetPort() int32 { + if x != nil { + return x.Port + } + return 0 +} + +type CreateAPINodeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` +} + +func (x *CreateAPINodeResponse) Reset() { + *x = CreateAPINodeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_api_node_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateAPINodeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateAPINodeResponse) ProtoMessage() {} + +func (x *CreateAPINodeResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_api_node_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 CreateAPINodeResponse.ProtoReflect.Descriptor instead. +func (*CreateAPINodeResponse) Descriptor() ([]byte, []int) { + return file_service_api_node_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateAPINodeResponse) GetNodeId() int64 { + if x != nil { + return x.NodeId + } + return 0 +} + +// 修改API节点 +type UpdateAPINodeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + Host string `protobuf:"bytes,4,opt,name=host,proto3" json:"host,omitempty"` + Port int32 `protobuf:"varint,5,opt,name=port,proto3" json:"port,omitempty"` +} + +func (x *UpdateAPINodeRequest) Reset() { + *x = UpdateAPINodeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_api_node_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateAPINodeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateAPINodeRequest) ProtoMessage() {} + +func (x *UpdateAPINodeRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_api_node_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 UpdateAPINodeRequest.ProtoReflect.Descriptor instead. +func (*UpdateAPINodeRequest) Descriptor() ([]byte, []int) { + return file_service_api_node_proto_rawDescGZIP(), []int{2} +} + +func (x *UpdateAPINodeRequest) GetNodeId() int64 { + if x != nil { + return x.NodeId + } + return 0 +} + +func (x *UpdateAPINodeRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UpdateAPINodeRequest) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *UpdateAPINodeRequest) GetHost() string { + if x != nil { + return x.Host + } + return "" +} + +func (x *UpdateAPINodeRequest) GetPort() int32 { + if x != nil { + return x.Port + } + return 0 +} + +type UpdateAPINodeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *UpdateAPINodeResponse) Reset() { + *x = UpdateAPINodeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_api_node_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateAPINodeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateAPINodeResponse) ProtoMessage() {} + +func (x *UpdateAPINodeResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_api_node_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 UpdateAPINodeResponse.ProtoReflect.Descriptor instead. +func (*UpdateAPINodeResponse) Descriptor() ([]byte, []int) { + return file_service_api_node_proto_rawDescGZIP(), []int{3} +} + +// 删除API节点 +type DeleteAPINodeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` +} + +func (x *DeleteAPINodeRequest) Reset() { + *x = DeleteAPINodeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_api_node_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteAPINodeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteAPINodeRequest) ProtoMessage() {} + +func (x *DeleteAPINodeRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_api_node_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 DeleteAPINodeRequest.ProtoReflect.Descriptor instead. +func (*DeleteAPINodeRequest) Descriptor() ([]byte, []int) { + return file_service_api_node_proto_rawDescGZIP(), []int{4} +} + +func (x *DeleteAPINodeRequest) GetNodeId() int64 { + if x != nil { + return x.NodeId + } + return 0 +} + +type DeleteAPINodeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeleteAPINodeResponse) Reset() { + *x = DeleteAPINodeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_api_node_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteAPINodeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteAPINodeResponse) ProtoMessage() {} + +func (x *DeleteAPINodeResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_api_node_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 DeleteAPINodeResponse.ProtoReflect.Descriptor instead. +func (*DeleteAPINodeResponse) Descriptor() ([]byte, []int) { + return file_service_api_node_proto_rawDescGZIP(), []int{5} +} + +// 列出所有可用API节点 +type FindAllEnabledAPINodesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *FindAllEnabledAPINodesRequest) Reset() { + *x = FindAllEnabledAPINodesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_api_node_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindAllEnabledAPINodesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindAllEnabledAPINodesRequest) ProtoMessage() {} + +func (x *FindAllEnabledAPINodesRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_api_node_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 FindAllEnabledAPINodesRequest.ProtoReflect.Descriptor instead. +func (*FindAllEnabledAPINodesRequest) Descriptor() ([]byte, []int) { + return file_service_api_node_proto_rawDescGZIP(), []int{6} +} + +type FindAllEnabledAPINodesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Nodes []*APINode `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"` +} + +func (x *FindAllEnabledAPINodesResponse) Reset() { + *x = FindAllEnabledAPINodesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_api_node_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindAllEnabledAPINodesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindAllEnabledAPINodesResponse) ProtoMessage() {} + +func (x *FindAllEnabledAPINodesResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_api_node_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 FindAllEnabledAPINodesResponse.ProtoReflect.Descriptor instead. +func (*FindAllEnabledAPINodesResponse) Descriptor() ([]byte, []int) { + return file_service_api_node_proto_rawDescGZIP(), []int{7} +} + +func (x *FindAllEnabledAPINodesResponse) GetNodes() []*APINode { + if x != nil { + return x.Nodes + } + return nil +} + +// 计算API节点数量 +type CountAllEnabledAPINodesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CountAllEnabledAPINodesRequest) Reset() { + *x = CountAllEnabledAPINodesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_api_node_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CountAllEnabledAPINodesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CountAllEnabledAPINodesRequest) ProtoMessage() {} + +func (x *CountAllEnabledAPINodesRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_api_node_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 CountAllEnabledAPINodesRequest.ProtoReflect.Descriptor instead. +func (*CountAllEnabledAPINodesRequest) Descriptor() ([]byte, []int) { + return file_service_api_node_proto_rawDescGZIP(), []int{8} +} + +type CountAllEnabledAPINodesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *CountAllEnabledAPINodesResponse) Reset() { + *x = CountAllEnabledAPINodesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_api_node_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CountAllEnabledAPINodesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CountAllEnabledAPINodesResponse) ProtoMessage() {} + +func (x *CountAllEnabledAPINodesResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_api_node_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 CountAllEnabledAPINodesResponse.ProtoReflect.Descriptor instead. +func (*CountAllEnabledAPINodesResponse) Descriptor() ([]byte, []int) { + return file_service_api_node_proto_rawDescGZIP(), []int{9} +} + +func (x *CountAllEnabledAPINodesResponse) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +// 列出单页的API节点 +type ListEnabledAPINodesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Offset int64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"` + Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` +} + +func (x *ListEnabledAPINodesRequest) Reset() { + *x = ListEnabledAPINodesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_api_node_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListEnabledAPINodesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListEnabledAPINodesRequest) ProtoMessage() {} + +func (x *ListEnabledAPINodesRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_api_node_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 ListEnabledAPINodesRequest.ProtoReflect.Descriptor instead. +func (*ListEnabledAPINodesRequest) Descriptor() ([]byte, []int) { + return file_service_api_node_proto_rawDescGZIP(), []int{10} +} + +func (x *ListEnabledAPINodesRequest) GetOffset() int64 { + if x != nil { + return x.Offset + } + return 0 +} + +func (x *ListEnabledAPINodesRequest) GetSize() int64 { + if x != nil { + return x.Size + } + return 0 +} + +type ListEnabledAPINodesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Nodes []*APINode `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"` +} + +func (x *ListEnabledAPINodesResponse) Reset() { + *x = ListEnabledAPINodesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_api_node_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListEnabledAPINodesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListEnabledAPINodesResponse) ProtoMessage() {} + +func (x *ListEnabledAPINodesResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_api_node_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 ListEnabledAPINodesResponse.ProtoReflect.Descriptor instead. +func (*ListEnabledAPINodesResponse) Descriptor() ([]byte, []int) { + return file_service_api_node_proto_rawDescGZIP(), []int{11} +} + +func (x *ListEnabledAPINodesResponse) GetNodes() []*APINode { + if x != nil { + return x.Nodes + } + return nil +} + +// 根据ID查找节点 +type FindEnabledAPINodeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` +} + +func (x *FindEnabledAPINodeRequest) Reset() { + *x = FindEnabledAPINodeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_api_node_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindEnabledAPINodeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindEnabledAPINodeRequest) ProtoMessage() {} + +func (x *FindEnabledAPINodeRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_api_node_proto_msgTypes[12] + 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 FindEnabledAPINodeRequest.ProtoReflect.Descriptor instead. +func (*FindEnabledAPINodeRequest) Descriptor() ([]byte, []int) { + return file_service_api_node_proto_rawDescGZIP(), []int{12} +} + +func (x *FindEnabledAPINodeRequest) GetNodeId() int64 { + if x != nil { + return x.NodeId + } + return 0 +} + +type FindEnabledAPINodeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Node *APINode `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"` +} + +func (x *FindEnabledAPINodeResponse) Reset() { + *x = FindEnabledAPINodeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_api_node_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindEnabledAPINodeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindEnabledAPINodeResponse) ProtoMessage() {} + +func (x *FindEnabledAPINodeResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_api_node_proto_msgTypes[13] + 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 FindEnabledAPINodeResponse.ProtoReflect.Descriptor instead. +func (*FindEnabledAPINodeResponse) Descriptor() ([]byte, []int) { + return file_service_api_node_proto_rawDescGZIP(), []int{13} +} + +func (x *FindEnabledAPINodeResponse) GetNode() *APINode { + if x != nil { + return x.Node + } + return nil +} + +var File_service_api_node_proto protoreflect.FileDescriptor + +var file_service_api_node_proto_rawDesc = []byte{ + 0x0a, 0x16, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x6e, 0x6f, + 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x14, 0x6d, 0x6f, + 0x64, 0x65, 0x6c, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x74, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x50, 0x49, 0x4e, + 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, + 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x2f, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x22, 0x8c, 0x01, 0x0a, 0x14, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, + 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x17, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x2e, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x50, 0x49, 0x4e, 0x6f, + 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, + 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, + 0x64, 0x22, 0x17, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x50, 0x49, 0x4e, 0x6f, + 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x0a, 0x1d, 0x46, 0x69, + 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x50, 0x49, 0x4e, + 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x43, 0x0a, 0x1e, 0x46, + 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x50, 0x49, + 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, + 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, + 0x62, 0x2e, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, + 0x22, 0x20, 0x0a, 0x1e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x22, 0x37, 0x0a, 0x1f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x48, 0x0a, 0x1a, 0x4c, + 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, + 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, + 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x40, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, + 0x62, 0x6c, 0x65, 0x64, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, + 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x22, 0x33, 0x0a, 0x19, 0x46, 0x69, 0x6e, 0x64, 0x45, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x22, 0x3d, 0x0a, 0x1a, + 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x50, 0x49, 0x4e, 0x6f, + 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x04, 0x6e, 0x6f, + 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x41, 0x50, + 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x32, 0xd4, 0x04, 0x0a, 0x0e, + 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x44, + 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x12, + 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x50, 0x49, 0x4e, 0x6f, + 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x0d, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x50, + 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x50, 0x49, 0x4e, 0x6f, + 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x0d, 0x64, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x2e, 0x70, 0x62, + 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x5f, 0x0a, 0x16, 0x66, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x21, 0x2e, 0x70, 0x62, 0x2e, + 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x50, + 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, + 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x64, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x62, 0x0a, 0x17, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, + 0x62, 0x6c, 0x65, 0x64, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x22, 0x2e, 0x70, + 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x64, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x23, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x13, 0x6c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, + 0x62, 0x6c, 0x65, 0x64, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x1e, 0x2e, 0x70, + 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x50, 0x49, + 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x70, + 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x50, 0x49, + 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, + 0x12, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x50, 0x49, 0x4e, + 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, + 0x62, 0x6c, 0x65, 0x64, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x41, 0x50, 0x49, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_service_api_node_proto_rawDescOnce sync.Once + file_service_api_node_proto_rawDescData = file_service_api_node_proto_rawDesc +) + +func file_service_api_node_proto_rawDescGZIP() []byte { + file_service_api_node_proto_rawDescOnce.Do(func() { + file_service_api_node_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_api_node_proto_rawDescData) + }) + return file_service_api_node_proto_rawDescData +} + +var file_service_api_node_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_service_api_node_proto_goTypes = []interface{}{ + (*CreateAPINodeRequest)(nil), // 0: pb.CreateAPINodeRequest + (*CreateAPINodeResponse)(nil), // 1: pb.CreateAPINodeResponse + (*UpdateAPINodeRequest)(nil), // 2: pb.UpdateAPINodeRequest + (*UpdateAPINodeResponse)(nil), // 3: pb.UpdateAPINodeResponse + (*DeleteAPINodeRequest)(nil), // 4: pb.DeleteAPINodeRequest + (*DeleteAPINodeResponse)(nil), // 5: pb.DeleteAPINodeResponse + (*FindAllEnabledAPINodesRequest)(nil), // 6: pb.FindAllEnabledAPINodesRequest + (*FindAllEnabledAPINodesResponse)(nil), // 7: pb.FindAllEnabledAPINodesResponse + (*CountAllEnabledAPINodesRequest)(nil), // 8: pb.CountAllEnabledAPINodesRequest + (*CountAllEnabledAPINodesResponse)(nil), // 9: pb.CountAllEnabledAPINodesResponse + (*ListEnabledAPINodesRequest)(nil), // 10: pb.ListEnabledAPINodesRequest + (*ListEnabledAPINodesResponse)(nil), // 11: pb.ListEnabledAPINodesResponse + (*FindEnabledAPINodeRequest)(nil), // 12: pb.FindEnabledAPINodeRequest + (*FindEnabledAPINodeResponse)(nil), // 13: pb.FindEnabledAPINodeResponse + (*APINode)(nil), // 14: pb.APINode +} +var file_service_api_node_proto_depIdxs = []int32{ + 14, // 0: pb.FindAllEnabledAPINodesResponse.nodes:type_name -> pb.APINode + 14, // 1: pb.ListEnabledAPINodesResponse.nodes:type_name -> pb.APINode + 14, // 2: pb.FindEnabledAPINodeResponse.node:type_name -> pb.APINode + 0, // 3: pb.APINodeService.createAPINode:input_type -> pb.CreateAPINodeRequest + 2, // 4: pb.APINodeService.updateAPINode:input_type -> pb.UpdateAPINodeRequest + 4, // 5: pb.APINodeService.deleteAPINode:input_type -> pb.DeleteAPINodeRequest + 6, // 6: pb.APINodeService.findAllEnabledAPINodes:input_type -> pb.FindAllEnabledAPINodesRequest + 8, // 7: pb.APINodeService.countAllEnabledAPINodes:input_type -> pb.CountAllEnabledAPINodesRequest + 10, // 8: pb.APINodeService.listEnabledAPINodes:input_type -> pb.ListEnabledAPINodesRequest + 12, // 9: pb.APINodeService.findEnabledAPINode:input_type -> pb.FindEnabledAPINodeRequest + 1, // 10: pb.APINodeService.createAPINode:output_type -> pb.CreateAPINodeResponse + 3, // 11: pb.APINodeService.updateAPINode:output_type -> pb.UpdateAPINodeResponse + 5, // 12: pb.APINodeService.deleteAPINode:output_type -> pb.DeleteAPINodeResponse + 7, // 13: pb.APINodeService.findAllEnabledAPINodes:output_type -> pb.FindAllEnabledAPINodesResponse + 9, // 14: pb.APINodeService.countAllEnabledAPINodes:output_type -> pb.CountAllEnabledAPINodesResponse + 11, // 15: pb.APINodeService.listEnabledAPINodes:output_type -> pb.ListEnabledAPINodesResponse + 13, // 16: pb.APINodeService.findEnabledAPINode:output_type -> pb.FindEnabledAPINodeResponse + 10, // [10:17] is the sub-list for method output_type + 3, // [3:10] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_service_api_node_proto_init() } +func file_service_api_node_proto_init() { + if File_service_api_node_proto != nil { + return + } + file_model_api_node_proto_init() + if !protoimpl.UnsafeEnabled { + file_service_api_node_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateAPINodeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_api_node_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateAPINodeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_api_node_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateAPINodeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_api_node_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateAPINodeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_api_node_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteAPINodeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_api_node_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteAPINodeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_api_node_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindAllEnabledAPINodesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_api_node_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindAllEnabledAPINodesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_api_node_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CountAllEnabledAPINodesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_api_node_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CountAllEnabledAPINodesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_api_node_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListEnabledAPINodesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_api_node_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListEnabledAPINodesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_api_node_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindEnabledAPINodeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_api_node_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindEnabledAPINodeResponse); 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_service_api_node_proto_rawDesc, + NumEnums: 0, + NumMessages: 14, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_service_api_node_proto_goTypes, + DependencyIndexes: file_service_api_node_proto_depIdxs, + MessageInfos: file_service_api_node_proto_msgTypes, + }.Build() + File_service_api_node_proto = out.File + file_service_api_node_proto_rawDesc = nil + file_service_api_node_proto_goTypes = nil + file_service_api_node_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// APINodeServiceClient is the client API for APINodeService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type APINodeServiceClient interface { + // 创建API节点 + CreateAPINode(ctx context.Context, in *CreateAPINodeRequest, opts ...grpc.CallOption) (*CreateAPINodeResponse, error) + // 修改API节点 + UpdateAPINode(ctx context.Context, in *UpdateAPINodeRequest, opts ...grpc.CallOption) (*UpdateAPINodeResponse, error) + // 删除API节点 + DeleteAPINode(ctx context.Context, in *DeleteAPINodeRequest, opts ...grpc.CallOption) (*DeleteAPINodeResponse, error) + // 列出所有可用API节点 + FindAllEnabledAPINodes(ctx context.Context, in *FindAllEnabledAPINodesRequest, opts ...grpc.CallOption) (*FindAllEnabledAPINodesResponse, error) + // 计算API节点数量 + CountAllEnabledAPINodes(ctx context.Context, in *CountAllEnabledAPINodesRequest, opts ...grpc.CallOption) (*CountAllEnabledAPINodesResponse, error) + // 列出单页的API节点 + ListEnabledAPINodes(ctx context.Context, in *ListEnabledAPINodesRequest, opts ...grpc.CallOption) (*ListEnabledAPINodesResponse, error) + // 根据ID查找节点 + FindEnabledAPINode(ctx context.Context, in *FindEnabledAPINodeRequest, opts ...grpc.CallOption) (*FindEnabledAPINodeResponse, error) +} + +type aPINodeServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewAPINodeServiceClient(cc grpc.ClientConnInterface) APINodeServiceClient { + return &aPINodeServiceClient{cc} +} + +func (c *aPINodeServiceClient) CreateAPINode(ctx context.Context, in *CreateAPINodeRequest, opts ...grpc.CallOption) (*CreateAPINodeResponse, error) { + out := new(CreateAPINodeResponse) + err := c.cc.Invoke(ctx, "/pb.APINodeService/createAPINode", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPINodeServiceClient) UpdateAPINode(ctx context.Context, in *UpdateAPINodeRequest, opts ...grpc.CallOption) (*UpdateAPINodeResponse, error) { + out := new(UpdateAPINodeResponse) + err := c.cc.Invoke(ctx, "/pb.APINodeService/updateAPINode", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPINodeServiceClient) DeleteAPINode(ctx context.Context, in *DeleteAPINodeRequest, opts ...grpc.CallOption) (*DeleteAPINodeResponse, error) { + out := new(DeleteAPINodeResponse) + err := c.cc.Invoke(ctx, "/pb.APINodeService/deleteAPINode", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPINodeServiceClient) FindAllEnabledAPINodes(ctx context.Context, in *FindAllEnabledAPINodesRequest, opts ...grpc.CallOption) (*FindAllEnabledAPINodesResponse, error) { + out := new(FindAllEnabledAPINodesResponse) + err := c.cc.Invoke(ctx, "/pb.APINodeService/findAllEnabledAPINodes", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPINodeServiceClient) CountAllEnabledAPINodes(ctx context.Context, in *CountAllEnabledAPINodesRequest, opts ...grpc.CallOption) (*CountAllEnabledAPINodesResponse, error) { + out := new(CountAllEnabledAPINodesResponse) + err := c.cc.Invoke(ctx, "/pb.APINodeService/countAllEnabledAPINodes", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPINodeServiceClient) ListEnabledAPINodes(ctx context.Context, in *ListEnabledAPINodesRequest, opts ...grpc.CallOption) (*ListEnabledAPINodesResponse, error) { + out := new(ListEnabledAPINodesResponse) + err := c.cc.Invoke(ctx, "/pb.APINodeService/listEnabledAPINodes", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aPINodeServiceClient) FindEnabledAPINode(ctx context.Context, in *FindEnabledAPINodeRequest, opts ...grpc.CallOption) (*FindEnabledAPINodeResponse, error) { + out := new(FindEnabledAPINodeResponse) + err := c.cc.Invoke(ctx, "/pb.APINodeService/findEnabledAPINode", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// APINodeServiceServer is the server API for APINodeService service. +type APINodeServiceServer interface { + // 创建API节点 + CreateAPINode(context.Context, *CreateAPINodeRequest) (*CreateAPINodeResponse, error) + // 修改API节点 + UpdateAPINode(context.Context, *UpdateAPINodeRequest) (*UpdateAPINodeResponse, error) + // 删除API节点 + DeleteAPINode(context.Context, *DeleteAPINodeRequest) (*DeleteAPINodeResponse, error) + // 列出所有可用API节点 + FindAllEnabledAPINodes(context.Context, *FindAllEnabledAPINodesRequest) (*FindAllEnabledAPINodesResponse, error) + // 计算API节点数量 + CountAllEnabledAPINodes(context.Context, *CountAllEnabledAPINodesRequest) (*CountAllEnabledAPINodesResponse, error) + // 列出单页的API节点 + ListEnabledAPINodes(context.Context, *ListEnabledAPINodesRequest) (*ListEnabledAPINodesResponse, error) + // 根据ID查找节点 + FindEnabledAPINode(context.Context, *FindEnabledAPINodeRequest) (*FindEnabledAPINodeResponse, error) +} + +// UnimplementedAPINodeServiceServer can be embedded to have forward compatible implementations. +type UnimplementedAPINodeServiceServer struct { +} + +func (*UnimplementedAPINodeServiceServer) CreateAPINode(context.Context, *CreateAPINodeRequest) (*CreateAPINodeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateAPINode not implemented") +} +func (*UnimplementedAPINodeServiceServer) UpdateAPINode(context.Context, *UpdateAPINodeRequest) (*UpdateAPINodeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateAPINode not implemented") +} +func (*UnimplementedAPINodeServiceServer) DeleteAPINode(context.Context, *DeleteAPINodeRequest) (*DeleteAPINodeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteAPINode not implemented") +} +func (*UnimplementedAPINodeServiceServer) FindAllEnabledAPINodes(context.Context, *FindAllEnabledAPINodesRequest) (*FindAllEnabledAPINodesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FindAllEnabledAPINodes not implemented") +} +func (*UnimplementedAPINodeServiceServer) CountAllEnabledAPINodes(context.Context, *CountAllEnabledAPINodesRequest) (*CountAllEnabledAPINodesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CountAllEnabledAPINodes not implemented") +} +func (*UnimplementedAPINodeServiceServer) ListEnabledAPINodes(context.Context, *ListEnabledAPINodesRequest) (*ListEnabledAPINodesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListEnabledAPINodes not implemented") +} +func (*UnimplementedAPINodeServiceServer) FindEnabledAPINode(context.Context, *FindEnabledAPINodeRequest) (*FindEnabledAPINodeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FindEnabledAPINode not implemented") +} + +func RegisterAPINodeServiceServer(s *grpc.Server, srv APINodeServiceServer) { + s.RegisterService(&_APINodeService_serviceDesc, srv) +} + +func _APINodeService_CreateAPINode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateAPINodeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APINodeServiceServer).CreateAPINode(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.APINodeService/CreateAPINode", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APINodeServiceServer).CreateAPINode(ctx, req.(*CreateAPINodeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APINodeService_UpdateAPINode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateAPINodeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APINodeServiceServer).UpdateAPINode(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.APINodeService/UpdateAPINode", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APINodeServiceServer).UpdateAPINode(ctx, req.(*UpdateAPINodeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APINodeService_DeleteAPINode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteAPINodeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APINodeServiceServer).DeleteAPINode(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.APINodeService/DeleteAPINode", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APINodeServiceServer).DeleteAPINode(ctx, req.(*DeleteAPINodeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APINodeService_FindAllEnabledAPINodes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FindAllEnabledAPINodesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APINodeServiceServer).FindAllEnabledAPINodes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.APINodeService/FindAllEnabledAPINodes", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APINodeServiceServer).FindAllEnabledAPINodes(ctx, req.(*FindAllEnabledAPINodesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APINodeService_CountAllEnabledAPINodes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CountAllEnabledAPINodesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APINodeServiceServer).CountAllEnabledAPINodes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.APINodeService/CountAllEnabledAPINodes", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APINodeServiceServer).CountAllEnabledAPINodes(ctx, req.(*CountAllEnabledAPINodesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APINodeService_ListEnabledAPINodes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListEnabledAPINodesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APINodeServiceServer).ListEnabledAPINodes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.APINodeService/ListEnabledAPINodes", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APINodeServiceServer).ListEnabledAPINodes(ctx, req.(*ListEnabledAPINodesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _APINodeService_FindEnabledAPINode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FindEnabledAPINodeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(APINodeServiceServer).FindEnabledAPINode(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.APINodeService/FindEnabledAPINode", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(APINodeServiceServer).FindEnabledAPINode(ctx, req.(*FindEnabledAPINodeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _APINodeService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "pb.APINodeService", + HandlerType: (*APINodeServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "createAPINode", + Handler: _APINodeService_CreateAPINode_Handler, + }, + { + MethodName: "updateAPINode", + Handler: _APINodeService_UpdateAPINode_Handler, + }, + { + MethodName: "deleteAPINode", + Handler: _APINodeService_DeleteAPINode_Handler, + }, + { + MethodName: "findAllEnabledAPINodes", + Handler: _APINodeService_FindAllEnabledAPINodes_Handler, + }, + { + MethodName: "countAllEnabledAPINodes", + Handler: _APINodeService_CountAllEnabledAPINodes_Handler, + }, + { + MethodName: "listEnabledAPINodes", + Handler: _APINodeService_ListEnabledAPINodes_Handler, + }, + { + MethodName: "findEnabledAPINode", + Handler: _APINodeService_FindEnabledAPINode_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "service_api_node.proto", +} diff --git a/internal/rpc/pb/service_node.pb.go b/internal/rpc/pb/service_node.pb.go index 97e6fafe..be439cfa 100644 --- a/internal/rpc/pb/service_node.pb.go +++ b/internal/rpc/pb/service_node.pb.go @@ -227,17 +227,18 @@ func (x *CountAllEnabledNodesResponse) GetCount() int64 { } // 列出单页节点 -type ListEnabledNodesRequest struct { +type ListEnabledNodesMatchRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Offset int64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"` - Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` + Offset int64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"` + Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` + ClusterId int64 `protobuf:"varint,3,opt,name=clusterId,proto3" json:"clusterId,omitempty"` } -func (x *ListEnabledNodesRequest) Reset() { - *x = ListEnabledNodesRequest{} +func (x *ListEnabledNodesMatchRequest) Reset() { + *x = ListEnabledNodesMatchRequest{} if protoimpl.UnsafeEnabled { mi := &file_service_node_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -245,13 +246,13 @@ func (x *ListEnabledNodesRequest) Reset() { } } -func (x *ListEnabledNodesRequest) String() string { +func (x *ListEnabledNodesMatchRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListEnabledNodesRequest) ProtoMessage() {} +func (*ListEnabledNodesMatchRequest) ProtoMessage() {} -func (x *ListEnabledNodesRequest) ProtoReflect() protoreflect.Message { +func (x *ListEnabledNodesMatchRequest) ProtoReflect() protoreflect.Message { mi := &file_service_node_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -263,26 +264,33 @@ func (x *ListEnabledNodesRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListEnabledNodesRequest.ProtoReflect.Descriptor instead. -func (*ListEnabledNodesRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use ListEnabledNodesMatchRequest.ProtoReflect.Descriptor instead. +func (*ListEnabledNodesMatchRequest) Descriptor() ([]byte, []int) { return file_service_node_proto_rawDescGZIP(), []int{4} } -func (x *ListEnabledNodesRequest) GetOffset() int64 { +func (x *ListEnabledNodesMatchRequest) GetOffset() int64 { if x != nil { return x.Offset } return 0 } -func (x *ListEnabledNodesRequest) GetSize() int64 { +func (x *ListEnabledNodesMatchRequest) GetSize() int64 { if x != nil { return x.Size } return 0 } -type ListEnabledNodesResponse struct { +func (x *ListEnabledNodesMatchRequest) GetClusterId() int64 { + if x != nil { + return x.ClusterId + } + return 0 +} + +type ListEnabledNodesMatchResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -290,8 +298,8 @@ type ListEnabledNodesResponse struct { Nodes []*Node `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"` } -func (x *ListEnabledNodesResponse) Reset() { - *x = ListEnabledNodesResponse{} +func (x *ListEnabledNodesMatchResponse) Reset() { + *x = ListEnabledNodesMatchResponse{} if protoimpl.UnsafeEnabled { mi := &file_service_node_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -299,13 +307,13 @@ func (x *ListEnabledNodesResponse) Reset() { } } -func (x *ListEnabledNodesResponse) String() string { +func (x *ListEnabledNodesMatchResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ListEnabledNodesResponse) ProtoMessage() {} +func (*ListEnabledNodesMatchResponse) ProtoMessage() {} -func (x *ListEnabledNodesResponse) ProtoReflect() protoreflect.Message { +func (x *ListEnabledNodesMatchResponse) ProtoReflect() protoreflect.Message { mi := &file_service_node_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -317,12 +325,12 @@ func (x *ListEnabledNodesResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ListEnabledNodesResponse.ProtoReflect.Descriptor instead. -func (*ListEnabledNodesResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use ListEnabledNodesMatchResponse.ProtoReflect.Descriptor instead. +func (*ListEnabledNodesMatchResponse) Descriptor() ([]byte, []int) { return file_service_node_proto_rawDescGZIP(), []int{5} } -func (x *ListEnabledNodesResponse) GetNodes() []*Node { +func (x *ListEnabledNodesMatchResponse) GetNodes() []*Node { if x != nil { return x.Nodes } @@ -963,6 +971,195 @@ func (*SyncNodesVersionWithClusterResponse) Descriptor() ([]byte, []int) { return file_service_node_proto_rawDescGZIP(), []int{19} } +// 计算匹配的节点数量 +type CountAllEnabledNodesMatchRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClusterId int64 `protobuf:"varint,1,opt,name=clusterId,proto3" json:"clusterId,omitempty"` +} + +func (x *CountAllEnabledNodesMatchRequest) Reset() { + *x = CountAllEnabledNodesMatchRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_node_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CountAllEnabledNodesMatchRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CountAllEnabledNodesMatchRequest) ProtoMessage() {} + +func (x *CountAllEnabledNodesMatchRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_node_proto_msgTypes[20] + 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 CountAllEnabledNodesMatchRequest.ProtoReflect.Descriptor instead. +func (*CountAllEnabledNodesMatchRequest) Descriptor() ([]byte, []int) { + return file_service_node_proto_rawDescGZIP(), []int{20} +} + +func (x *CountAllEnabledNodesMatchRequest) GetClusterId() int64 { + if x != nil { + return x.ClusterId + } + return 0 +} + +type CountAllEnabledNodesMatchResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *CountAllEnabledNodesMatchResponse) Reset() { + *x = CountAllEnabledNodesMatchResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_node_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CountAllEnabledNodesMatchResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CountAllEnabledNodesMatchResponse) ProtoMessage() {} + +func (x *CountAllEnabledNodesMatchResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_node_proto_msgTypes[21] + 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 CountAllEnabledNodesMatchResponse.ProtoReflect.Descriptor instead. +func (*CountAllEnabledNodesMatchResponse) Descriptor() ([]byte, []int) { + return file_service_node_proto_rawDescGZIP(), []int{21} +} + +func (x *CountAllEnabledNodesMatchResponse) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +// 修改节点安装状态 +type UpdateNodeIsInstalledRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` + IsInstalled bool `protobuf:"varint,2,opt,name=isInstalled,proto3" json:"isInstalled,omitempty"` +} + +func (x *UpdateNodeIsInstalledRequest) Reset() { + *x = UpdateNodeIsInstalledRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_node_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateNodeIsInstalledRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateNodeIsInstalledRequest) ProtoMessage() {} + +func (x *UpdateNodeIsInstalledRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_node_proto_msgTypes[22] + 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 UpdateNodeIsInstalledRequest.ProtoReflect.Descriptor instead. +func (*UpdateNodeIsInstalledRequest) Descriptor() ([]byte, []int) { + return file_service_node_proto_rawDescGZIP(), []int{22} +} + +func (x *UpdateNodeIsInstalledRequest) GetNodeId() int64 { + if x != nil { + return x.NodeId + } + return 0 +} + +func (x *UpdateNodeIsInstalledRequest) GetIsInstalled() bool { + if x != nil { + return x.IsInstalled + } + return false +} + +type UpdateNodeIsInstalledResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *UpdateNodeIsInstalledResponse) Reset() { + *x = UpdateNodeIsInstalledResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_node_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateNodeIsInstalledResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateNodeIsInstalledResponse) ProtoMessage() {} + +func (x *UpdateNodeIsInstalledResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_node_proto_msgTypes[23] + 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 UpdateNodeIsInstalledResponse.ProtoReflect.Descriptor instead. +func (*UpdateNodeIsInstalledResponse) Descriptor() ([]byte, []int) { + return file_service_node_proto_rawDescGZIP(), []int{23} +} + var File_service_node_proto protoreflect.FileDescriptor var file_service_node_proto_rawDesc = []byte{ @@ -985,57 +1182,75 @@ var file_service_node_proto_rawDesc = []byte{ 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x22, 0x45, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, - 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, - 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, - 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x3a, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, - 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x05, 0x6e, - 0x6f, 0x64, 0x65, 0x73, 0x22, 0x2c, 0x0a, 0x12, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, - 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, - 0x64, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, - 0x49, 0x64, 0x22, 0x15, 0x0a, 0x13, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x82, 0x01, 0x0a, 0x11, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, - 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x05, 0x4c, 0x6f, 0x67, - 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, - 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x22, 0x14, - 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x0a, 0x16, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, - 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, - 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, - 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x22, 0x37, 0x0a, 0x17, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x1c, 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x22, - 0x1a, 0x0a, 0x18, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x3b, 0x0a, 0x19, 0x43, - 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x4a, 0x53, 0x4f, 0x4e, 0x22, 0x13, 0x0a, 0x11, 0x4e, 0x6f, 0x64, 0x65, - 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x14, 0x0a, - 0x12, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x51, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, - 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, - 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, - 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x22, 0x1a, 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x42, 0x0a, 0x22, 0x53, 0x79, 0x6e, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x57, 0x69, 0x74, 0x68, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, - 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x25, 0x0a, 0x23, 0x53, 0x79, 0x6e, 0x63, 0x4e, 0x6f, - 0x64, 0x65, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x57, 0x69, 0x74, 0x68, 0x43, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x8f, 0x06, + 0x74, 0x22, 0x68, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1c, 0x0a, + 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x3f, 0x0a, 0x1d, 0x4c, + 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x4d, + 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x05, + 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, + 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x22, 0x2c, 0x0a, 0x12, + 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x22, 0x15, 0x0a, 0x13, 0x44, 0x69, + 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x82, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, + 0x64, 0x12, 0x23, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, + 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x22, 0x14, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x0a, 0x16, + 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x22, 0x37, + 0x0a, 0x17, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x04, 0x6e, 0x6f, 0x64, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, + 0x65, 0x52, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x22, 0x1a, 0x0a, 0x18, 0x43, 0x6f, 0x6d, 0x70, 0x6f, + 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x22, 0x3b, 0x0a, 0x19, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x4e, 0x6f, + 0x64, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4a, 0x53, 0x4f, 0x4e, + 0x22, 0x13, 0x0a, 0x11, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x14, 0x0a, 0x12, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x51, 0x0a, 0x17, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x1e, + 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x22, 0x1a, + 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x42, 0x0a, 0x22, 0x53, 0x79, + 0x6e, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x57, 0x69, + 0x74, 0x68, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x25, + 0x0a, 0x23, 0x53, 0x79, 0x6e, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x57, 0x69, 0x74, 0x68, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x40, 0x0a, 0x20, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, + 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x4d, 0x61, 0x74, + 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6c, + 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x39, 0x0a, 0x21, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x4d, + 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x22, 0x58, 0x0a, 0x1c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, + 0x49, 0x73, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x69, 0x73, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0b, 0x69, 0x73, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x22, 0x1f, 0x0a, 0x1d, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x73, 0x49, 0x6e, 0x73, 0x74, + 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xe6, 0x07, 0x0a, 0x0b, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3b, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, @@ -1046,46 +1261,60 @@ var file_service_node_proto_rawDesc = []byte{ 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x10, 0x6c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x0b, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, - 0x6f, 0x64, 0x65, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, - 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x62, - 0x2e, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, - 0x64, 0x65, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, - 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x4a, 0x0a, 0x0f, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, - 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, - 0x11, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x4e, - 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x4e, 0x6f, 0x64, - 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x3f, 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x15, 0x2e, - 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, - 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, - 0x12, 0x4d, 0x0a, 0x10, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, - 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x6e, 0x0a, 0x1b, 0x73, 0x79, 0x6e, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x57, 0x69, 0x74, 0x68, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x26, - 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x57, 0x69, 0x74, 0x68, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x79, 0x6e, 0x63, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x68, 0x0a, 0x19, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, + 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x4d, 0x61, 0x74, + 0x63, 0x68, 0x12, 0x24, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, + 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x4d, 0x61, 0x74, 0x63, + 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, + 0x65, 0x73, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x5c, 0x0a, 0x15, 0x6c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, + 0x64, 0x65, 0x73, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x4d, 0x61, + 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x70, 0x62, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, + 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, + 0x0b, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x2e, 0x70, + 0x62, 0x2e, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, + 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, + 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x15, 0x2e, 0x70, 0x62, + 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, + 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x0f, 0x66, 0x69, + 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x2e, + 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, + 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x46, + 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x73, + 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1c, 0x2e, 0x70, 0x62, + 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x43, + 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, + 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, + 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, + 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0x4d, 0x0a, 0x10, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x2e, + 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6e, 0x0a, 0x1b, 0x73, 0x79, 0x6e, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x57, 0x69, 0x74, 0x68, - 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, - 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x26, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x79, 0x6e, + 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x57, 0x69, 0x74, + 0x68, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x27, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x57, 0x69, 0x74, 0x68, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x15, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x73, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, + 0x64, 0x12, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, + 0x65, 0x49, 0x73, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, + 0x6f, 0x64, 0x65, 0x49, 0x73, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1100,14 +1329,14 @@ func file_service_node_proto_rawDescGZIP() []byte { return file_service_node_proto_rawDescData } -var file_service_node_proto_msgTypes = make([]protoimpl.MessageInfo, 20) +var file_service_node_proto_msgTypes = make([]protoimpl.MessageInfo, 24) var file_service_node_proto_goTypes = []interface{}{ (*CreateNodeRequest)(nil), // 0: pb.CreateNodeRequest (*CreateNodeResponse)(nil), // 1: pb.CreateNodeResponse (*CountAllEnabledNodesRequest)(nil), // 2: pb.CountAllEnabledNodesRequest (*CountAllEnabledNodesResponse)(nil), // 3: pb.CountAllEnabledNodesResponse - (*ListEnabledNodesRequest)(nil), // 4: pb.ListEnabledNodesRequest - (*ListEnabledNodesResponse)(nil), // 5: pb.ListEnabledNodesResponse + (*ListEnabledNodesMatchRequest)(nil), // 4: pb.ListEnabledNodesMatchRequest + (*ListEnabledNodesMatchResponse)(nil), // 5: pb.ListEnabledNodesMatchResponse (*DisableNodeRequest)(nil), // 6: pb.DisableNodeRequest (*DisableNodeResponse)(nil), // 7: pb.DisableNodeResponse (*UpdateNodeRequest)(nil), // 8: pb.UpdateNodeRequest @@ -1122,36 +1351,44 @@ var file_service_node_proto_goTypes = []interface{}{ (*UpdateNodeStatusResponse)(nil), // 17: pb.UpdateNodeStatusResponse (*SyncNodesVersionWithClusterRequest)(nil), // 18: pb.SyncNodesVersionWithClusterRequest (*SyncNodesVersionWithClusterResponse)(nil), // 19: pb.SyncNodesVersionWithClusterResponse - (*NodeLogin)(nil), // 20: pb.NodeLogin - (*Node)(nil), // 21: pb.Node + (*CountAllEnabledNodesMatchRequest)(nil), // 20: pb.CountAllEnabledNodesMatchRequest + (*CountAllEnabledNodesMatchResponse)(nil), // 21: pb.CountAllEnabledNodesMatchResponse + (*UpdateNodeIsInstalledRequest)(nil), // 22: pb.UpdateNodeIsInstalledRequest + (*UpdateNodeIsInstalledResponse)(nil), // 23: pb.UpdateNodeIsInstalledResponse + (*NodeLogin)(nil), // 24: pb.NodeLogin + (*Node)(nil), // 25: pb.Node } var file_service_node_proto_depIdxs = []int32{ - 20, // 0: pb.CreateNodeRequest.Login:type_name -> pb.NodeLogin - 21, // 1: pb.ListEnabledNodesResponse.nodes:type_name -> pb.Node - 20, // 2: pb.UpdateNodeRequest.Login:type_name -> pb.NodeLogin - 21, // 3: pb.FindEnabledNodeResponse.node:type_name -> pb.Node + 24, // 0: pb.CreateNodeRequest.Login:type_name -> pb.NodeLogin + 25, // 1: pb.ListEnabledNodesMatchResponse.nodes:type_name -> pb.Node + 24, // 2: pb.UpdateNodeRequest.Login:type_name -> pb.NodeLogin + 25, // 3: pb.FindEnabledNodeResponse.node:type_name -> pb.Node 0, // 4: pb.NodeService.createNode:input_type -> pb.CreateNodeRequest 2, // 5: pb.NodeService.countAllEnabledNodes:input_type -> pb.CountAllEnabledNodesRequest - 4, // 6: pb.NodeService.listEnabledNodes:input_type -> pb.ListEnabledNodesRequest - 6, // 7: pb.NodeService.disableNode:input_type -> pb.DisableNodeRequest - 8, // 8: pb.NodeService.updateNode:input_type -> pb.UpdateNodeRequest - 10, // 9: pb.NodeService.findEnabledNode:input_type -> pb.FindEnabledNodeRequest - 12, // 10: pb.NodeService.composeNodeConfig:input_type -> pb.ComposeNodeConfigRequest - 14, // 11: pb.NodeService.nodeStream:input_type -> pb.NodeStreamRequest - 16, // 12: pb.NodeService.updateNodeStatus:input_type -> pb.UpdateNodeStatusRequest - 18, // 13: pb.NodeService.syncNodesVersionWithCluster:input_type -> pb.SyncNodesVersionWithClusterRequest - 1, // 14: pb.NodeService.createNode:output_type -> pb.CreateNodeResponse - 3, // 15: pb.NodeService.countAllEnabledNodes:output_type -> pb.CountAllEnabledNodesResponse - 5, // 16: pb.NodeService.listEnabledNodes:output_type -> pb.ListEnabledNodesResponse - 7, // 17: pb.NodeService.disableNode:output_type -> pb.DisableNodeResponse - 9, // 18: pb.NodeService.updateNode:output_type -> pb.UpdateNodeResponse - 11, // 19: pb.NodeService.findEnabledNode:output_type -> pb.FindEnabledNodeResponse - 13, // 20: pb.NodeService.composeNodeConfig:output_type -> pb.ComposeNodeConfigResponse - 15, // 21: pb.NodeService.nodeStream:output_type -> pb.NodeStreamResponse - 17, // 22: pb.NodeService.updateNodeStatus:output_type -> pb.UpdateNodeStatusResponse - 19, // 23: pb.NodeService.syncNodesVersionWithCluster:output_type -> pb.SyncNodesVersionWithClusterResponse - 14, // [14:24] is the sub-list for method output_type - 4, // [4:14] is the sub-list for method input_type + 20, // 6: pb.NodeService.countAllEnabledNodesMatch:input_type -> pb.CountAllEnabledNodesMatchRequest + 4, // 7: pb.NodeService.listEnabledNodesMatch:input_type -> pb.ListEnabledNodesMatchRequest + 6, // 8: pb.NodeService.disableNode:input_type -> pb.DisableNodeRequest + 8, // 9: pb.NodeService.updateNode:input_type -> pb.UpdateNodeRequest + 10, // 10: pb.NodeService.findEnabledNode:input_type -> pb.FindEnabledNodeRequest + 12, // 11: pb.NodeService.composeNodeConfig:input_type -> pb.ComposeNodeConfigRequest + 14, // 12: pb.NodeService.nodeStream:input_type -> pb.NodeStreamRequest + 16, // 13: pb.NodeService.updateNodeStatus:input_type -> pb.UpdateNodeStatusRequest + 18, // 14: pb.NodeService.syncNodesVersionWithCluster:input_type -> pb.SyncNodesVersionWithClusterRequest + 22, // 15: pb.NodeService.updateNodeIsInstalled:input_type -> pb.UpdateNodeIsInstalledRequest + 1, // 16: pb.NodeService.createNode:output_type -> pb.CreateNodeResponse + 3, // 17: pb.NodeService.countAllEnabledNodes:output_type -> pb.CountAllEnabledNodesResponse + 21, // 18: pb.NodeService.countAllEnabledNodesMatch:output_type -> pb.CountAllEnabledNodesMatchResponse + 5, // 19: pb.NodeService.listEnabledNodesMatch:output_type -> pb.ListEnabledNodesMatchResponse + 7, // 20: pb.NodeService.disableNode:output_type -> pb.DisableNodeResponse + 9, // 21: pb.NodeService.updateNode:output_type -> pb.UpdateNodeResponse + 11, // 22: pb.NodeService.findEnabledNode:output_type -> pb.FindEnabledNodeResponse + 13, // 23: pb.NodeService.composeNodeConfig:output_type -> pb.ComposeNodeConfigResponse + 15, // 24: pb.NodeService.nodeStream:output_type -> pb.NodeStreamResponse + 17, // 25: pb.NodeService.updateNodeStatus:output_type -> pb.UpdateNodeStatusResponse + 19, // 26: pb.NodeService.syncNodesVersionWithCluster:output_type -> pb.SyncNodesVersionWithClusterResponse + 23, // 27: pb.NodeService.updateNodeIsInstalled:output_type -> pb.UpdateNodeIsInstalledResponse + 16, // [16:28] is the sub-list for method output_type + 4, // [4:16] is the sub-list for method input_type 4, // [4:4] is the sub-list for extension type_name 4, // [4:4] is the sub-list for extension extendee 0, // [0:4] is the sub-list for field type_name @@ -1214,7 +1451,7 @@ func file_service_node_proto_init() { } } file_service_node_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListEnabledNodesRequest); i { + switch v := v.(*ListEnabledNodesMatchRequest); i { case 0: return &v.state case 1: @@ -1226,7 +1463,7 @@ func file_service_node_proto_init() { } } file_service_node_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListEnabledNodesResponse); i { + switch v := v.(*ListEnabledNodesMatchResponse); i { case 0: return &v.state case 1: @@ -1405,6 +1642,54 @@ func file_service_node_proto_init() { return nil } } + file_service_node_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CountAllEnabledNodesMatchRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_node_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CountAllEnabledNodesMatchResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_node_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateNodeIsInstalledRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_node_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateNodeIsInstalledResponse); 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{ @@ -1412,7 +1697,7 @@ func file_service_node_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_service_node_proto_rawDesc, NumEnums: 0, - NumMessages: 20, + NumMessages: 24, NumExtensions: 0, NumServices: 1, }, @@ -1442,8 +1727,10 @@ type NodeServiceClient interface { CreateNode(ctx context.Context, in *CreateNodeRequest, opts ...grpc.CallOption) (*CreateNodeResponse, error) // 节点数量 CountAllEnabledNodes(ctx context.Context, in *CountAllEnabledNodesRequest, opts ...grpc.CallOption) (*CountAllEnabledNodesResponse, error) + // 计算匹配的节点数量 + CountAllEnabledNodesMatch(ctx context.Context, in *CountAllEnabledNodesMatchRequest, opts ...grpc.CallOption) (*CountAllEnabledNodesMatchResponse, error) // 列出单页节点 - ListEnabledNodes(ctx context.Context, in *ListEnabledNodesRequest, opts ...grpc.CallOption) (*ListEnabledNodesResponse, error) + ListEnabledNodesMatch(ctx context.Context, in *ListEnabledNodesMatchRequest, opts ...grpc.CallOption) (*ListEnabledNodesMatchResponse, error) // 禁用节点 DisableNode(ctx context.Context, in *DisableNodeRequest, opts ...grpc.CallOption) (*DisableNodeResponse, error) // 修改节点 @@ -1458,6 +1745,8 @@ type NodeServiceClient interface { UpdateNodeStatus(ctx context.Context, in *UpdateNodeStatusRequest, opts ...grpc.CallOption) (*UpdateNodeStatusResponse, error) // 同步集群中的节点版本 SyncNodesVersionWithCluster(ctx context.Context, in *SyncNodesVersionWithClusterRequest, opts ...grpc.CallOption) (*SyncNodesVersionWithClusterResponse, error) + // 修改节点安装状态 + UpdateNodeIsInstalled(ctx context.Context, in *UpdateNodeIsInstalledRequest, opts ...grpc.CallOption) (*UpdateNodeIsInstalledResponse, error) } type nodeServiceClient struct { @@ -1486,9 +1775,18 @@ func (c *nodeServiceClient) CountAllEnabledNodes(ctx context.Context, in *CountA return out, nil } -func (c *nodeServiceClient) ListEnabledNodes(ctx context.Context, in *ListEnabledNodesRequest, opts ...grpc.CallOption) (*ListEnabledNodesResponse, error) { - out := new(ListEnabledNodesResponse) - err := c.cc.Invoke(ctx, "/pb.NodeService/listEnabledNodes", in, out, opts...) +func (c *nodeServiceClient) CountAllEnabledNodesMatch(ctx context.Context, in *CountAllEnabledNodesMatchRequest, opts ...grpc.CallOption) (*CountAllEnabledNodesMatchResponse, error) { + out := new(CountAllEnabledNodesMatchResponse) + err := c.cc.Invoke(ctx, "/pb.NodeService/countAllEnabledNodesMatch", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeServiceClient) ListEnabledNodesMatch(ctx context.Context, in *ListEnabledNodesMatchRequest, opts ...grpc.CallOption) (*ListEnabledNodesMatchResponse, error) { + out := new(ListEnabledNodesMatchResponse) + err := c.cc.Invoke(ctx, "/pb.NodeService/listEnabledNodesMatch", in, out, opts...) if err != nil { return nil, err } @@ -1580,14 +1878,25 @@ func (c *nodeServiceClient) SyncNodesVersionWithCluster(ctx context.Context, in return out, nil } +func (c *nodeServiceClient) UpdateNodeIsInstalled(ctx context.Context, in *UpdateNodeIsInstalledRequest, opts ...grpc.CallOption) (*UpdateNodeIsInstalledResponse, error) { + out := new(UpdateNodeIsInstalledResponse) + err := c.cc.Invoke(ctx, "/pb.NodeService/updateNodeIsInstalled", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // NodeServiceServer is the server API for NodeService service. type NodeServiceServer interface { // 创建节点 CreateNode(context.Context, *CreateNodeRequest) (*CreateNodeResponse, error) // 节点数量 CountAllEnabledNodes(context.Context, *CountAllEnabledNodesRequest) (*CountAllEnabledNodesResponse, error) + // 计算匹配的节点数量 + CountAllEnabledNodesMatch(context.Context, *CountAllEnabledNodesMatchRequest) (*CountAllEnabledNodesMatchResponse, error) // 列出单页节点 - ListEnabledNodes(context.Context, *ListEnabledNodesRequest) (*ListEnabledNodesResponse, error) + ListEnabledNodesMatch(context.Context, *ListEnabledNodesMatchRequest) (*ListEnabledNodesMatchResponse, error) // 禁用节点 DisableNode(context.Context, *DisableNodeRequest) (*DisableNodeResponse, error) // 修改节点 @@ -1602,6 +1911,8 @@ type NodeServiceServer interface { UpdateNodeStatus(context.Context, *UpdateNodeStatusRequest) (*UpdateNodeStatusResponse, error) // 同步集群中的节点版本 SyncNodesVersionWithCluster(context.Context, *SyncNodesVersionWithClusterRequest) (*SyncNodesVersionWithClusterResponse, error) + // 修改节点安装状态 + UpdateNodeIsInstalled(context.Context, *UpdateNodeIsInstalledRequest) (*UpdateNodeIsInstalledResponse, error) } // UnimplementedNodeServiceServer can be embedded to have forward compatible implementations. @@ -1614,8 +1925,11 @@ func (*UnimplementedNodeServiceServer) CreateNode(context.Context, *CreateNodeRe func (*UnimplementedNodeServiceServer) CountAllEnabledNodes(context.Context, *CountAllEnabledNodesRequest) (*CountAllEnabledNodesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CountAllEnabledNodes not implemented") } -func (*UnimplementedNodeServiceServer) ListEnabledNodes(context.Context, *ListEnabledNodesRequest) (*ListEnabledNodesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListEnabledNodes not implemented") +func (*UnimplementedNodeServiceServer) CountAllEnabledNodesMatch(context.Context, *CountAllEnabledNodesMatchRequest) (*CountAllEnabledNodesMatchResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CountAllEnabledNodesMatch not implemented") +} +func (*UnimplementedNodeServiceServer) ListEnabledNodesMatch(context.Context, *ListEnabledNodesMatchRequest) (*ListEnabledNodesMatchResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListEnabledNodesMatch not implemented") } func (*UnimplementedNodeServiceServer) DisableNode(context.Context, *DisableNodeRequest) (*DisableNodeResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DisableNode not implemented") @@ -1638,6 +1952,9 @@ func (*UnimplementedNodeServiceServer) UpdateNodeStatus(context.Context, *Update func (*UnimplementedNodeServiceServer) SyncNodesVersionWithCluster(context.Context, *SyncNodesVersionWithClusterRequest) (*SyncNodesVersionWithClusterResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SyncNodesVersionWithCluster not implemented") } +func (*UnimplementedNodeServiceServer) UpdateNodeIsInstalled(context.Context, *UpdateNodeIsInstalledRequest) (*UpdateNodeIsInstalledResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateNodeIsInstalled not implemented") +} func RegisterNodeServiceServer(s *grpc.Server, srv NodeServiceServer) { s.RegisterService(&_NodeService_serviceDesc, srv) @@ -1679,20 +1996,38 @@ func _NodeService_CountAllEnabledNodes_Handler(srv interface{}, ctx context.Cont return interceptor(ctx, in, info, handler) } -func _NodeService_ListEnabledNodes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListEnabledNodesRequest) +func _NodeService_CountAllEnabledNodesMatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CountAllEnabledNodesMatchRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(NodeServiceServer).ListEnabledNodes(ctx, in) + return srv.(NodeServiceServer).CountAllEnabledNodesMatch(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/pb.NodeService/ListEnabledNodes", + FullMethod: "/pb.NodeService/CountAllEnabledNodesMatch", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeServiceServer).ListEnabledNodes(ctx, req.(*ListEnabledNodesRequest)) + return srv.(NodeServiceServer).CountAllEnabledNodesMatch(ctx, req.(*CountAllEnabledNodesMatchRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NodeService_ListEnabledNodesMatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListEnabledNodesMatchRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeServiceServer).ListEnabledNodesMatch(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.NodeService/ListEnabledNodesMatch", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeServiceServer).ListEnabledNodesMatch(ctx, req.(*ListEnabledNodesMatchRequest)) } return interceptor(ctx, in, info, handler) } @@ -1831,6 +2166,24 @@ func _NodeService_SyncNodesVersionWithCluster_Handler(srv interface{}, ctx conte return interceptor(ctx, in, info, handler) } +func _NodeService_UpdateNodeIsInstalled_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateNodeIsInstalledRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeServiceServer).UpdateNodeIsInstalled(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.NodeService/UpdateNodeIsInstalled", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeServiceServer).UpdateNodeIsInstalled(ctx, req.(*UpdateNodeIsInstalledRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _NodeService_serviceDesc = grpc.ServiceDesc{ ServiceName: "pb.NodeService", HandlerType: (*NodeServiceServer)(nil), @@ -1844,8 +2197,12 @@ var _NodeService_serviceDesc = grpc.ServiceDesc{ Handler: _NodeService_CountAllEnabledNodes_Handler, }, { - MethodName: "listEnabledNodes", - Handler: _NodeService_ListEnabledNodes_Handler, + MethodName: "countAllEnabledNodesMatch", + Handler: _NodeService_CountAllEnabledNodesMatch_Handler, + }, + { + MethodName: "listEnabledNodesMatch", + Handler: _NodeService_ListEnabledNodesMatch_Handler, }, { MethodName: "disableNode", @@ -1871,6 +2228,10 @@ var _NodeService_serviceDesc = grpc.ServiceDesc{ MethodName: "syncNodesVersionWithCluster", Handler: _NodeService_SyncNodesVersionWithCluster_Handler, }, + { + MethodName: "updateNodeIsInstalled", + Handler: _NodeService_UpdateNodeIsInstalled_Handler, + }, }, Streams: []grpc.StreamDesc{ { diff --git a/internal/rpc/pb/service_node_cluster.pb.go b/internal/rpc/pb/service_node_cluster.pb.go index 58b373d0..6bfca315 100644 --- a/internal/rpc/pb/service_node_cluster.pb.go +++ b/internal/rpc/pb/service_node_cluster.pb.go @@ -116,14 +116,14 @@ func (x *FindAllEnabledNodeClustersResponse) GetClusters() []*NodeCluster { } // 获取变更的集群 -type FindAllChangedClustersRequest struct { +type FindAllChangedNodeClustersRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } -func (x *FindAllChangedClustersRequest) Reset() { - *x = FindAllChangedClustersRequest{} +func (x *FindAllChangedNodeClustersRequest) Reset() { + *x = FindAllChangedNodeClustersRequest{} if protoimpl.UnsafeEnabled { mi := &file_service_node_cluster_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -131,13 +131,13 @@ func (x *FindAllChangedClustersRequest) Reset() { } } -func (x *FindAllChangedClustersRequest) String() string { +func (x *FindAllChangedNodeClustersRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*FindAllChangedClustersRequest) ProtoMessage() {} +func (*FindAllChangedNodeClustersRequest) ProtoMessage() {} -func (x *FindAllChangedClustersRequest) ProtoReflect() protoreflect.Message { +func (x *FindAllChangedNodeClustersRequest) ProtoReflect() protoreflect.Message { mi := &file_service_node_cluster_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -149,12 +149,12 @@ func (x *FindAllChangedClustersRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use FindAllChangedClustersRequest.ProtoReflect.Descriptor instead. -func (*FindAllChangedClustersRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use FindAllChangedNodeClustersRequest.ProtoReflect.Descriptor instead. +func (*FindAllChangedNodeClustersRequest) Descriptor() ([]byte, []int) { return file_service_node_cluster_proto_rawDescGZIP(), []int{2} } -type FindAllChangedClustersResponse struct { +type FindAllChangedNodeClustersResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -162,8 +162,8 @@ type FindAllChangedClustersResponse struct { Clusters []*NodeCluster `protobuf:"bytes,1,rep,name=clusters,proto3" json:"clusters,omitempty"` } -func (x *FindAllChangedClustersResponse) Reset() { - *x = FindAllChangedClustersResponse{} +func (x *FindAllChangedNodeClustersResponse) Reset() { + *x = FindAllChangedNodeClustersResponse{} if protoimpl.UnsafeEnabled { mi := &file_service_node_cluster_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -171,13 +171,13 @@ func (x *FindAllChangedClustersResponse) Reset() { } } -func (x *FindAllChangedClustersResponse) String() string { +func (x *FindAllChangedNodeClustersResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*FindAllChangedClustersResponse) ProtoMessage() {} +func (*FindAllChangedNodeClustersResponse) ProtoMessage() {} -func (x *FindAllChangedClustersResponse) ProtoReflect() protoreflect.Message { +func (x *FindAllChangedNodeClustersResponse) ProtoReflect() protoreflect.Message { mi := &file_service_node_cluster_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -189,12 +189,603 @@ func (x *FindAllChangedClustersResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use FindAllChangedClustersResponse.ProtoReflect.Descriptor instead. -func (*FindAllChangedClustersResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use FindAllChangedNodeClustersResponse.ProtoReflect.Descriptor instead. +func (*FindAllChangedNodeClustersResponse) Descriptor() ([]byte, []int) { return file_service_node_cluster_proto_rawDescGZIP(), []int{3} } -func (x *FindAllChangedClustersResponse) GetClusters() []*NodeCluster { +func (x *FindAllChangedNodeClustersResponse) GetClusters() []*NodeCluster { + if x != nil { + return x.Clusters + } + return nil +} + +// 创建集群 +type CreateNodeClusterRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + GrantId int64 `protobuf:"varint,2,opt,name=grantId,proto3" json:"grantId,omitempty"` + InstallDir string `protobuf:"bytes,3,opt,name=installDir,proto3" json:"installDir,omitempty"` +} + +func (x *CreateNodeClusterRequest) Reset() { + *x = CreateNodeClusterRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_node_cluster_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateNodeClusterRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateNodeClusterRequest) ProtoMessage() {} + +func (x *CreateNodeClusterRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_node_cluster_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 CreateNodeClusterRequest.ProtoReflect.Descriptor instead. +func (*CreateNodeClusterRequest) Descriptor() ([]byte, []int) { + return file_service_node_cluster_proto_rawDescGZIP(), []int{4} +} + +func (x *CreateNodeClusterRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreateNodeClusterRequest) GetGrantId() int64 { + if x != nil { + return x.GrantId + } + return 0 +} + +func (x *CreateNodeClusterRequest) GetInstallDir() string { + if x != nil { + return x.InstallDir + } + return "" +} + +type CreateNodeClusterResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClusterId int64 `protobuf:"varint,1,opt,name=clusterId,proto3" json:"clusterId,omitempty"` +} + +func (x *CreateNodeClusterResponse) Reset() { + *x = CreateNodeClusterResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_node_cluster_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateNodeClusterResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateNodeClusterResponse) ProtoMessage() {} + +func (x *CreateNodeClusterResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_node_cluster_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 CreateNodeClusterResponse.ProtoReflect.Descriptor instead. +func (*CreateNodeClusterResponse) Descriptor() ([]byte, []int) { + return file_service_node_cluster_proto_rawDescGZIP(), []int{5} +} + +func (x *CreateNodeClusterResponse) GetClusterId() int64 { + if x != nil { + return x.ClusterId + } + return 0 +} + +// 修改集群 +type UpdateNodeClusterRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClusterId int64 `protobuf:"varint,1,opt,name=clusterId,proto3" json:"clusterId,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + GrantId int64 `protobuf:"varint,3,opt,name=grantId,proto3" json:"grantId,omitempty"` + InstallDir string `protobuf:"bytes,4,opt,name=installDir,proto3" json:"installDir,omitempty"` +} + +func (x *UpdateNodeClusterRequest) Reset() { + *x = UpdateNodeClusterRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_node_cluster_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateNodeClusterRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateNodeClusterRequest) ProtoMessage() {} + +func (x *UpdateNodeClusterRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_node_cluster_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 UpdateNodeClusterRequest.ProtoReflect.Descriptor instead. +func (*UpdateNodeClusterRequest) Descriptor() ([]byte, []int) { + return file_service_node_cluster_proto_rawDescGZIP(), []int{6} +} + +func (x *UpdateNodeClusterRequest) GetClusterId() int64 { + if x != nil { + return x.ClusterId + } + return 0 +} + +func (x *UpdateNodeClusterRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UpdateNodeClusterRequest) GetGrantId() int64 { + if x != nil { + return x.GrantId + } + return 0 +} + +func (x *UpdateNodeClusterRequest) GetInstallDir() string { + if x != nil { + return x.InstallDir + } + return "" +} + +type UpdateNodeClusterResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *UpdateNodeClusterResponse) Reset() { + *x = UpdateNodeClusterResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_node_cluster_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateNodeClusterResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateNodeClusterResponse) ProtoMessage() {} + +func (x *UpdateNodeClusterResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_node_cluster_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 UpdateNodeClusterResponse.ProtoReflect.Descriptor instead. +func (*UpdateNodeClusterResponse) Descriptor() ([]byte, []int) { + return file_service_node_cluster_proto_rawDescGZIP(), []int{7} +} + +// 禁用集群 +type DisableNodeClusterRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClusterId int64 `protobuf:"varint,1,opt,name=clusterId,proto3" json:"clusterId,omitempty"` +} + +func (x *DisableNodeClusterRequest) Reset() { + *x = DisableNodeClusterRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_node_cluster_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DisableNodeClusterRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DisableNodeClusterRequest) ProtoMessage() {} + +func (x *DisableNodeClusterRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_node_cluster_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 DisableNodeClusterRequest.ProtoReflect.Descriptor instead. +func (*DisableNodeClusterRequest) Descriptor() ([]byte, []int) { + return file_service_node_cluster_proto_rawDescGZIP(), []int{8} +} + +func (x *DisableNodeClusterRequest) GetClusterId() int64 { + if x != nil { + return x.ClusterId + } + return 0 +} + +type DisableNodeClusterResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DisableNodeClusterResponse) Reset() { + *x = DisableNodeClusterResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_node_cluster_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DisableNodeClusterResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DisableNodeClusterResponse) ProtoMessage() {} + +func (x *DisableNodeClusterResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_node_cluster_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 DisableNodeClusterResponse.ProtoReflect.Descriptor instead. +func (*DisableNodeClusterResponse) Descriptor() ([]byte, []int) { + return file_service_node_cluster_proto_rawDescGZIP(), []int{9} +} + +// 查找单个集群信息 +type FindEnabledNodeClusterRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClusterId int64 `protobuf:"varint,1,opt,name=clusterId,proto3" json:"clusterId,omitempty"` +} + +func (x *FindEnabledNodeClusterRequest) Reset() { + *x = FindEnabledNodeClusterRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_node_cluster_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindEnabledNodeClusterRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindEnabledNodeClusterRequest) ProtoMessage() {} + +func (x *FindEnabledNodeClusterRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_node_cluster_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 FindEnabledNodeClusterRequest.ProtoReflect.Descriptor instead. +func (*FindEnabledNodeClusterRequest) Descriptor() ([]byte, []int) { + return file_service_node_cluster_proto_rawDescGZIP(), []int{10} +} + +func (x *FindEnabledNodeClusterRequest) GetClusterId() int64 { + if x != nil { + return x.ClusterId + } + return 0 +} + +type FindEnabledNodeClusterResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Cluster *NodeCluster `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"` +} + +func (x *FindEnabledNodeClusterResponse) Reset() { + *x = FindEnabledNodeClusterResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_node_cluster_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindEnabledNodeClusterResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindEnabledNodeClusterResponse) ProtoMessage() {} + +func (x *FindEnabledNodeClusterResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_node_cluster_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 FindEnabledNodeClusterResponse.ProtoReflect.Descriptor instead. +func (*FindEnabledNodeClusterResponse) Descriptor() ([]byte, []int) { + return file_service_node_cluster_proto_rawDescGZIP(), []int{11} +} + +func (x *FindEnabledNodeClusterResponse) GetCluster() *NodeCluster { + if x != nil { + return x.Cluster + } + return nil +} + +// 计算所有集群数量 +type CountAllEnabledNodeClustersRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CountAllEnabledNodeClustersRequest) Reset() { + *x = CountAllEnabledNodeClustersRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_node_cluster_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CountAllEnabledNodeClustersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CountAllEnabledNodeClustersRequest) ProtoMessage() {} + +func (x *CountAllEnabledNodeClustersRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_node_cluster_proto_msgTypes[12] + 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 CountAllEnabledNodeClustersRequest.ProtoReflect.Descriptor instead. +func (*CountAllEnabledNodeClustersRequest) Descriptor() ([]byte, []int) { + return file_service_node_cluster_proto_rawDescGZIP(), []int{12} +} + +type CountAllEnabledNodeClustersResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *CountAllEnabledNodeClustersResponse) Reset() { + *x = CountAllEnabledNodeClustersResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_node_cluster_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CountAllEnabledNodeClustersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CountAllEnabledNodeClustersResponse) ProtoMessage() {} + +func (x *CountAllEnabledNodeClustersResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_node_cluster_proto_msgTypes[13] + 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 CountAllEnabledNodeClustersResponse.ProtoReflect.Descriptor instead. +func (*CountAllEnabledNodeClustersResponse) Descriptor() ([]byte, []int) { + return file_service_node_cluster_proto_rawDescGZIP(), []int{13} +} + +func (x *CountAllEnabledNodeClustersResponse) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +// 列出单页集群 +type ListEnabledNodeClustersRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Offset int64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"` + Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` +} + +func (x *ListEnabledNodeClustersRequest) Reset() { + *x = ListEnabledNodeClustersRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_node_cluster_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListEnabledNodeClustersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListEnabledNodeClustersRequest) ProtoMessage() {} + +func (x *ListEnabledNodeClustersRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_node_cluster_proto_msgTypes[14] + 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 ListEnabledNodeClustersRequest.ProtoReflect.Descriptor instead. +func (*ListEnabledNodeClustersRequest) Descriptor() ([]byte, []int) { + return file_service_node_cluster_proto_rawDescGZIP(), []int{14} +} + +func (x *ListEnabledNodeClustersRequest) GetOffset() int64 { + if x != nil { + return x.Offset + } + return 0 +} + +func (x *ListEnabledNodeClustersRequest) GetSize() int64 { + if x != nil { + return x.Size + } + return 0 +} + +type ListEnabledNodeClustersResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Clusters []*NodeCluster `protobuf:"bytes,1,rep,name=clusters,proto3" json:"clusters,omitempty"` +} + +func (x *ListEnabledNodeClustersResponse) Reset() { + *x = ListEnabledNodeClustersResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_node_cluster_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListEnabledNodeClustersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListEnabledNodeClustersResponse) ProtoMessage() {} + +func (x *ListEnabledNodeClustersResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_node_cluster_proto_msgTypes[15] + 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 ListEnabledNodeClustersResponse.ProtoReflect.Descriptor instead. +func (*ListEnabledNodeClustersResponse) Descriptor() ([]byte, []int) { + return file_service_node_cluster_proto_rawDescGZIP(), []int{15} +} + +func (x *ListEnabledNodeClustersResponse) GetClusters() []*NodeCluster { if x != nil { return x.Clusters } @@ -215,29 +806,116 @@ var file_service_node_cluster_proto_rawDesc = []byte{ 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x08, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x08, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x73, 0x22, 0x1f, 0x0a, 0x1d, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x43, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x64, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x22, 0x4d, 0x0a, 0x1e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x43, 0x68, - 0x61, 0x6e, 0x67, 0x65, 0x64, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x08, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, - 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x08, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x73, 0x32, 0xde, 0x01, 0x0a, 0x12, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x67, 0x0a, 0x16, 0x66, 0x69, 0x6e, - 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x73, 0x12, 0x25, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, - 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x70, 0x62, 0x2e, + 0x72, 0x73, 0x22, 0x23, 0x0a, 0x21, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x51, 0x0a, 0x22, 0x46, 0x69, 0x6e, 0x64, 0x41, + 0x6c, 0x6c, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, + 0x08, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, + 0x52, 0x08, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x22, 0x68, 0x0a, 0x18, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, + 0x61, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x67, 0x72, 0x61, + 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, + 0x69, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, + 0x6c, 0x44, 0x69, 0x72, 0x22, 0x39, 0x0a, 0x19, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, + 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, + 0x86, 0x01, 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, + 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, + 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x6e, 0x73, 0x74, + 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x6e, + 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x22, 0x1b, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x39, 0x0a, 0x19, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, + 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, + 0x22, 0x1c, 0x0a, 0x1a, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, + 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, + 0x0a, 0x1d, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, + 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x22, 0x4b, 0x0a, + 0x1e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, + 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x29, 0x0a, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, + 0x72, 0x52, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x22, 0x24, 0x0a, 0x22, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, + 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x22, 0x3b, 0x0a, 0x23, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x4c, 0x0a, + 0x1e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, + 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x4e, 0x0a, 0x1f, 0x4c, + 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, + 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, + 0x0a, 0x08, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, + 0x72, 0x52, 0x08, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x32, 0x9c, 0x06, 0x0a, 0x12, + 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x50, 0x0a, 0x11, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, + 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x11, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, + 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x12, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, + 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x1d, 0x2e, 0x70, + 0x62, 0x2e, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x62, + 0x2e, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, + 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x16, 0x66, + 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, + 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x21, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, + 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, + 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6b, 0x0a, 0x1a, + 0x66, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, + 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x12, 0x25, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, - 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x16, 0x66, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x43, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x64, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x12, 0x21, 0x2e, 0x70, - 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, - 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x22, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x43, 0x68, 0x61, 0x6e, - 0x67, 0x65, 0x64, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x26, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6b, 0x0a, 0x1a, 0x66, 0x69, 0x6e, + 0x64, 0x41, 0x6c, 0x6c, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, + 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x12, 0x25, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, + 0x64, 0x41, 0x6c, 0x6c, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, + 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, + 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x43, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6e, 0x0a, 0x1b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, + 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x73, 0x12, 0x26, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, + 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, + 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x62, 0x0a, 0x17, 0x6c, 0x69, 0x73, 0x74, 0x45, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, + 0x73, 0x12, 0x22, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, + 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, + 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -252,26 +930,52 @@ func file_service_node_cluster_proto_rawDescGZIP() []byte { return file_service_node_cluster_proto_rawDescData } -var file_service_node_cluster_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_service_node_cluster_proto_msgTypes = make([]protoimpl.MessageInfo, 16) var file_service_node_cluster_proto_goTypes = []interface{}{ - (*FindAllEnabledNodeClustersRequest)(nil), // 0: pb.FindAllEnabledNodeClustersRequest - (*FindAllEnabledNodeClustersResponse)(nil), // 1: pb.FindAllEnabledNodeClustersResponse - (*FindAllChangedClustersRequest)(nil), // 2: pb.FindAllChangedClustersRequest - (*FindAllChangedClustersResponse)(nil), // 3: pb.FindAllChangedClustersResponse - (*NodeCluster)(nil), // 4: pb.NodeCluster + (*FindAllEnabledNodeClustersRequest)(nil), // 0: pb.FindAllEnabledNodeClustersRequest + (*FindAllEnabledNodeClustersResponse)(nil), // 1: pb.FindAllEnabledNodeClustersResponse + (*FindAllChangedNodeClustersRequest)(nil), // 2: pb.FindAllChangedNodeClustersRequest + (*FindAllChangedNodeClustersResponse)(nil), // 3: pb.FindAllChangedNodeClustersResponse + (*CreateNodeClusterRequest)(nil), // 4: pb.CreateNodeClusterRequest + (*CreateNodeClusterResponse)(nil), // 5: pb.CreateNodeClusterResponse + (*UpdateNodeClusterRequest)(nil), // 6: pb.UpdateNodeClusterRequest + (*UpdateNodeClusterResponse)(nil), // 7: pb.UpdateNodeClusterResponse + (*DisableNodeClusterRequest)(nil), // 8: pb.DisableNodeClusterRequest + (*DisableNodeClusterResponse)(nil), // 9: pb.DisableNodeClusterResponse + (*FindEnabledNodeClusterRequest)(nil), // 10: pb.FindEnabledNodeClusterRequest + (*FindEnabledNodeClusterResponse)(nil), // 11: pb.FindEnabledNodeClusterResponse + (*CountAllEnabledNodeClustersRequest)(nil), // 12: pb.CountAllEnabledNodeClustersRequest + (*CountAllEnabledNodeClustersResponse)(nil), // 13: pb.CountAllEnabledNodeClustersResponse + (*ListEnabledNodeClustersRequest)(nil), // 14: pb.ListEnabledNodeClustersRequest + (*ListEnabledNodeClustersResponse)(nil), // 15: pb.ListEnabledNodeClustersResponse + (*NodeCluster)(nil), // 16: pb.NodeCluster } var file_service_node_cluster_proto_depIdxs = []int32{ - 4, // 0: pb.FindAllEnabledNodeClustersResponse.clusters:type_name -> pb.NodeCluster - 4, // 1: pb.FindAllChangedClustersResponse.clusters:type_name -> pb.NodeCluster - 0, // 2: pb.NodeClusterService.findAllEnabledClusters:input_type -> pb.FindAllEnabledNodeClustersRequest - 2, // 3: pb.NodeClusterService.findAllChangedClusters:input_type -> pb.FindAllChangedClustersRequest - 1, // 4: pb.NodeClusterService.findAllEnabledClusters:output_type -> pb.FindAllEnabledNodeClustersResponse - 3, // 5: pb.NodeClusterService.findAllChangedClusters:output_type -> pb.FindAllChangedClustersResponse - 4, // [4:6] is the sub-list for method output_type - 2, // [2:4] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 16, // 0: pb.FindAllEnabledNodeClustersResponse.clusters:type_name -> pb.NodeCluster + 16, // 1: pb.FindAllChangedNodeClustersResponse.clusters:type_name -> pb.NodeCluster + 16, // 2: pb.FindEnabledNodeClusterResponse.cluster:type_name -> pb.NodeCluster + 16, // 3: pb.ListEnabledNodeClustersResponse.clusters:type_name -> pb.NodeCluster + 4, // 4: pb.NodeClusterService.createNodeCluster:input_type -> pb.CreateNodeClusterRequest + 6, // 5: pb.NodeClusterService.updateNodeCluster:input_type -> pb.UpdateNodeClusterRequest + 8, // 6: pb.NodeClusterService.disableNodeCluster:input_type -> pb.DisableNodeClusterRequest + 10, // 7: pb.NodeClusterService.findEnabledNodeCluster:input_type -> pb.FindEnabledNodeClusterRequest + 0, // 8: pb.NodeClusterService.findAllEnabledNodeClusters:input_type -> pb.FindAllEnabledNodeClustersRequest + 2, // 9: pb.NodeClusterService.findAllChangedNodeClusters:input_type -> pb.FindAllChangedNodeClustersRequest + 12, // 10: pb.NodeClusterService.countAllEnabledNodeClusters:input_type -> pb.CountAllEnabledNodeClustersRequest + 14, // 11: pb.NodeClusterService.listEnabledNodeClusters:input_type -> pb.ListEnabledNodeClustersRequest + 5, // 12: pb.NodeClusterService.createNodeCluster:output_type -> pb.CreateNodeClusterResponse + 7, // 13: pb.NodeClusterService.updateNodeCluster:output_type -> pb.UpdateNodeClusterResponse + 9, // 14: pb.NodeClusterService.disableNodeCluster:output_type -> pb.DisableNodeClusterResponse + 11, // 15: pb.NodeClusterService.findEnabledNodeCluster:output_type -> pb.FindEnabledNodeClusterResponse + 1, // 16: pb.NodeClusterService.findAllEnabledNodeClusters:output_type -> pb.FindAllEnabledNodeClustersResponse + 3, // 17: pb.NodeClusterService.findAllChangedNodeClusters:output_type -> pb.FindAllChangedNodeClustersResponse + 13, // 18: pb.NodeClusterService.countAllEnabledNodeClusters:output_type -> pb.CountAllEnabledNodeClustersResponse + 15, // 19: pb.NodeClusterService.listEnabledNodeClusters:output_type -> pb.ListEnabledNodeClustersResponse + 12, // [12:20] is the sub-list for method output_type + 4, // [4:12] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_service_node_cluster_proto_init() } @@ -306,7 +1010,7 @@ func file_service_node_cluster_proto_init() { } } file_service_node_cluster_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindAllChangedClustersRequest); i { + switch v := v.(*FindAllChangedNodeClustersRequest); i { case 0: return &v.state case 1: @@ -318,7 +1022,151 @@ func file_service_node_cluster_proto_init() { } } file_service_node_cluster_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FindAllChangedClustersResponse); i { + switch v := v.(*FindAllChangedNodeClustersResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_node_cluster_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateNodeClusterRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_node_cluster_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateNodeClusterResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_node_cluster_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateNodeClusterRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_node_cluster_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateNodeClusterResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_node_cluster_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DisableNodeClusterRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_node_cluster_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DisableNodeClusterResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_node_cluster_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindEnabledNodeClusterRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_node_cluster_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindEnabledNodeClusterResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_node_cluster_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CountAllEnabledNodeClustersRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_node_cluster_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CountAllEnabledNodeClustersResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_node_cluster_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListEnabledNodeClustersRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_node_cluster_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListEnabledNodeClustersResponse); i { case 0: return &v.state case 1: @@ -336,7 +1184,7 @@ func file_service_node_cluster_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_service_node_cluster_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 16, NumExtensions: 0, NumServices: 1, }, @@ -362,10 +1210,22 @@ const _ = grpc.SupportPackageIsVersion6 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type NodeClusterServiceClient interface { + // 创建集群 + CreateNodeCluster(ctx context.Context, in *CreateNodeClusterRequest, opts ...grpc.CallOption) (*CreateNodeClusterResponse, error) + // 修改集群 + UpdateNodeCluster(ctx context.Context, in *UpdateNodeClusterRequest, opts ...grpc.CallOption) (*UpdateNodeClusterResponse, error) + // 禁用集群 + DisableNodeCluster(ctx context.Context, in *DisableNodeClusterRequest, opts ...grpc.CallOption) (*DisableNodeClusterResponse, error) + // 查找单个集群信息 + FindEnabledNodeCluster(ctx context.Context, in *FindEnabledNodeClusterRequest, opts ...grpc.CallOption) (*FindEnabledNodeClusterResponse, error) // 获取所有集群的信息 - FindAllEnabledClusters(ctx context.Context, in *FindAllEnabledNodeClustersRequest, opts ...grpc.CallOption) (*FindAllEnabledNodeClustersResponse, error) + FindAllEnabledNodeClusters(ctx context.Context, in *FindAllEnabledNodeClustersRequest, opts ...grpc.CallOption) (*FindAllEnabledNodeClustersResponse, error) // 获取变更的集群 - FindAllChangedClusters(ctx context.Context, in *FindAllChangedClustersRequest, opts ...grpc.CallOption) (*FindAllChangedClustersResponse, error) + FindAllChangedNodeClusters(ctx context.Context, in *FindAllChangedNodeClustersRequest, opts ...grpc.CallOption) (*FindAllChangedNodeClustersResponse, error) + // 计算所有集群数量 + CountAllEnabledNodeClusters(ctx context.Context, in *CountAllEnabledNodeClustersRequest, opts ...grpc.CallOption) (*CountAllEnabledNodeClustersResponse, error) + // 列出单页集群 + ListEnabledNodeClusters(ctx context.Context, in *ListEnabledNodeClustersRequest, opts ...grpc.CallOption) (*ListEnabledNodeClustersResponse, error) } type nodeClusterServiceClient struct { @@ -376,18 +1236,72 @@ func NewNodeClusterServiceClient(cc grpc.ClientConnInterface) NodeClusterService return &nodeClusterServiceClient{cc} } -func (c *nodeClusterServiceClient) FindAllEnabledClusters(ctx context.Context, in *FindAllEnabledNodeClustersRequest, opts ...grpc.CallOption) (*FindAllEnabledNodeClustersResponse, error) { - out := new(FindAllEnabledNodeClustersResponse) - err := c.cc.Invoke(ctx, "/pb.NodeClusterService/findAllEnabledClusters", in, out, opts...) +func (c *nodeClusterServiceClient) CreateNodeCluster(ctx context.Context, in *CreateNodeClusterRequest, opts ...grpc.CallOption) (*CreateNodeClusterResponse, error) { + out := new(CreateNodeClusterResponse) + err := c.cc.Invoke(ctx, "/pb.NodeClusterService/createNodeCluster", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *nodeClusterServiceClient) FindAllChangedClusters(ctx context.Context, in *FindAllChangedClustersRequest, opts ...grpc.CallOption) (*FindAllChangedClustersResponse, error) { - out := new(FindAllChangedClustersResponse) - err := c.cc.Invoke(ctx, "/pb.NodeClusterService/findAllChangedClusters", in, out, opts...) +func (c *nodeClusterServiceClient) UpdateNodeCluster(ctx context.Context, in *UpdateNodeClusterRequest, opts ...grpc.CallOption) (*UpdateNodeClusterResponse, error) { + out := new(UpdateNodeClusterResponse) + err := c.cc.Invoke(ctx, "/pb.NodeClusterService/updateNodeCluster", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeClusterServiceClient) DisableNodeCluster(ctx context.Context, in *DisableNodeClusterRequest, opts ...grpc.CallOption) (*DisableNodeClusterResponse, error) { + out := new(DisableNodeClusterResponse) + err := c.cc.Invoke(ctx, "/pb.NodeClusterService/disableNodeCluster", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeClusterServiceClient) FindEnabledNodeCluster(ctx context.Context, in *FindEnabledNodeClusterRequest, opts ...grpc.CallOption) (*FindEnabledNodeClusterResponse, error) { + out := new(FindEnabledNodeClusterResponse) + err := c.cc.Invoke(ctx, "/pb.NodeClusterService/findEnabledNodeCluster", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeClusterServiceClient) FindAllEnabledNodeClusters(ctx context.Context, in *FindAllEnabledNodeClustersRequest, opts ...grpc.CallOption) (*FindAllEnabledNodeClustersResponse, error) { + out := new(FindAllEnabledNodeClustersResponse) + err := c.cc.Invoke(ctx, "/pb.NodeClusterService/findAllEnabledNodeClusters", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeClusterServiceClient) FindAllChangedNodeClusters(ctx context.Context, in *FindAllChangedNodeClustersRequest, opts ...grpc.CallOption) (*FindAllChangedNodeClustersResponse, error) { + out := new(FindAllChangedNodeClustersResponse) + err := c.cc.Invoke(ctx, "/pb.NodeClusterService/findAllChangedNodeClusters", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeClusterServiceClient) CountAllEnabledNodeClusters(ctx context.Context, in *CountAllEnabledNodeClustersRequest, opts ...grpc.CallOption) (*CountAllEnabledNodeClustersResponse, error) { + out := new(CountAllEnabledNodeClustersResponse) + err := c.cc.Invoke(ctx, "/pb.NodeClusterService/countAllEnabledNodeClusters", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeClusterServiceClient) ListEnabledNodeClusters(ctx context.Context, in *ListEnabledNodeClustersRequest, opts ...grpc.CallOption) (*ListEnabledNodeClustersResponse, error) { + out := new(ListEnabledNodeClustersResponse) + err := c.cc.Invoke(ctx, "/pb.NodeClusterService/listEnabledNodeClusters", in, out, opts...) if err != nil { return nil, err } @@ -396,59 +1310,197 @@ func (c *nodeClusterServiceClient) FindAllChangedClusters(ctx context.Context, i // NodeClusterServiceServer is the server API for NodeClusterService service. type NodeClusterServiceServer interface { + // 创建集群 + CreateNodeCluster(context.Context, *CreateNodeClusterRequest) (*CreateNodeClusterResponse, error) + // 修改集群 + UpdateNodeCluster(context.Context, *UpdateNodeClusterRequest) (*UpdateNodeClusterResponse, error) + // 禁用集群 + DisableNodeCluster(context.Context, *DisableNodeClusterRequest) (*DisableNodeClusterResponse, error) + // 查找单个集群信息 + FindEnabledNodeCluster(context.Context, *FindEnabledNodeClusterRequest) (*FindEnabledNodeClusterResponse, error) // 获取所有集群的信息 - FindAllEnabledClusters(context.Context, *FindAllEnabledNodeClustersRequest) (*FindAllEnabledNodeClustersResponse, error) + FindAllEnabledNodeClusters(context.Context, *FindAllEnabledNodeClustersRequest) (*FindAllEnabledNodeClustersResponse, error) // 获取变更的集群 - FindAllChangedClusters(context.Context, *FindAllChangedClustersRequest) (*FindAllChangedClustersResponse, error) + FindAllChangedNodeClusters(context.Context, *FindAllChangedNodeClustersRequest) (*FindAllChangedNodeClustersResponse, error) + // 计算所有集群数量 + CountAllEnabledNodeClusters(context.Context, *CountAllEnabledNodeClustersRequest) (*CountAllEnabledNodeClustersResponse, error) + // 列出单页集群 + ListEnabledNodeClusters(context.Context, *ListEnabledNodeClustersRequest) (*ListEnabledNodeClustersResponse, error) } // UnimplementedNodeClusterServiceServer can be embedded to have forward compatible implementations. type UnimplementedNodeClusterServiceServer struct { } -func (*UnimplementedNodeClusterServiceServer) FindAllEnabledClusters(context.Context, *FindAllEnabledNodeClustersRequest) (*FindAllEnabledNodeClustersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FindAllEnabledClusters not implemented") +func (*UnimplementedNodeClusterServiceServer) CreateNodeCluster(context.Context, *CreateNodeClusterRequest) (*CreateNodeClusterResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateNodeCluster not implemented") } -func (*UnimplementedNodeClusterServiceServer) FindAllChangedClusters(context.Context, *FindAllChangedClustersRequest) (*FindAllChangedClustersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FindAllChangedClusters not implemented") +func (*UnimplementedNodeClusterServiceServer) UpdateNodeCluster(context.Context, *UpdateNodeClusterRequest) (*UpdateNodeClusterResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateNodeCluster not implemented") +} +func (*UnimplementedNodeClusterServiceServer) DisableNodeCluster(context.Context, *DisableNodeClusterRequest) (*DisableNodeClusterResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DisableNodeCluster not implemented") +} +func (*UnimplementedNodeClusterServiceServer) FindEnabledNodeCluster(context.Context, *FindEnabledNodeClusterRequest) (*FindEnabledNodeClusterResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FindEnabledNodeCluster not implemented") +} +func (*UnimplementedNodeClusterServiceServer) FindAllEnabledNodeClusters(context.Context, *FindAllEnabledNodeClustersRequest) (*FindAllEnabledNodeClustersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FindAllEnabledNodeClusters not implemented") +} +func (*UnimplementedNodeClusterServiceServer) FindAllChangedNodeClusters(context.Context, *FindAllChangedNodeClustersRequest) (*FindAllChangedNodeClustersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FindAllChangedNodeClusters not implemented") +} +func (*UnimplementedNodeClusterServiceServer) CountAllEnabledNodeClusters(context.Context, *CountAllEnabledNodeClustersRequest) (*CountAllEnabledNodeClustersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CountAllEnabledNodeClusters not implemented") +} +func (*UnimplementedNodeClusterServiceServer) ListEnabledNodeClusters(context.Context, *ListEnabledNodeClustersRequest) (*ListEnabledNodeClustersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListEnabledNodeClusters not implemented") } func RegisterNodeClusterServiceServer(s *grpc.Server, srv NodeClusterServiceServer) { s.RegisterService(&_NodeClusterService_serviceDesc, srv) } -func _NodeClusterService_FindAllEnabledClusters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _NodeClusterService_CreateNodeCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateNodeClusterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeClusterServiceServer).CreateNodeCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.NodeClusterService/CreateNodeCluster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeClusterServiceServer).CreateNodeCluster(ctx, req.(*CreateNodeClusterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NodeClusterService_UpdateNodeCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateNodeClusterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeClusterServiceServer).UpdateNodeCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.NodeClusterService/UpdateNodeCluster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeClusterServiceServer).UpdateNodeCluster(ctx, req.(*UpdateNodeClusterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NodeClusterService_DisableNodeCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DisableNodeClusterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeClusterServiceServer).DisableNodeCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.NodeClusterService/DisableNodeCluster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeClusterServiceServer).DisableNodeCluster(ctx, req.(*DisableNodeClusterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NodeClusterService_FindEnabledNodeCluster_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FindEnabledNodeClusterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeClusterServiceServer).FindEnabledNodeCluster(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.NodeClusterService/FindEnabledNodeCluster", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeClusterServiceServer).FindEnabledNodeCluster(ctx, req.(*FindEnabledNodeClusterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NodeClusterService_FindAllEnabledNodeClusters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(FindAllEnabledNodeClustersRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(NodeClusterServiceServer).FindAllEnabledClusters(ctx, in) + return srv.(NodeClusterServiceServer).FindAllEnabledNodeClusters(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/pb.NodeClusterService/FindAllEnabledClusters", + FullMethod: "/pb.NodeClusterService/FindAllEnabledNodeClusters", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeClusterServiceServer).FindAllEnabledClusters(ctx, req.(*FindAllEnabledNodeClustersRequest)) + return srv.(NodeClusterServiceServer).FindAllEnabledNodeClusters(ctx, req.(*FindAllEnabledNodeClustersRequest)) } return interceptor(ctx, in, info, handler) } -func _NodeClusterService_FindAllChangedClusters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FindAllChangedClustersRequest) +func _NodeClusterService_FindAllChangedNodeClusters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FindAllChangedNodeClustersRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(NodeClusterServiceServer).FindAllChangedClusters(ctx, in) + return srv.(NodeClusterServiceServer).FindAllChangedNodeClusters(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/pb.NodeClusterService/FindAllChangedClusters", + FullMethod: "/pb.NodeClusterService/FindAllChangedNodeClusters", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeClusterServiceServer).FindAllChangedClusters(ctx, req.(*FindAllChangedClustersRequest)) + return srv.(NodeClusterServiceServer).FindAllChangedNodeClusters(ctx, req.(*FindAllChangedNodeClustersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NodeClusterService_CountAllEnabledNodeClusters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CountAllEnabledNodeClustersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeClusterServiceServer).CountAllEnabledNodeClusters(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.NodeClusterService/CountAllEnabledNodeClusters", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeClusterServiceServer).CountAllEnabledNodeClusters(ctx, req.(*CountAllEnabledNodeClustersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NodeClusterService_ListEnabledNodeClusters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListEnabledNodeClustersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeClusterServiceServer).ListEnabledNodeClusters(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.NodeClusterService/ListEnabledNodeClusters", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeClusterServiceServer).ListEnabledNodeClusters(ctx, req.(*ListEnabledNodeClustersRequest)) } return interceptor(ctx, in, info, handler) } @@ -458,12 +1510,36 @@ var _NodeClusterService_serviceDesc = grpc.ServiceDesc{ HandlerType: (*NodeClusterServiceServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "findAllEnabledClusters", - Handler: _NodeClusterService_FindAllEnabledClusters_Handler, + MethodName: "createNodeCluster", + Handler: _NodeClusterService_CreateNodeCluster_Handler, }, { - MethodName: "findAllChangedClusters", - Handler: _NodeClusterService_FindAllChangedClusters_Handler, + MethodName: "updateNodeCluster", + Handler: _NodeClusterService_UpdateNodeCluster_Handler, + }, + { + MethodName: "disableNodeCluster", + Handler: _NodeClusterService_DisableNodeCluster_Handler, + }, + { + MethodName: "findEnabledNodeCluster", + Handler: _NodeClusterService_FindEnabledNodeCluster_Handler, + }, + { + MethodName: "findAllEnabledNodeClusters", + Handler: _NodeClusterService_FindAllEnabledNodeClusters_Handler, + }, + { + MethodName: "findAllChangedNodeClusters", + Handler: _NodeClusterService_FindAllChangedNodeClusters_Handler, + }, + { + MethodName: "countAllEnabledNodeClusters", + Handler: _NodeClusterService_CountAllEnabledNodeClusters_Handler, + }, + { + MethodName: "listEnabledNodeClusters", + Handler: _NodeClusterService_ListEnabledNodeClusters_Handler, }, }, Streams: []grpc.StreamDesc{}, diff --git a/internal/rpc/protos/service_api_node.proto b/internal/rpc/protos/service_api_node.proto new file mode 100644 index 00000000..2140bd76 --- /dev/null +++ b/internal/rpc/protos/service_api_node.proto @@ -0,0 +1,99 @@ +syntax = "proto3"; +option go_package = "./pb"; + +package pb; +import "model_api_node.proto"; + +service APINodeService { + // 创建API节点 + rpc createAPINode (CreateAPINodeRequest) returns (CreateAPINodeResponse); + + // 修改API节点 + rpc updateAPINode (UpdateAPINodeRequest) returns (UpdateAPINodeResponse); + + // 删除API节点 + rpc deleteAPINode (DeleteAPINodeRequest) returns (DeleteAPINodeResponse); + + // 列出所有可用API节点 + rpc findAllEnabledAPINodes (FindAllEnabledAPINodesRequest) returns (FindAllEnabledAPINodesResponse); + + // 计算API节点数量 + rpc countAllEnabledAPINodes (CountAllEnabledAPINodesRequest) returns (CountAllEnabledAPINodesResponse); + + // 列出单页的API节点 + rpc listEnabledAPINodes (ListEnabledAPINodesRequest) returns (ListEnabledAPINodesResponse); + + // 根据ID查找节点 + rpc findEnabledAPINode (FindEnabledAPINodeRequest) returns (FindEnabledAPINodeResponse); +} + +// 创建API节点 +message CreateAPINodeRequest { + string name = 1; + string description = 2; + string host = 3; + int32 port = 4; +} + +message CreateAPINodeResponse { + int64 nodeId = 1; +} + +// 修改API节点 +message UpdateAPINodeRequest { + int64 nodeId = 1; + string name = 2; + string description = 3; + string host = 4; + int32 port = 5; +} + +message UpdateAPINodeResponse { + +} + +// 删除API节点 +message DeleteAPINodeRequest { + int64 nodeId = 1; +} + +message DeleteAPINodeResponse { + +} + +// 列出所有可用API节点 +message FindAllEnabledAPINodesRequest { + +} + +message FindAllEnabledAPINodesResponse { + repeated APINode nodes = 1; +} + +// 计算API节点数量 +message CountAllEnabledAPINodesRequest { + +} + +message CountAllEnabledAPINodesResponse { + int64 count = 1; +} + +// 列出单页的API节点 +message ListEnabledAPINodesRequest { + int64 offset = 1; + int64 size = 2; +} + +message ListEnabledAPINodesResponse { + repeated APINode nodes = 1; +} + +// 根据ID查找节点 +message FindEnabledAPINodeRequest { + int64 nodeId = 1; +} + +message FindEnabledAPINodeResponse { + APINode node = 1; +} \ No newline at end of file diff --git a/internal/rpc/protos/service_node.proto b/internal/rpc/protos/service_node.proto index 701dd07d..b4662ffa 100644 --- a/internal/rpc/protos/service_node.proto +++ b/internal/rpc/protos/service_node.proto @@ -12,8 +12,11 @@ service NodeService { // 节点数量 rpc countAllEnabledNodes (CountAllEnabledNodesRequest) returns (CountAllEnabledNodesResponse); + // 计算匹配的节点数量 + rpc countAllEnabledNodesMatch (CountAllEnabledNodesMatchRequest) returns (CountAllEnabledNodesMatchResponse); + // 列出单页节点 - rpc listEnabledNodes (ListEnabledNodesRequest) returns (ListEnabledNodesResponse); + rpc listEnabledNodesMatch (ListEnabledNodesMatchRequest) returns (ListEnabledNodesMatchResponse); // 禁用节点 rpc disableNode (DisableNodeRequest) returns (DisableNodeResponse); @@ -35,6 +38,9 @@ service NodeService { // 同步集群中的节点版本 rpc syncNodesVersionWithCluster (SyncNodesVersionWithClusterRequest) returns (SyncNodesVersionWithClusterResponse); + + // 修改节点安装状态 + rpc updateNodeIsInstalled (UpdateNodeIsInstalledRequest) returns (UpdateNodeIsInstalledResponse); } // 创建节点 @@ -58,12 +64,13 @@ message CountAllEnabledNodesResponse { } // 列出单页节点 -message ListEnabledNodesRequest { +message ListEnabledNodesMatchRequest { int64 offset = 1; int64 size = 2; + int64 clusterId = 3; } -message ListEnabledNodesResponse { +message ListEnabledNodesMatchResponse { repeated Node nodes = 1; } @@ -131,4 +138,23 @@ message SyncNodesVersionWithClusterRequest { } message SyncNodesVersionWithClusterResponse { +} + +// 计算匹配的节点数量 +message CountAllEnabledNodesMatchRequest { + int64 clusterId = 1; +} + +message CountAllEnabledNodesMatchResponse { + int64 count = 1; +} + +// 修改节点安装状态 +message UpdateNodeIsInstalledRequest { + int64 nodeId = 1; + bool isInstalled = 2; +} + +message UpdateNodeIsInstalledResponse { + } \ No newline at end of file diff --git a/internal/rpc/protos/service_node_cluster.proto b/internal/rpc/protos/service_node_cluster.proto index e08cba3d..0cb0e974 100644 --- a/internal/rpc/protos/service_node_cluster.proto +++ b/internal/rpc/protos/service_node_cluster.proto @@ -5,11 +5,29 @@ package pb; import "model_node_cluster.proto"; service NodeClusterService { + // 创建集群 + rpc createNodeCluster (CreateNodeClusterRequest) returns (CreateNodeClusterResponse); + + // 修改集群 + rpc updateNodeCluster (UpdateNodeClusterRequest) returns (UpdateNodeClusterResponse); + + // 禁用集群 + rpc disableNodeCluster (DisableNodeClusterRequest) returns (DisableNodeClusterResponse); + + // 查找单个集群信息 + rpc findEnabledNodeCluster (FindEnabledNodeClusterRequest) returns (FindEnabledNodeClusterResponse); + // 获取所有集群的信息 - rpc findAllEnabledClusters (FindAllEnabledNodeClustersRequest) returns (FindAllEnabledNodeClustersResponse); + rpc findAllEnabledNodeClusters (FindAllEnabledNodeClustersRequest) returns (FindAllEnabledNodeClustersResponse); // 获取变更的集群 - rpc findAllChangedClusters (FindAllChangedClustersRequest) returns (FindAllChangedClustersResponse); + rpc findAllChangedNodeClusters (FindAllChangedNodeClustersRequest) returns (FindAllChangedNodeClustersResponse); + + // 计算所有集群数量 + rpc countAllEnabledNodeClusters (CountAllEnabledNodeClustersRequest) returns (CountAllEnabledNodeClustersResponse); + + // 列出单页集群 + rpc listEnabledNodeClusters (ListEnabledNodeClustersRequest) returns (ListEnabledNodeClustersResponse); } // 获取所有集群的信息 @@ -22,10 +40,70 @@ message FindAllEnabledNodeClustersResponse { } // 获取变更的集群 -message FindAllChangedClustersRequest { +message FindAllChangedNodeClustersRequest { } -message FindAllChangedClustersResponse { +message FindAllChangedNodeClustersResponse { + repeated NodeCluster clusters = 1; +} + +// 创建集群 +message CreateNodeClusterRequest { + string name = 1; + int64 grantId = 2; + string installDir = 3; +} + +message CreateNodeClusterResponse { + int64 clusterId = 1; +} + +// 修改集群 +message UpdateNodeClusterRequest { + int64 clusterId = 1; + string name = 2; + int64 grantId = 3; + string installDir = 4; +} + +message UpdateNodeClusterResponse { + +} + +// 禁用集群 +message DisableNodeClusterRequest { + int64 clusterId = 1; +} + +message DisableNodeClusterResponse { + +} + +// 查找单个集群信息 +message FindEnabledNodeClusterRequest { + int64 clusterId = 1; +} + +message FindEnabledNodeClusterResponse { + NodeCluster cluster = 1; +} + +// 计算所有集群数量 +message CountAllEnabledNodeClustersRequest { + +} + +message CountAllEnabledNodeClustersResponse { + int64 count = 1; +} + +// 列出单页集群 +message ListEnabledNodeClustersRequest { + int64 offset = 1; + int64 size = 2; +} + +message ListEnabledNodeClustersResponse { repeated NodeCluster clusters = 1; } \ No newline at end of file diff --git a/internal/rpc/rpc_client.go b/internal/rpc/rpc_client.go index eb900460..f6bc5973 100644 --- a/internal/rpc/rpc_client.go +++ b/internal/rpc/rpc_client.go @@ -24,6 +24,7 @@ type RPCClient struct { nodeClusterClients []pb.NodeClusterServiceClient nodeIPAddressClients []pb.NodeIPAddressServiceClient serverClients []pb.ServerServiceClient + apiNodeClients []pb.APINodeServiceClient } func NewRPCClient(apiConfig *configs.APIConfig) (*RPCClient, error) { @@ -37,6 +38,7 @@ func NewRPCClient(apiConfig *configs.APIConfig) (*RPCClient, error) { nodeClusterClients := []pb.NodeClusterServiceClient{} nodeIPAddressClients := []pb.NodeIPAddressServiceClient{} serverClients := []pb.ServerServiceClient{} + apiNodeClients := []pb.APINodeServiceClient{} conns := []*grpc.ClientConn{} for _, endpoint := range apiConfig.RPC.Endpoints { @@ -58,6 +60,7 @@ func NewRPCClient(apiConfig *configs.APIConfig) (*RPCClient, error) { nodeClusterClients = append(nodeClusterClients, pb.NewNodeClusterServiceClient(conn)) nodeIPAddressClients = append(nodeIPAddressClients, pb.NewNodeIPAddressServiceClient(conn)) serverClients = append(serverClients, pb.NewServerServiceClient(conn)) + apiNodeClients = append(apiNodeClients, pb.NewAPINodeServiceClient(conn)) } return &RPCClient{ @@ -68,6 +71,7 @@ func NewRPCClient(apiConfig *configs.APIConfig) (*RPCClient, error) { nodeClusterClients: nodeClusterClients, nodeIPAddressClients: nodeIPAddressClients, serverClients: serverClients, + apiNodeClients: apiNodeClients, }, nil } @@ -113,6 +117,13 @@ func (this *RPCClient) ServerRPC() pb.ServerServiceClient { return nil } +func (this *RPCClient) APINodeRPC() pb.APINodeServiceClient { + if len(this.serverClients) > 0 { + return this.apiNodeClients[rands.Int(0, len(this.apiNodeClients)-1)] + } + return nil +} + func (this *RPCClient) Context(adminId int64) context.Context { ctx := context.Background() m := maps.Map{ diff --git a/internal/web/actions/default/api/helper.go b/internal/web/actions/default/api/helper.go new file mode 100644 index 00000000..ddefba98 --- /dev/null +++ b/internal/web/actions/default/api/helper.go @@ -0,0 +1,23 @@ +package api + +import ( + "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils" + "github.com/iwind/TeaGo/actions" +) + +type Helper struct { +} + +func NewHelper() *Helper { + return &Helper{} +} + +func (this *Helper) BeforeAction(action *actions.ActionObject) { + action.Data["teaMenu"] = "api" + + selectedTabbar, _ := action.Data["mainTab"] + + tabbar := actionutils.NewTabbar() + tabbar.Add("API节点", "", "/api", "", selectedTabbar == "node") + actionutils.SetTabbar(action, tabbar) +} diff --git a/internal/web/actions/default/api/index.go b/internal/web/actions/default/api/index.go new file mode 100644 index 00000000..f003f15e --- /dev/null +++ b/internal/web/actions/default/api/index.go @@ -0,0 +1,51 @@ +package api + +import ( + "github.com/TeaOSLab/EdgeAdmin/internal/rpc/pb" + "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils" + "github.com/iwind/TeaGo/maps" +) + +type IndexAction struct { + actionutils.ParentAction +} + +func (this *IndexAction) Init() { + this.Nav("", "node", "index") +} + +func (this *IndexAction) RunGet(params struct{}) { + countResp, err := this.RPC().APINodeRPC().CountAllEnabledAPINodes(this.AdminContext(), &pb.CountAllEnabledAPINodesRequest{}) + if err != nil { + this.ErrorPage(err) + return + } + count := countResp.Count + page := this.NewPage(count) + this.Data["page"] = page.AsHTML() + + nodeMaps := []maps.Map{} + if count > 0 { + nodesResp, err := this.RPC().APINodeRPC().ListEnabledAPINodes(this.AdminContext(), &pb.ListEnabledAPINodesRequest{ + Offset: page.Offset, + Size: page.Size, + }) + if err != nil { + this.ErrorPage(err) + return + } + + for _, node := range nodesResp.Nodes { + nodeMaps = append(nodeMaps, maps.Map{ + "id": node.Id, + "isOn": node.IsOn, + "name": node.Name, + "host": node.Host, + "port": node.Port, + }) + } + } + this.Data["nodes"] = nodeMaps + + this.Show() +} diff --git a/internal/web/actions/default/api/init.go b/internal/web/actions/default/api/init.go new file mode 100644 index 00000000..8b84209e --- /dev/null +++ b/internal/web/actions/default/api/init.go @@ -0,0 +1,19 @@ +package api + +import ( + "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/api/node" + "github.com/TeaOSLab/EdgeAdmin/internal/web/helpers" + "github.com/iwind/TeaGo" +) + +func init() { + TeaGo.BeforeStart(func(server *TeaGo.Server) { + server. + Helper(helpers.NewUserMustAuth()). + Helper(NewHelper()). + Prefix("/api"). + Get("", new(IndexAction)). + GetPost("/node/create", new(node.CreateAction)). + EndAll() + }) +} diff --git a/internal/web/actions/default/api/node/create.go b/internal/web/actions/default/api/node/create.go new file mode 100644 index 00000000..66e4da4b --- /dev/null +++ b/internal/web/actions/default/api/node/create.go @@ -0,0 +1,50 @@ +package node + +import ( + "github.com/TeaOSLab/EdgeAdmin/internal/rpc/pb" + "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils" + "github.com/iwind/TeaGo/actions" +) + +type CreateAction struct { + actionutils.ParentAction +} + +func (this *CreateAction) Init() { + this.Nav("", "node", "create") +} + +func (this *CreateAction) RunGet(params struct{}) { + this.Show() +} + +func (this *CreateAction) RunPost(params struct { + Name string + Host string + Port int + Description string + + Must *actions.Must +}) { + params.Must. + Field("name", params.Name). + Require("请输入API节点"). + Field("host", params.Host). + Require("请输入主机地址"). + Field("port", params.Port). + Gt(0, "端口不能小于1"). + Lte(65535, "端口不能大于65535") + + _, err := this.RPC().APINodeRPC().CreateAPINode(this.AdminContext(), &pb.CreateAPINodeRequest{ + Name: params.Name, + Description: params.Description, + Host: params.Host, + Port: int32(params.Port), + }) + if err != nil { + this.ErrorPage(err) + return + } + + this.Success() +} diff --git a/internal/web/actions/default/api/node/helper.go b/internal/web/actions/default/api/node/helper.go new file mode 100644 index 00000000..31ed7b65 --- /dev/null +++ b/internal/web/actions/default/api/node/helper.go @@ -0,0 +1,73 @@ +package node + +import ( + "github.com/TeaOSLab/EdgeAdmin/internal/rpc" + "github.com/TeaOSLab/EdgeAdmin/internal/rpc/pb" + "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils" + "github.com/iwind/TeaGo/actions" + "github.com/iwind/TeaGo/logs" + "github.com/iwind/TeaGo/maps" + "net/http" + "strconv" +) + +type Helper struct { +} + +func NewHelper() *Helper { + return &Helper{} +} + +func (this *Helper) BeforeAction(action *actions.ActionObject) (goNext bool) { + if action.Request.Method != http.MethodGet { + return true + } + + action.Data["teaMenu"] = "api" + + nodeId := action.ParamInt64("nodeId") + nodeIdString := strconv.FormatInt(nodeId, 10) + + // 节点信息 + rpcClient, err := rpc.SharedRPC() + if err != nil { + logs.Error(err) + return + } + nodeResp, err := rpcClient.APINodeRPC().FindEnabledAPINode(rpcClient.Context(action.Context.GetInt64("adminId")), &pb.FindEnabledAPINodeRequest{NodeId: nodeId}) + if err != nil { + action.WriteString(err.Error()) + return + } + if nodeResp.Node == nil { + action.WriteString("node not found") + return + } + node := nodeResp.Node + + // 顶部Tab栏 + selectedTabbar, _ := action.Data["mainTab"] + tabbar := actionutils.NewTabbar() + tabbar.Add("当前节点:"+node.Name, "", "/api", "left long alternate arrow", false) + tabbar.Add("设置", "", "/api/node/settings?nodeId="+nodeIdString, "setting", selectedTabbar == "setting") + actionutils.SetTabbar(action, tabbar) + + // 左侧菜单栏 + secondMenuItem := action.Data.GetString("secondMenuItem") + switch selectedTabbar { + case "setting": + action.Data["leftMenuItems"] = this.createSettingMenu(nodeIdString, secondMenuItem) + } + + return true +} + +// 设置相关菜单 +func (this *Helper) createSettingMenu(nodeIdString string, selectedItem string) (items []maps.Map) { + items = append(items, maps.Map{ + "name": "基础设置", + "url": "/api/node/settings?nodeId=" + nodeIdString, + "isActive": selectedItem == "basic", + }) + return +} diff --git a/internal/web/actions/default/api/node/init.go b/internal/web/actions/default/api/node/init.go new file mode 100644 index 00000000..87a602bc --- /dev/null +++ b/internal/web/actions/default/api/node/init.go @@ -0,0 +1,20 @@ +package node + +import ( + "github.com/TeaOSLab/EdgeAdmin/internal/web/helpers" + "github.com/iwind/TeaGo" +) + +func init() { + TeaGo.BeforeStart(func(server *TeaGo.Server) { + server. + Helper(helpers.NewUserMustAuth()). + Helper(NewHelper()). + Prefix("/api/node"). + + // 节点相关 + GetPost("/settings", new(SettingsAction)). + + EndAll() + }) +} diff --git a/internal/web/actions/default/api/node/settings.go b/internal/web/actions/default/api/node/settings.go new file mode 100644 index 00000000..33d4ec2f --- /dev/null +++ b/internal/web/actions/default/api/node/settings.go @@ -0,0 +1,78 @@ +package node + +import ( + "github.com/TeaOSLab/EdgeAdmin/internal/rpc/pb" + "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils" + "github.com/iwind/TeaGo/actions" + "github.com/iwind/TeaGo/maps" +) + +type SettingsAction struct { + actionutils.ParentAction +} + +func (this *SettingsAction) Init() { + this.Nav("", "setting", "") + this.SecondMenu("basic") +} + +func (this *SettingsAction) RunGet(params struct { + NodeId int64 +}) { + nodeResp, err := this.RPC().APINodeRPC().FindEnabledAPINode(this.AdminContext(), &pb.FindEnabledAPINodeRequest{ + NodeId: params.NodeId, + }) + if err != nil { + this.ErrorPage(err) + return + } + node := nodeResp.Node + if node == nil { + this.WriteString("要操作的节点不存在") + return + } + + this.Data["node"] = maps.Map{ + "id": node.Id, + "name": node.Name, + "description": node.Description, + "host": node.Host, + "port": node.Port, + } + + this.Show() +} + +// 保存基础设置 +func (this *SettingsAction) RunPost(params struct { + NodeId int64 + Name string + Host string + Port int + Description string + + Must *actions.Must +}) { + params.Must. + Field("name", params.Name). + Require("请输入API节点"). + Field("host", params.Host). + Require("请输入主机地址"). + Field("port", params.Port). + Gt(0, "端口不能小于1"). + Lte(65535, "端口不能大于65535") + + _, err := this.RPC().APINodeRPC().UpdateAPINode(this.AdminContext(), &pb.UpdateAPINodeRequest{ + NodeId: params.NodeId, + Name: params.Name, + Description: params.Description, + Host: params.Host, + Port: int32(params.Port), + }) + if err != nil { + this.ErrorPage(err) + return + } + + this.Success() +} diff --git a/internal/web/actions/default/nodes/index.go b/internal/web/actions/default/clusters/cluster/index.go similarity index 76% rename from internal/web/actions/default/nodes/index.go rename to internal/web/actions/default/clusters/cluster/index.go index e3d0d426..69dfeb02 100644 --- a/internal/web/actions/default/nodes/index.go +++ b/internal/web/actions/default/clusters/cluster/index.go @@ -1,4 +1,4 @@ -package nodes +package cluster import ( "encoding/json" @@ -16,11 +16,16 @@ type IndexAction struct { } func (this *IndexAction) Init() { - this.Nav("", "node", "index") + this.Nav("", "node", "") + this.SecondMenu("nodes") } -func (this *IndexAction) RunGet(params struct{}) { - countResp, err := this.RPC().NodeRPC().CountAllEnabledNodes(this.AdminContext(), &pb.CountAllEnabledNodesRequest{}) +func (this *IndexAction) RunGet(params struct { + ClusterId int64 +}) { + countResp, err := this.RPC().NodeRPC().CountAllEnabledNodesMatch(this.AdminContext(), &pb.CountAllEnabledNodesMatchRequest{ + ClusterId: params.ClusterId, + }) if err != nil { this.ErrorPage(err) return @@ -29,9 +34,10 @@ func (this *IndexAction) RunGet(params struct{}) { page := this.NewPage(countResp.Count) this.Data["page"] = page.AsHTML() - nodesResp, err := this.RPC().NodeRPC().ListEnabledNodes(this.AdminContext(), &pb.ListEnabledNodesRequest{ - Offset: page.Offset, - Size: page.Size, + nodesResp, err := this.RPC().NodeRPC().ListEnabledNodesMatch(this.AdminContext(), &pb.ListEnabledNodesMatchRequest{ + Offset: page.Offset, + Size: page.Size, + ClusterId: params.ClusterId, }) nodeMaps := []maps.Map{} for _, node := range nodesResp.Nodes { @@ -62,8 +68,9 @@ func (this *IndexAction) RunGet(params struct{}) { } nodeMaps = append(nodeMaps, maps.Map{ - "id": node.Id, - "name": node.Name, + "id": node.Id, + "name": node.Name, + "isInstalled": node.IsInstalled, "status": maps.Map{ "isActive": status.IsActive, "updatedAt": status.UpdatedAt, diff --git a/internal/web/actions/default/clusters/cluster/init.go b/internal/web/actions/default/clusters/cluster/init.go new file mode 100644 index 00000000..0d2763e3 --- /dev/null +++ b/internal/web/actions/default/clusters/cluster/init.go @@ -0,0 +1,26 @@ +package cluster + +import ( + "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/cluster/node" + clusters "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/clusterutils" + "github.com/TeaOSLab/EdgeAdmin/internal/web/helpers" + "github.com/iwind/TeaGo" +) + +func init() { + TeaGo.BeforeStart(func(server *TeaGo.Server) { + server. + Helper(helpers.NewUserMustAuth()). + Helper(clusters.NewClusterHelper()). + Prefix("/clusters/cluster"). + Get("", new(IndexAction)). + + // 节点相关 + Get("/node", new(node.NodeAction)). + GetPost("/node/create", new(node.CreateAction)). + GetPost("/node/update", new(node.UpdateAction)). + GetPost("/node/install", new(node.InstallAction)). + Post("/node/updateInstallStatus", new(node.UpdateInstallStatusAction)). + EndAll() + }) +} diff --git a/internal/web/actions/default/nodes/create.go b/internal/web/actions/default/clusters/cluster/node/create.go similarity index 77% rename from internal/web/actions/default/nodes/create.go rename to internal/web/actions/default/clusters/cluster/node/create.go index a95eb5af..41c6f822 100644 --- a/internal/web/actions/default/nodes/create.go +++ b/internal/web/actions/default/clusters/cluster/node/create.go @@ -1,4 +1,4 @@ -package nodes +package node import ( "encoding/json" @@ -13,28 +13,11 @@ type CreateAction struct { } func (this *CreateAction) Init() { - this.Nav("", "node", "create") + this.Nav("", "node", "") + this.SecondMenu("nodes") } func (this *CreateAction) RunGet(params struct{}) { - // 所有集群 - resp, err := this.RPC().NodeClusterRPC().FindAllEnabledClusters(this.AdminContext(), &pb.FindAllEnabledNodeClustersRequest{}) - if err != nil { - this.ErrorPage(err) - } - if err != nil { - this.ErrorPage(err) - return - } - clusterMaps := []maps.Map{} - for _, cluster := range resp.Clusters { - clusterMaps = append(clusterMaps, maps.Map{ - "id": cluster.Id, - "name": cluster.Name, - }) - } - this.Data["clusters"] = clusterMaps - this.Show() } diff --git a/internal/web/actions/default/clusters/cluster/node/install.go b/internal/web/actions/default/clusters/cluster/node/install.go new file mode 100644 index 00000000..6519990d --- /dev/null +++ b/internal/web/actions/default/clusters/cluster/node/install.go @@ -0,0 +1,65 @@ +package node + +import ( + "github.com/TeaOSLab/EdgeAdmin/internal/rpc/pb" + "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils" + "github.com/iwind/TeaGo/maps" +) + +type InstallAction struct { + actionutils.ParentAction +} + +func (this *InstallAction) Init() { + this.Nav("", "node", "install") + this.SecondMenu("nodes") +} + +func (this *InstallAction) RunGet(params struct { + NodeId int64 +}) { + this.Data["nodeId"] = params.NodeId + + // 节点 + nodeResp, err := this.RPC().NodeRPC().FindEnabledNode(this.AdminContext(), &pb.FindEnabledNodeRequest{NodeId: params.NodeId}) + if err != nil { + this.ErrorPage(err) + return + } + node := nodeResp.Node + if node == nil { + this.WriteString("找不到要操作的节点") + return + } + + // 集群 + var clusterMap maps.Map = nil + if node.Cluster != nil { + clusterId := node.Cluster.Id + clusterResp, err := this.RPC().NodeClusterRPC().FindEnabledNodeCluster(this.AdminContext(), &pb.FindEnabledNodeClusterRequest{ClusterId: clusterId}) + if err != nil { + this.ErrorPage(err) + return + } + cluster := clusterResp.Cluster + if cluster != nil { + clusterMap = maps.Map{ + "id": cluster.Id, + "name": cluster.Name, + "installDir": cluster.InstallDir, + } + } + } + + this.Data["node"] = maps.Map{ + "id": node.Id, + "name": node.Name, + "installDir": node.InstallDir, + "isInstalled": node.IsInstalled, + "uniqueId": node.UniqueId, + "secret": node.Secret, + "cluster": clusterMap, + } + + this.Show() +} diff --git a/internal/web/actions/default/nodes/node.go b/internal/web/actions/default/clusters/cluster/node/node.go similarity index 79% rename from internal/web/actions/default/nodes/node.go rename to internal/web/actions/default/clusters/cluster/node/node.go index f55ba2b2..4dc3c5b0 100644 --- a/internal/web/actions/default/nodes/node.go +++ b/internal/web/actions/default/clusters/cluster/node/node.go @@ -1,4 +1,4 @@ -package nodes +package node import ( "encoding/json" @@ -13,7 +13,8 @@ type NodeAction struct { } func (this *NodeAction) Init() { - this.Nav("", "node", "index") + this.Nav("", "node", "node") + this.SecondMenu("nodes") } func (this *NodeAction) RunGet(params struct { @@ -34,9 +35,19 @@ func (this *NodeAction) RunGet(params struct { var clusterMap maps.Map = nil if node.Cluster != nil { - clusterMap = maps.Map{ - "id": node.Cluster.Id, - "name": node.Cluster.Name, + clusterId := node.Cluster.Id + clusterResp, err := this.RPC().NodeClusterRPC().FindEnabledNodeCluster(this.AdminContext(), &pb.FindEnabledNodeClusterRequest{ClusterId: clusterId}) + if err != nil { + this.ErrorPage(err) + return + } + cluster := clusterResp.Cluster + if cluster != nil { + clusterMap = maps.Map{ + "id": cluster.Id, + "name": cluster.Name, + "installDir": cluster.InstallDir, + } } } @@ -100,6 +111,10 @@ func (this *NodeAction) RunGet(params struct { "ipAddresses": ipAddressMaps, "cluster": clusterMap, "login": loginMap, + "installDir": node.InstallDir, + "isInstalled": node.IsInstalled, + "uniqueId": node.UniqueId, + "secret": node.Secret, } this.Show() diff --git a/internal/web/actions/default/nodes/update.go b/internal/web/actions/default/clusters/cluster/node/update.go similarity index 95% rename from internal/web/actions/default/nodes/update.go rename to internal/web/actions/default/clusters/cluster/node/update.go index 85c4e6a7..d339e708 100644 --- a/internal/web/actions/default/nodes/update.go +++ b/internal/web/actions/default/clusters/cluster/node/update.go @@ -1,4 +1,4 @@ -package nodes +package node import ( "encoding/json" @@ -14,7 +14,8 @@ type UpdateAction struct { } func (this *UpdateAction) Init() { - this.Nav("", "node", "index") + this.Nav("", "node", "update") + this.SecondMenu("nodes") } func (this *UpdateAction) RunGet(params struct { @@ -104,7 +105,7 @@ func (this *UpdateAction) RunGet(params struct { } // 所有集群 - resp, err := this.RPC().NodeClusterRPC().FindAllEnabledClusters(this.AdminContext(), &pb.FindAllEnabledNodeClustersRequest{}) + resp, err := this.RPC().NodeClusterRPC().FindAllEnabledNodeClusters(this.AdminContext(), &pb.FindAllEnabledNodeClustersRequest{}) if err != nil { this.ErrorPage(err) } diff --git a/internal/web/actions/default/clusters/cluster/node/updateInstallStatus.go b/internal/web/actions/default/clusters/cluster/node/updateInstallStatus.go new file mode 100644 index 00000000..8edaa266 --- /dev/null +++ b/internal/web/actions/default/clusters/cluster/node/updateInstallStatus.go @@ -0,0 +1,26 @@ +package node + +import ( + "github.com/TeaOSLab/EdgeAdmin/internal/rpc/pb" + "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils" +) + +type UpdateInstallStatusAction struct { + actionutils.ParentAction +} + +func (this *UpdateInstallStatusAction) RunPost(params struct { + NodeId int64 + IsInstalled bool +}) { + _, err := this.RPC().NodeRPC().UpdateNodeIsInstalled(this.AdminContext(), &pb.UpdateNodeIsInstalledRequest{ + NodeId: params.NodeId, + IsInstalled: params.IsInstalled, + }) + if err != nil { + this.ErrorPage(err) + return + } + + this.Success() +} diff --git a/internal/web/actions/default/clusters/cluster/settings/index.go b/internal/web/actions/default/clusters/cluster/settings/index.go new file mode 100644 index 00000000..166e0b6a --- /dev/null +++ b/internal/web/actions/default/clusters/cluster/settings/index.go @@ -0,0 +1,89 @@ +package settings + +import ( + "github.com/TeaOSLab/EdgeAdmin/internal/rpc/pb" + "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils" + "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/nodes/grants/grantutils" + "github.com/iwind/TeaGo/actions" + "github.com/iwind/TeaGo/maps" +) + +type IndexAction struct { + actionutils.ParentAction +} + +func (this *IndexAction) Init() { + this.Nav("", "setting", "") + this.SecondMenu("basic") +} + +func (this *IndexAction) RunGet(params struct { + ClusterId int64 +}) { + clusterResp, err := this.RPC().NodeClusterRPC().FindEnabledNodeCluster(this.AdminContext(), &pb.FindEnabledNodeClusterRequest{ClusterId: params.ClusterId}) + if err != nil { + this.ErrorPage(err) + return + } + cluster := clusterResp.Cluster + if cluster == nil { + this.WriteString("not found cluster") + return + } + + // 认证 + var grantMap interface{} = nil + + if cluster.GrantId > 0 { + grantResp, err := this.RPC().NodeGrantRPC().FindEnabledGrant(this.AdminContext(), &pb.FindEnabledGrantRequest{GrantId: cluster.GrantId}) + if err != nil { + this.ErrorPage(err) + return + } + grant := grantResp.Grant + if grant != nil { + grantMap = maps.Map{ + "id": grant.Id, + "name": grant.Name, + "method": grant.Method, + "methodName": grantutils.FindGrantMethodName(grant.Method), + } + } + } + this.Data["grant"] = grantMap + + this.Data["cluster"] = maps.Map{ + "id": cluster.Id, + "name": cluster.Name, + "installDir": cluster.InstallDir, + } + + this.Show() +} + +// 保存设置 +func (this *IndexAction) RunPost(params struct { + ClusterId int64 + Name string + GrantId int64 + InstallDir string + + Must *actions.Must +}) { + params.Must. + Field("name", params.Name). + Require("请输入集群名称") + + _, err := this.RPC().NodeClusterRPC().UpdateNodeCluster(this.AdminContext(), &pb.UpdateNodeClusterRequest{ + ClusterId: params.ClusterId, + Name: params.Name, + GrantId: params.GrantId, + InstallDir: params.InstallDir, + }) + if err != nil { + this.ErrorPage(err) + return + } + + this.Success() +} diff --git a/internal/web/actions/default/clusters/cluster/settings/init.go b/internal/web/actions/default/clusters/cluster/settings/init.go new file mode 100644 index 00000000..6a0d2a34 --- /dev/null +++ b/internal/web/actions/default/clusters/cluster/settings/init.go @@ -0,0 +1,18 @@ +package settings + +import ( + clusters "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/clusterutils" + "github.com/TeaOSLab/EdgeAdmin/internal/web/helpers" + "github.com/iwind/TeaGo" +) + +func init() { + TeaGo.BeforeStart(func(server *TeaGo.Server) { + server. + Helper(helpers.NewUserMustAuth()). + Helper(clusters.NewClusterHelper()). + Prefix("/clusters/cluster/settings"). + GetPost("", new(IndexAction)). + EndAll() + }) +} diff --git a/internal/web/actions/default/clusters/clusterutils/cluster_helper.go b/internal/web/actions/default/clusters/clusterutils/cluster_helper.go new file mode 100644 index 00000000..eb0b1dc9 --- /dev/null +++ b/internal/web/actions/default/clusters/clusterutils/cluster_helper.go @@ -0,0 +1,84 @@ +package clusters + +import ( + "github.com/TeaOSLab/EdgeAdmin/internal/rpc" + "github.com/TeaOSLab/EdgeAdmin/internal/rpc/pb" + "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils" + "github.com/iwind/TeaGo/actions" + "github.com/iwind/TeaGo/logs" + "github.com/iwind/TeaGo/maps" + "net/http" + "strconv" +) + +type ClusterHelper struct { +} + +func NewClusterHelper() *ClusterHelper { + return &ClusterHelper{} +} + +func (this *ClusterHelper) BeforeAction(action *actions.ActionObject) { + if action.Request.Method != http.MethodGet { + return + } + + action.Data["teaMenu"] = "clusters" + + selectedTabbar := action.Data.GetString("mainTab") + clusterId := action.ParamInt64("clusterId") + clusterIdString := strconv.FormatInt(clusterId, 10) + action.Data["clusterId"] = clusterId + + rpcClient, err := rpc.SharedRPC() + if err != nil { + logs.Error(err) + return + } + + clusterResp, err := rpcClient.NodeClusterRPC().FindEnabledNodeCluster(rpcClient.Context(action.Context.GetInt64("adminId")), &pb.FindEnabledNodeClusterRequest{ClusterId: clusterId}) + if err != nil { + logs.Error(err) + return + } + cluster := clusterResp.Cluster + if cluster == nil { + action.WriteString("can not find cluster") + return + } + + tabbar := actionutils.NewTabbar() + tabbar.Add("当前集群:"+cluster.Name, "", "/clusters", "left long alternate arrow", false) + tabbar.Add("节点", "", "/clusters/cluster?clusterId="+clusterIdString, "server", selectedTabbar == "node") + tabbar.Add("设置", "", "/clusters/cluster/settings?clusterId="+clusterIdString, "setting", selectedTabbar == "setting") + actionutils.SetTabbar(action, tabbar) + + // 左侧菜单 + secondMenuItem := action.Data.GetString("secondMenuItem") + switch selectedTabbar { + case "setting": + action.Data["leftMenuItems"] = this.createSettingMenu(clusterIdString, secondMenuItem) + case "node": + action.Data["leftMenuItems"] = this.createNodeMenu(clusterIdString, secondMenuItem) + } +} + +// 节点菜单 +func (this *ClusterHelper) createNodeMenu(clusterId string, selectedItem string) (items []maps.Map) { + items = append(items, maps.Map{ + "name": "节点列表", + "url": "/clusters/cluster?clusterId=" + clusterId, + "isActive": selectedItem == "nodes", + }) + return +} + +// 设置菜单 +func (this *ClusterHelper) createSettingMenu(clusterId string, selectedItem string) (items []maps.Map) { + items = append(items, maps.Map{ + "name": "基础设置", + "url": "/clusters/cluster/settings?clusterId=" + clusterId, + "isActive": selectedItem == "basic", + }) + return +} diff --git a/internal/web/actions/default/clusters/create.go b/internal/web/actions/default/clusters/create.go new file mode 100644 index 00000000..e585f186 --- /dev/null +++ b/internal/web/actions/default/clusters/create.go @@ -0,0 +1,43 @@ +package clusters + +import ( + "github.com/TeaOSLab/EdgeAdmin/internal/rpc/pb" + "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils" + "github.com/iwind/TeaGo/actions" +) + +type CreateAction struct { + actionutils.ParentAction +} + +func (this *CreateAction) Init() { + this.Nav("", "cluster", "create") +} + +func (this *CreateAction) RunGet(params struct{}) { + this.Show() +} + +func (this *CreateAction) RunPost(params struct { + Name string + GrantId int64 + InstallDir string + + Must *actions.Must +}) { + params.Must. + Field("name", params.Name). + Require("请输入集群名称") + + _, err := this.RPC().NodeClusterRPC().CreateNodeCluster(this.AdminContext(), &pb.CreateNodeClusterRequest{ + Name: params.Name, + GrantId: params.GrantId, + InstallDir: params.InstallDir, + }) + if err != nil { + this.ErrorPage(err) + return + } + + this.Success() +} diff --git a/internal/web/actions/default/clusters/helper.go b/internal/web/actions/default/clusters/helper.go new file mode 100644 index 00000000..c9a3779f --- /dev/null +++ b/internal/web/actions/default/clusters/helper.go @@ -0,0 +1,23 @@ +package clusters + +import ( + "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils" + "github.com/iwind/TeaGo/actions" +) + +type Helper struct { +} + +func NewHelper() *Helper { + return &Helper{} +} + +func (this *Helper) BeforeAction(action *actions.ActionObject) { + action.Data["teaMenu"] = "clusters" + + selectedTabbar, _ := action.Data["mainTab"] + + tabbar := actionutils.NewTabbar() + tabbar.Add("集群", "", "/clusters", "", selectedTabbar == "cluster") + actionutils.SetTabbar(action, tabbar) +} diff --git a/internal/web/actions/default/clusters/index.go b/internal/web/actions/default/clusters/index.go new file mode 100644 index 00000000..cc1d1df0 --- /dev/null +++ b/internal/web/actions/default/clusters/index.go @@ -0,0 +1,57 @@ +package clusters + +import ( + "github.com/TeaOSLab/EdgeAdmin/internal/rpc/pb" + "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils" + "github.com/iwind/TeaGo/maps" +) + +type IndexAction struct { + actionutils.ParentAction +} + +func (this *IndexAction) Init() { + this.Nav("", "cluster", "index") +} + +func (this *IndexAction) RunGet(params struct{}) { + countResp, err := this.RPC().NodeClusterRPC().CountAllEnabledNodeClusters(this.AdminContext(), &pb.CountAllEnabledNodeClustersRequest{}) + if err != nil { + this.ErrorPage(err) + return + } + count := countResp.Count + page := this.NewPage(count) + this.Data["page"] = page.AsHTML() + + clusterMaps := []maps.Map{} + if count > 0 { + clustersResp, err := this.RPC().NodeClusterRPC().ListEnabledNodeClusters(this.AdminContext(), &pb.ListEnabledNodeClustersRequest{ + Offset: page.Offset, + Size: page.Size, + }) + if err != nil { + this.ErrorPage(err) + return + } + for _, cluster := range clustersResp.Clusters { + // 节点数量 + countNodesResp, err := this.RPC().NodeRPC().CountAllEnabledNodesMatch(this.AdminContext(), &pb.CountAllEnabledNodesMatchRequest{ClusterId: cluster.Id}) + if err != nil { + this.ErrorPage(err) + return + } + + clusterMaps = append(clusterMaps, maps.Map{ + "id": cluster.Id, + "name": cluster.Name, + "installDir": cluster.InstallDir, + "hasGrant": cluster.GrantId > 0, + "countNodes": countNodesResp.Count, + }) + } + } + this.Data["clusters"] = clusterMaps + + this.Show() +} diff --git a/internal/web/actions/default/clusters/init.go b/internal/web/actions/default/clusters/init.go new file mode 100644 index 00000000..057ae93b --- /dev/null +++ b/internal/web/actions/default/clusters/init.go @@ -0,0 +1,18 @@ +package clusters + +import ( + "github.com/TeaOSLab/EdgeAdmin/internal/web/helpers" + "github.com/iwind/TeaGo" +) + +func init() { + TeaGo.BeforeStart(func(server *TeaGo.Server) { + server. + Helper(helpers.NewUserMustAuth()). + Helper(NewHelper()). + Prefix("/clusters"). + Get("", new(IndexAction)). + GetPost("/create", new(CreateAction)). + EndAll() + }) +} diff --git a/internal/web/actions/default/common/changedClusters.go b/internal/web/actions/default/common/changedClusters.go index a61ca1e9..66c6b52c 100644 --- a/internal/web/actions/default/common/changedClusters.go +++ b/internal/web/actions/default/common/changedClusters.go @@ -15,7 +15,7 @@ func (this *ChangedClustersAction) Init() { } func (this *ChangedClustersAction) RunGet(params struct{}) { - resp, err := this.RPC().NodeClusterRPC().FindAllChangedClusters(this.AdminContext(), &pb.FindAllChangedClustersRequest{}) + resp, err := this.RPC().NodeClusterRPC().FindAllChangedNodeClusters(this.AdminContext(), &pb.FindAllChangedNodeClustersRequest{}) if err != nil { this.ErrorPage(err) return diff --git a/internal/web/actions/default/common/syncClusters.go b/internal/web/actions/default/common/syncClusters.go index 8282ed4a..8c83259c 100644 --- a/internal/web/actions/default/common/syncClusters.go +++ b/internal/web/actions/default/common/syncClusters.go @@ -13,7 +13,7 @@ func (this *SyncClustersAction) RunPost(params struct{}) { // TODO 将来可以单独选择某一个集群进行单独的同步 // 所有有变化的集群 - clustersResp, err := this.RPC().NodeClusterRPC().FindAllChangedClusters(this.AdminContext(), &pb.FindAllChangedClustersRequest{}) + clustersResp, err := this.RPC().NodeClusterRPC().FindAllChangedNodeClusters(this.AdminContext(), &pb.FindAllChangedNodeClustersRequest{}) if err != nil { this.ErrorPage(err) return diff --git a/internal/web/actions/default/nodes/init.go b/internal/web/actions/default/nodes/init.go index 828a90c5..fd21cbd2 100644 --- a/internal/web/actions/default/nodes/init.go +++ b/internal/web/actions/default/nodes/init.go @@ -13,11 +13,7 @@ func init() { Helper(new(helpers.UserMustAuth)). Helper(new(Helper)). Prefix("/nodes"). - Get("", new(IndexAction)). - GetPost("/create", new(CreateAction)). Post("/delete", new(DeleteAction)). - GetPost("/update", new(UpdateAction)). - Get("/node", new(NodeAction)). // IP地址 GetPost("/ipAddresses/createPopup", new(ipAddresses.CreatePopupAction)). diff --git a/internal/web/actions/default/servers/create.go b/internal/web/actions/default/servers/create.go index af790675..b5f23961 100644 --- a/internal/web/actions/default/servers/create.go +++ b/internal/web/actions/default/servers/create.go @@ -20,7 +20,7 @@ func (this *CreateAction) Init() { func (this *CreateAction) RunGet(params struct{}) { // 所有集群 - resp, err := this.RPC().NodeClusterRPC().FindAllEnabledClusters(this.AdminContext(), &pb.FindAllEnabledNodeClustersRequest{}) + resp, err := this.RPC().NodeClusterRPC().FindAllEnabledNodeClusters(this.AdminContext(), &pb.FindAllEnabledNodeClustersRequest{}) if err != nil { this.ErrorPage(err) } diff --git a/internal/web/actions/default/servers/serverutils/server_helper.go b/internal/web/actions/default/servers/serverutils/server_helper.go index e3ef8678..e9b45ec5 100644 --- a/internal/web/actions/default/servers/serverutils/server_helper.go +++ b/internal/web/actions/default/servers/serverutils/server_helper.go @@ -71,7 +71,7 @@ func (this *ServerHelper) createLeftMenu(action *actions.ActionObject) { // TABBAR selectedTabbar, _ := action.Data["mainTab"] tabbar := actionutils.NewTabbar() - tabbar.Add("当前:"+serverConfig.Name, "", "/servers", "left long alternate arrow", false) + tabbar.Add("当前服务:"+serverConfig.Name, "", "/servers", "left long alternate arrow", false) tabbar.Add("看板", "", "/servers/server/board?serverId="+serverIdString, "dashboard", selectedTabbar == "board") tabbar.Add("日志", "", "/servers/server/log?serverId="+serverIdString, "history", selectedTabbar == "log") tabbar.Add("统计", "", "/servers/server/stat?serverId="+serverIdString, "chart area", selectedTabbar == "stat") diff --git a/internal/web/helpers/user_must_auth.go b/internal/web/helpers/user_must_auth.go index 108500a4..bcb1f294 100644 --- a/internal/web/helpers/user_must_auth.go +++ b/internal/web/helpers/user_must_auth.go @@ -67,13 +67,18 @@ func (this *UserMustAuth) BeforeAction(actionPtr actions.ActionWrapper, paramNam modules := []map[string]interface{}{ { "code": "servers", - "menuName": "服务管理", + "menuName": "代理服务", "icon": "clone outsize", }, { - "code": "nodes", - "menuName": "节点管理", - "icon": "server", + "code": "clusters", + "menuName": "节点集群", + "icon": "cloud", + }, + { + "code": "api", + "menuName": "API节点", + "icon": "exchange", }, } diff --git a/internal/web/import.go b/internal/web/import.go index bed432d9..7d960c8d 100644 --- a/internal/web/import.go +++ b/internal/web/import.go @@ -1,6 +1,11 @@ package web import ( + _ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/api" + _ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/api/node" + _ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters" + _ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/cluster" + _ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/clusters/cluster/settings" _ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/common" _ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/dashboard" _ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/index" diff --git a/web/public/js/components/api-node/api-node-selector.js b/web/public/js/components/api-node/api-node-selector.js new file mode 100644 index 00000000..3848d733 --- /dev/null +++ b/web/public/js/components/api-node/api-node-selector.js @@ -0,0 +1,9 @@ +Vue.component("api-node-selector", { + props: [], + data: function () { + return {} + }, + template: `
暂时还没有节点。
+ + +| 节点名称 | +主机地址 | +端口 | +操作 | +
|---|---|---|---|
| {{node.name}} | +{{node.host}} | +{{node.port}} | ++ 设置 + | +
暂时还没有节点。
+ +| ID | +节点名称 | +主机名 | +IP | +CPU | +内存 | + +状态 | +操作 | +
|---|---|---|---|---|---|---|---|
| {{node.id}} | +{{node.name}} | ++ {{node.status.hostname}} + - + | +
+ -
+
+
+ {{addr.ip}} ({{addr.name}})
+ |
+ + {{node.status.cpuUsageText}} + - + | ++ {{node.status.memUsageText}} + - + | +
+
+ 运行中
+ 已断开
+ 未连接
+
+ 未安装
+ |
+ + 详情 删除 + | +
| 配置文件(configs/api.yaml) | +
+ rpc:
+ endpoints: [ "${endpoint}" ]
+nodeId: "{{node.uniqueId}}"
+secret: "{{node.secret}}"
+ |
+
| 安装目录 | +
+ 使用集群设置({{node.cluster.installDir}})
+ {{node.installDir}}
+ |
+
| 节点名称 | +{{node.name}} | +
| IP地址 | +
+
+
+
+
+
+ {{address.ip}}({{address.name}})
+
+
+ 暂时还没有填写IP地址。
+
+ |
+
| SSH主机地址 | +
+
+ {{node.login.params.host}}
+ 尚未设置
+
+
+ 尚未设置
+
+ |
+
| SSH主机端口 | +
+
+ {{node.login.params.port}}
+ 尚未设置
+
+
+ 尚未设置
+
+ |
+
| SSH登录认证 | +
+
+ {{node.login.grant.name}}({{node.login.grant.methodName}})
+
+
+ 尚未设置
+
+ |
+
| 节点ID(id) | +{{node.uniqueId}} | +
| 密钥(secret) | +{{node.secret}} | +
| 安装目录 | +
+ 使用集群设置({{node.cluster.installDir}})
+ {{node.installDir}}
+ |
+
| 是否已安装 | ++ 已安装 + 未安装 + | +
暂时还没有集群。
+ +| 集群名称 | +节点数量 | +默认认证 | +操作 | +
|---|---|---|---|
| {{cluster.name}} | +{{cluster.countNodes}} | ++ Y + N + | ++ 详情 + | +
暂时还没有节点。
- -| ID | -节点名称 | -主机名 | -IP | -所属集群 | -状态 | -CPU | -内存 | - -操作 | -
|---|---|---|---|---|---|---|---|---|
| {{node.id}} | -{{node.name}} | -- {{node.status.hostname}} - - - | -
- -
-
-
- {{addr.ip}} ({{addr.name}})
- |
- {{node.cluster.name}} | -- 运行中 - 已断开 - 未连接 - | -- {{node.status.cpuUsageText}} - - - | -- {{node.status.memUsageText}} - - - | -- 详情 删除 - | -
| 节点名称 | -{{node.name}} | -
| IP地址 | -
-
-
-
-
-
- {{address.ip}}({{address.name}})
-
-
- 暂时还没有填写IP地址。
-
- |
-
| 所属集群 | -
- 还没有设置集群。
-
- {{node.cluster.name}}
-
- |
-
| SSH主机地址 | -
-
- {{node.login.params.host}}
- 尚未设置
-
-
- 尚未设置
-
- |
-
| SSH主机端口 | -
-
- {{node.login.params.port}}
- 尚未设置
-
-
- 尚未设置
-
- |
-
| SSH登录认证 | -
-
- {{node.login.grant.name}}({{node.login.grant.methodName}})
-
-
- 尚未设置
-
- |
-