mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-11-30 01:00:27 +08:00
增加节点同步状态提示和任务列表
This commit is contained in:
@@ -27,6 +27,7 @@ message Node {
|
||||
bool isOn = 13;
|
||||
bool isUp = 14;
|
||||
repeated DNSRoute dnsRoutes = 15;
|
||||
bool isActive = 16;
|
||||
|
||||
NodeCluster nodeCluster = 32;
|
||||
NodeLogin login = 33;
|
||||
|
||||
20
pkg/rpc/protos/model_node_task.proto
Normal file
20
pkg/rpc/protos/model_node_task.proto
Normal file
@@ -0,0 +1,20 @@
|
||||
syntax = "proto3";
|
||||
option go_package = "./pb";
|
||||
|
||||
package pb;
|
||||
|
||||
import "model_node.proto";
|
||||
import "model_node_cluster.proto";
|
||||
|
||||
// 节点相关同步任务
|
||||
message NodeTask {
|
||||
int64 id = 1;
|
||||
string type = 2;
|
||||
bool isDone = 3;
|
||||
bool isOk = 4;
|
||||
string error = 5;
|
||||
int64 updatedAt = 6;
|
||||
|
||||
Node node = 30;
|
||||
NodeCluster nodeCluster = 31;
|
||||
}
|
||||
@@ -49,9 +49,6 @@ service NodeService {
|
||||
// 更新节点状态
|
||||
rpc updateNodeStatus (UpdateNodeStatusRequest) returns (RPCSuccess);
|
||||
|
||||
// 同步集群中的节点版本
|
||||
rpc syncNodesVersionWithCluster (SyncNodesVersionWithClusterRequest) returns (SyncNodesVersionWithClusterResponse);
|
||||
|
||||
// 修改节点安装状态
|
||||
rpc updateNodeIsInstalled (UpdateNodeIsInstalledRequest) returns (RPCSuccess);
|
||||
|
||||
@@ -105,6 +102,9 @@ service NodeService {
|
||||
|
||||
// 计算某个区域下的节点数量
|
||||
rpc countAllEnabledNodesWithNodeRegionId (CountAllEnabledNodesWithNodeRegionIdRequest) returns (RPCCountResponse);
|
||||
|
||||
// 根据一组ID获取节点信息
|
||||
rpc findEnabledNodesWithIds (FindEnabledNodesWithIdsRequest) returns (FindEnabledNodesWithIdsResponse);
|
||||
}
|
||||
|
||||
// 创建节点
|
||||
@@ -219,14 +219,6 @@ message UpdateNodeStatusRequest {
|
||||
bytes statusJSON = 2;
|
||||
}
|
||||
|
||||
// 同步集群中的节点版本
|
||||
message SyncNodesVersionWithClusterRequest {
|
||||
int64 nodeClusterId = 1;
|
||||
}
|
||||
|
||||
message SyncNodesVersionWithClusterResponse {
|
||||
}
|
||||
|
||||
// 计算匹配的节点数量
|
||||
message CountAllEnabledNodesMatchRequest {
|
||||
int64 nodeClusterId = 1;
|
||||
@@ -390,4 +382,13 @@ message UpdateNodeDNSRequest {
|
||||
// 计算某个区域下的节点数量
|
||||
message CountAllEnabledNodesWithNodeRegionIdRequest {
|
||||
int64 nodeRegionId = 1;
|
||||
}
|
||||
|
||||
// 根据一组ID获取节点信息
|
||||
message FindEnabledNodesWithIdsRequest {
|
||||
repeated int64 nodeIds = 1;
|
||||
}
|
||||
|
||||
message FindEnabledNodesWithIdsResponse {
|
||||
repeated Node nodes = 1;
|
||||
}
|
||||
@@ -29,9 +29,6 @@ service NodeClusterService {
|
||||
// 获取所有可用集群
|
||||
rpc findAllEnabledNodeClusters (FindAllEnabledNodeClustersRequest) returns (FindAllEnabledNodeClustersResponse);
|
||||
|
||||
// 获取变更的集群
|
||||
rpc findAllChangedNodeClusters (FindAllChangedNodeClustersRequest) returns (FindAllChangedNodeClustersResponse);
|
||||
|
||||
// 计算所有集群数量
|
||||
rpc countAllEnabledNodeClusters (CountAllEnabledNodeClustersRequest) returns (RPCCountResponse);
|
||||
|
||||
@@ -117,15 +114,6 @@ message FindAllEnabledNodeClustersResponse {
|
||||
repeated NodeCluster nodeClusters = 1;
|
||||
}
|
||||
|
||||
// 获取变更的集群
|
||||
message FindAllChangedNodeClustersRequest {
|
||||
|
||||
}
|
||||
|
||||
message FindAllChangedNodeClustersResponse {
|
||||
repeated NodeCluster nodeClusters = 1;
|
||||
}
|
||||
|
||||
// 创建集群
|
||||
message CreateNodeClusterRequest {
|
||||
string name = 1;
|
||||
|
||||
99
pkg/rpc/protos/service_node_task.proto
Normal file
99
pkg/rpc/protos/service_node_task.proto
Normal file
@@ -0,0 +1,99 @@
|
||||
syntax = "proto3";
|
||||
option go_package = "./pb";
|
||||
|
||||
package pb;
|
||||
|
||||
import "rpc_messages.proto";
|
||||
import "model_node_task.proto";
|
||||
|
||||
// 节点同步任务相关服务
|
||||
service NodeTaskService {
|
||||
// 获取单节点同步任务
|
||||
rpc findNodeTasks (FindNodeTasksRequest) returns (FindNodeTasksResponse);
|
||||
|
||||
// 报告同步任务结果
|
||||
rpc reportNodeTaskDone (ReportNodeTaskDoneRequest) returns (RPCSuccess);
|
||||
|
||||
// 获取所有正在同步的集群信息
|
||||
rpc findNodeClusterTasks (FindNodeClusterTasksRequest) returns (FindNodeClusterTasksResponse);
|
||||
|
||||
// 检查是否有正在执行的任务
|
||||
rpc existsNodeTasks (ExistsNodeTasksRequest) returns (ExistsNodeTasksResponse);
|
||||
|
||||
// 删除任务
|
||||
rpc deleteNodeTask (DeleteNodeTaskRequest) returns (RPCSuccess);
|
||||
|
||||
// 计算正在执行的任务数量
|
||||
rpc countDoingNodeTasks (CountDoingNodeTasksRequest) returns (RPCCountResponse);
|
||||
|
||||
// 查找需要通知的任务
|
||||
rpc findNotifyingNodeTasks (FindNotifyingNodeTasksRequest) returns (FindNotifyingNodeTasksResponse);
|
||||
|
||||
// 设置任务已通知
|
||||
rpc updateNodeTasksNotified (UpdateNodeTasksNotifiedRequest) returns (RPCSuccess);
|
||||
}
|
||||
|
||||
// 获取单节点同步任务
|
||||
message FindNodeTasksRequest {
|
||||
|
||||
}
|
||||
|
||||
message FindNodeTasksResponse {
|
||||
repeated NodeTask nodeTasks = 1;
|
||||
}
|
||||
|
||||
// 报告同步任务结果
|
||||
message ReportNodeTaskDoneRequest {
|
||||
int64 nodeTaskId = 1;
|
||||
bool isOk = 2;
|
||||
string error = 3;
|
||||
}
|
||||
|
||||
// 获取所有正在同步的集群信息
|
||||
message FindNodeClusterTasksRequest {
|
||||
|
||||
}
|
||||
|
||||
message FindNodeClusterTasksResponse {
|
||||
repeated ClusterTask clusterTasks = 1;
|
||||
}
|
||||
|
||||
message ClusterTask {
|
||||
int64 clusterId = 1;
|
||||
string clusterName = 2;
|
||||
repeated NodeTask nodeTasks = 3;
|
||||
}
|
||||
|
||||
// 检查是否有正在执行的任务
|
||||
message ExistsNodeTasksRequest {
|
||||
|
||||
}
|
||||
|
||||
message ExistsNodeTasksResponse {
|
||||
bool existTasks = 1;
|
||||
bool existError = 2;
|
||||
}
|
||||
|
||||
// 删除任务
|
||||
message DeleteNodeTaskRequest {
|
||||
int64 nodeTaskId = 1;
|
||||
}
|
||||
|
||||
// 计算正在执行的任务数量
|
||||
message CountDoingNodeTasksRequest {
|
||||
|
||||
}
|
||||
|
||||
// 查找需要通知的任务
|
||||
message FindNotifyingNodeTasksRequest {
|
||||
int64 size = 1;
|
||||
}
|
||||
|
||||
message FindNotifyingNodeTasksResponse {
|
||||
repeated NodeTask nodeTasks = 1;
|
||||
}
|
||||
|
||||
// 设置任务已通知
|
||||
message UpdateNodeTasksNotifiedRequest {
|
||||
repeated int64 nodeTaskIds = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user