mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-12-02 20:00:25 +08:00
[区域]增加区域管理
This commit is contained in:
165
pkg/rpc/pb/model_node_region.pb.go
Normal file
165
pkg/rpc/pb/model_node_region.pb.go
Normal file
@@ -0,0 +1,165 @@
|
|||||||
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// protoc-gen-go v1.25.0
|
||||||
|
// protoc v3.12.3
|
||||||
|
// source: model_node_region.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 NodeRegion 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"`
|
||||||
|
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *NodeRegion) Reset() {
|
||||||
|
*x = NodeRegion{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_model_node_region_proto_msgTypes[0]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *NodeRegion) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*NodeRegion) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *NodeRegion) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_model_node_region_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 NodeRegion.ProtoReflect.Descriptor instead.
|
||||||
|
func (*NodeRegion) Descriptor() ([]byte, []int) {
|
||||||
|
return file_model_node_region_proto_rawDescGZIP(), []int{0}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *NodeRegion) GetId() int64 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Id
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *NodeRegion) GetIsOn() bool {
|
||||||
|
if x != nil {
|
||||||
|
return x.IsOn
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *NodeRegion) GetName() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Name
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
var File_model_node_region_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
|
var file_model_node_region_proto_rawDesc = []byte{
|
||||||
|
0x0a, 0x17, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x72, 0x65, 0x67,
|
||||||
|
0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x44, 0x0a,
|
||||||
|
0x0a, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 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,
|
||||||
|
0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e,
|
||||||
|
0x61, 0x6d, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
||||||
|
0x74, 0x6f, 0x33,
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
file_model_node_region_proto_rawDescOnce sync.Once
|
||||||
|
file_model_node_region_proto_rawDescData = file_model_node_region_proto_rawDesc
|
||||||
|
)
|
||||||
|
|
||||||
|
func file_model_node_region_proto_rawDescGZIP() []byte {
|
||||||
|
file_model_node_region_proto_rawDescOnce.Do(func() {
|
||||||
|
file_model_node_region_proto_rawDescData = protoimpl.X.CompressGZIP(file_model_node_region_proto_rawDescData)
|
||||||
|
})
|
||||||
|
return file_model_node_region_proto_rawDescData
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_model_node_region_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||||
|
var file_model_node_region_proto_goTypes = []interface{}{
|
||||||
|
(*NodeRegion)(nil), // 0: pb.NodeRegion
|
||||||
|
}
|
||||||
|
var file_model_node_region_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_node_region_proto_init() }
|
||||||
|
func file_model_node_region_proto_init() {
|
||||||
|
if File_model_node_region_proto != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !protoimpl.UnsafeEnabled {
|
||||||
|
file_model_node_region_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*NodeRegion); 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_node_region_proto_rawDesc,
|
||||||
|
NumEnums: 0,
|
||||||
|
NumMessages: 1,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 0,
|
||||||
|
},
|
||||||
|
GoTypes: file_model_node_region_proto_goTypes,
|
||||||
|
DependencyIndexes: file_model_node_region_proto_depIdxs,
|
||||||
|
MessageInfos: file_model_node_region_proto_msgTypes,
|
||||||
|
}.Build()
|
||||||
|
File_model_node_region_proto = out.File
|
||||||
|
file_model_node_region_proto_rawDesc = nil
|
||||||
|
file_model_node_region_proto_goTypes = nil
|
||||||
|
file_model_node_region_proto_depIdxs = nil
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
10
pkg/rpc/protos/model_node_region.proto
Normal file
10
pkg/rpc/protos/model_node_region.proto
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
option go_package = "./pb";
|
||||||
|
|
||||||
|
package pb;
|
||||||
|
|
||||||
|
message NodeRegion {
|
||||||
|
int64 id = 1;
|
||||||
|
bool isOn = 2;
|
||||||
|
string name = 3;
|
||||||
|
}
|
||||||
@@ -92,7 +92,7 @@ service NodeService {
|
|||||||
rpc updateNodeLogin (UpdateNodeLoginRequest) returns (RPCSuccess);
|
rpc updateNodeLogin (UpdateNodeLoginRequest) returns (RPCSuccess);
|
||||||
|
|
||||||
// 计算某个节点分组内的节点数量
|
// 计算某个节点分组内的节点数量
|
||||||
rpc countAllEnabledNodesWithGroupId (CountAllEnabledNodesWithGroupIdRequest) returns (RPCCountResponse);
|
rpc countAllEnabledNodesWithNodeGroupId (CountAllEnabledNodesWithNodeGroupIdRequest) returns (RPCCountResponse);
|
||||||
|
|
||||||
// 取得某个集群下的所有节点DNS信息
|
// 取得某个集群下的所有节点DNS信息
|
||||||
rpc findAllEnabledNodesDNSWithClusterId (FindAllEnabledNodesDNSWithClusterIdRequest) returns (FindAllEnabledNodesDNSWithClusterIdResponse);
|
rpc findAllEnabledNodesDNSWithClusterId (FindAllEnabledNodesDNSWithClusterIdRequest) returns (FindAllEnabledNodesDNSWithClusterIdResponse);
|
||||||
@@ -102,6 +102,9 @@ service NodeService {
|
|||||||
|
|
||||||
// 修改节点的DNS解析信息
|
// 修改节点的DNS解析信息
|
||||||
rpc updateNodeDNS (UpdateNodeDNSRequest) returns (RPCSuccess);
|
rpc updateNodeDNS (UpdateNodeDNSRequest) returns (RPCSuccess);
|
||||||
|
|
||||||
|
// 计算某个区域下的节点数量
|
||||||
|
rpc countAllEnabledNodesWithNodeRegionId (CountAllEnabledNodesWithNodeRegionIdRequest) returns (RPCCountResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建节点
|
// 创建节点
|
||||||
@@ -112,6 +115,7 @@ message CreateNodeRequest {
|
|||||||
int64 groupId = 4;
|
int64 groupId = 4;
|
||||||
int64 dnsDomainId = 5;
|
int64 dnsDomainId = 5;
|
||||||
repeated string dnsRoutes = 6;
|
repeated string dnsRoutes = 6;
|
||||||
|
int64 regionId = 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
message CreateNodeResponse {
|
message CreateNodeResponse {
|
||||||
@@ -174,6 +178,7 @@ message UpdateNodeRequest {
|
|||||||
int64 groupId = 7;
|
int64 groupId = 7;
|
||||||
int64 dnsDomainId = 8;
|
int64 dnsDomainId = 8;
|
||||||
repeated string dnsRoutes = 9;
|
repeated string dnsRoutes = 9;
|
||||||
|
int64 regionId = 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查找节点
|
// 查找节点
|
||||||
@@ -339,8 +344,8 @@ message UpdateNodeLoginRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 计算某个节点分组内的节点数量
|
// 计算某个节点分组内的节点数量
|
||||||
message CountAllEnabledNodesWithGroupIdRequest {
|
message CountAllEnabledNodesWithNodeGroupIdRequest {
|
||||||
int64 groupId = 1;
|
int64 nodeGroupId = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 取得某个集群下的所有节点
|
// 取得某个集群下的所有节点
|
||||||
@@ -378,3 +383,8 @@ message UpdateNodeDNSRequest {
|
|||||||
int64 dnsDomainId = 3;
|
int64 dnsDomainId = 3;
|
||||||
repeated string routes = 4;
|
repeated string routes = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 计算某个区域下的节点数量
|
||||||
|
message CountAllEnabledNodesWithNodeRegionIdRequest {
|
||||||
|
int64 nodeRegionId = 1;
|
||||||
|
}
|
||||||
@@ -3,3 +3,82 @@ option go_package = "./pb";
|
|||||||
|
|
||||||
package pb;
|
package pb;
|
||||||
|
|
||||||
|
import "rpc_messages.proto";
|
||||||
|
import "model_node_region.proto";
|
||||||
|
|
||||||
|
// 节点区域相关服务
|
||||||
|
service NodeRegionService {
|
||||||
|
// 创建区域
|
||||||
|
rpc createNodeRegion (CreateNodeRegionRequest) returns (CreateNodeRegionResponse);
|
||||||
|
|
||||||
|
// 修改区域
|
||||||
|
rpc updateNodeRegion (UpdateNodeRegionRequest) returns (RPCSuccess);
|
||||||
|
|
||||||
|
// 删除区域
|
||||||
|
rpc deleteNodeRegion (DeleteNodeRegionRequest) returns (RPCSuccess);
|
||||||
|
|
||||||
|
// 查找所有区域
|
||||||
|
rpc findAllEnabledNodeRegions (FindAllEnabledNodeRegionsRequest) returns (FindAllEnabledNodeRegionsResponse);
|
||||||
|
|
||||||
|
// 查找所有启用的区域
|
||||||
|
rpc findAllEnabledAndOnNodeRegions (FindAllEnabledAndOnNodeRegionsRequest) returns (FindAllEnabledAndOnNodeRegionsResponse);
|
||||||
|
|
||||||
|
// 排序
|
||||||
|
rpc updateNodeRegionOrders (UpdateNodeRegionOrdersRequest) returns (RPCSuccess);
|
||||||
|
|
||||||
|
// 查找单个区域信息
|
||||||
|
rpc findEnabledNodeRegion (FindEnabledNodeRegionRequest) returns (FindEnabledNodeRegionResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建区域
|
||||||
|
message CreateNodeRegionRequest {
|
||||||
|
string name = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message CreateNodeRegionResponse {
|
||||||
|
int64 nodeRegionId = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改区域
|
||||||
|
message UpdateNodeRegionRequest {
|
||||||
|
int64 nodeRegionId = 1;
|
||||||
|
string name = 2;
|
||||||
|
bool isOn = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除区域
|
||||||
|
message DeleteNodeRegionRequest {
|
||||||
|
int64 nodeRegionId = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查找所有区域
|
||||||
|
message FindAllEnabledNodeRegionsRequest {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
message FindAllEnabledNodeRegionsResponse {
|
||||||
|
repeated NodeRegion nodeRegions = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查找所有启用的区域
|
||||||
|
message FindAllEnabledAndOnNodeRegionsRequest {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
message FindAllEnabledAndOnNodeRegionsResponse {
|
||||||
|
repeated NodeRegion nodeRegions = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 排序
|
||||||
|
message UpdateNodeRegionOrdersRequest {
|
||||||
|
repeated int64 nodeRegionIds = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查找单个区域信息
|
||||||
|
message FindEnabledNodeRegionRequest {
|
||||||
|
int64 nodeRegionId = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message FindEnabledNodeRegionResponse {
|
||||||
|
NodeRegion nodeRegion = 1;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user