mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-12-07 06:50:34 +08:00
实现节点分组管理
This commit is contained in:
9
pkg/rpc/protos/model_node_group.proto
Normal file
9
pkg/rpc/protos/model_node_group.proto
Normal file
@@ -0,0 +1,9 @@
|
||||
syntax = "proto3";
|
||||
option go_package = "./pb";
|
||||
|
||||
package pb;
|
||||
|
||||
message NodeGroup {
|
||||
int64 id = 1;
|
||||
string name = 2;
|
||||
}
|
||||
@@ -86,6 +86,9 @@ service NodeService {
|
||||
|
||||
// 修改节点登录信息
|
||||
rpc updateNodeLogin (UpdateNodeLoginRequest) returns (RPCUpdateSuccess);
|
||||
|
||||
// 计算某个节点分组内的节点数量
|
||||
rpc countAllEnabledNodesWithGroupId (CountAllEnabledNodesWithGroupIdRequest) returns (CountAllEnabledNodesWithGroupIdResponse);
|
||||
}
|
||||
|
||||
// 创建节点
|
||||
@@ -126,6 +129,8 @@ message ListEnabledNodesMatchRequest {
|
||||
int64 clusterId = 3;
|
||||
int32 installState = 4;
|
||||
int32 activeState = 5;
|
||||
string keyword = 6;
|
||||
int64 groupId = 7;
|
||||
}
|
||||
|
||||
message ListEnabledNodesMatchResponse {
|
||||
@@ -208,6 +213,8 @@ message CountAllEnabledNodesMatchRequest {
|
||||
int64 clusterId = 1;
|
||||
int32 installState = 2;
|
||||
int32 activeState = 3;
|
||||
string keyword = 4;
|
||||
int64 groupId = 5;
|
||||
}
|
||||
|
||||
message CountAllEnabledNodesMatchResponse {
|
||||
@@ -320,3 +327,12 @@ message UpdateNodeLoginRequest {
|
||||
int64 nodeId = 1;
|
||||
NodeLogin Login = 2;
|
||||
}
|
||||
|
||||
// 计算某个节点分组内的节点数量
|
||||
message CountAllEnabledNodesWithGroupIdRequest {
|
||||
int64 groupId = 1;
|
||||
}
|
||||
|
||||
message CountAllEnabledNodesWithGroupIdResponse {
|
||||
int64 count = 1;
|
||||
}
|
||||
|
||||
@@ -3,3 +3,70 @@ option go_package = "./pb";
|
||||
|
||||
package pb;
|
||||
|
||||
import "model_node_group.proto";
|
||||
import "rpc_messages.proto";
|
||||
|
||||
// 节点分组服务
|
||||
service NodeGroupService {
|
||||
// 创建分组
|
||||
rpc createNodeGroup (CreateNodeGroupRequest) returns (CreateNodeGroupResponse);
|
||||
|
||||
// 修改分组
|
||||
rpc updateNodeGroup (UpdateNodeGroupRequest) returns (RPCUpdateSuccess);
|
||||
|
||||
// 删除分组
|
||||
rpc deleteNodeGroup (DeleteNodeGroupRequest) returns (RPCDeleteSuccess);
|
||||
|
||||
// 查询所有分组
|
||||
rpc findAllEnabledNodeGroupsWithClusterId (FindAllEnabledNodeGroupsWithClusterIdRequest) returns (FindAllEnabledNodeGroupsWithClusterIdResponse);
|
||||
|
||||
// 修改分组排序
|
||||
rpc updateNodeGroupOrders (UpdateNodeGroupOrdersRequest) returns (RPCUpdateSuccess);
|
||||
|
||||
// 查找单个分组信息
|
||||
rpc findEnabledNodeGroup (FindEnabledNodeGroupRequest) returns (FindEnabledNodeGroupResponse);
|
||||
}
|
||||
|
||||
// 创建分组
|
||||
message CreateNodeGroupRequest {
|
||||
int64 clusterId = 1;
|
||||
string name = 2;
|
||||
}
|
||||
|
||||
message CreateNodeGroupResponse {
|
||||
int64 groupId = 1;
|
||||
}
|
||||
|
||||
// 修改分组
|
||||
message UpdateNodeGroupRequest {
|
||||
int64 groupId = 1;
|
||||
string name = 2;
|
||||
}
|
||||
|
||||
// 删除分组
|
||||
message DeleteNodeGroupRequest {
|
||||
int64 groupId = 1;
|
||||
}
|
||||
|
||||
// 查询所有分组
|
||||
message FindAllEnabledNodeGroupsWithClusterIdRequest {
|
||||
int64 clusterId = 1;
|
||||
}
|
||||
|
||||
message FindAllEnabledNodeGroupsWithClusterIdResponse {
|
||||
repeated NodeGroup groups = 1;
|
||||
}
|
||||
|
||||
// 修改分组排序
|
||||
message UpdateNodeGroupOrdersRequest {
|
||||
repeated int64 groupIds = 1;
|
||||
}
|
||||
|
||||
// 查找单个分组信息
|
||||
message FindEnabledNodeGroupRequest {
|
||||
int64 groupId = 1;
|
||||
}
|
||||
|
||||
message FindEnabledNodeGroupResponse {
|
||||
NodeGroup group = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user