mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-12-10 01:20:26 +08:00
实现基础的智能调度
This commit is contained in:
@@ -37,6 +37,9 @@ message Node {
|
||||
repeated string lnAddrs = 21; // Ln访问地址
|
||||
bool enableIPLists = 22;
|
||||
bytes apiNodeAddrsJSON = 24;
|
||||
string offlineDay = 25; // 下线日期
|
||||
bool isBackupForCluster = 26; // 是否为集群备用节点
|
||||
bool isBackupForGroup = 27; // 是否为分组备用节点
|
||||
|
||||
NodeCluster nodeCluster = 32; // 主集群
|
||||
NodeLogin nodeLogin = 33;
|
||||
|
||||
15
pkg/rpc/protos/models/model_node_action.proto
Normal file
15
pkg/rpc/protos/models/model_node_action.proto
Normal file
@@ -0,0 +1,15 @@
|
||||
syntax = "proto3";
|
||||
option go_package = "./pb";
|
||||
|
||||
package pb;
|
||||
|
||||
// 节点动作
|
||||
message NodeAction {
|
||||
int64 id = 1;
|
||||
int64 nodeId = 2;
|
||||
string role = 3;
|
||||
bool isOn = 4; // 是否启用
|
||||
bytes condsJSON = 5; // 条件定义
|
||||
bytes actionJSON = 6; // 动作定义
|
||||
bytes durationJSON = 7; // 持续时间
|
||||
}
|
||||
@@ -172,6 +172,15 @@ service NodeService {
|
||||
|
||||
// 查找节点的UAM策略
|
||||
rpc findNodeUAMPolicies(FindNodeUAMPoliciesRequest) returns (FindNodeUAMPoliciesResponse);
|
||||
|
||||
// 查找节点调度信息
|
||||
rpc findNodeScheduleInfo(FindNodeScheduleInfoRequest) returns (FindNodeScheduleInfoResponse);
|
||||
|
||||
// 修改节点调度信息
|
||||
rpc updateNodeScheduleInfo(UpdateNodeScheduleInfoRequest) returns (RPCSuccess);
|
||||
|
||||
// 重置节点动作状态
|
||||
rpc resetNodeActionStatus(ResetNodeActionStatusRequest) returns (RPCSuccess);
|
||||
}
|
||||
|
||||
// 创建节点
|
||||
@@ -471,6 +480,9 @@ message NodeDNSInfo {
|
||||
int64 dnsDomainId = 6;
|
||||
string dnsDomainName = 7;
|
||||
string nodeClusterDNSName = 8;
|
||||
bool isBackupForCluster = 10; // 是否为集群备份节点
|
||||
bool isBackupForGroup = 11; // 是否为分组备份节点
|
||||
bool isOffline = 12; // 是否下线
|
||||
}
|
||||
|
||||
// 查找单个节点的域名解析信息
|
||||
@@ -609,12 +621,13 @@ message FindEnabledNodeConfigInfoRequest {
|
||||
}
|
||||
|
||||
message FindEnabledNodeConfigInfoResponse {
|
||||
bool hasDNSInfo = 1;
|
||||
bool hasCacheInfo = 2;
|
||||
bool hasThresholds = 3;
|
||||
bool hasSSH = 4;
|
||||
bool hasSystemSettings = 5;
|
||||
bool hasDDoSProtection = 6;
|
||||
bool hasDNSInfo = 1; // 是否有DNS设置
|
||||
bool hasCacheInfo = 2; // 是否有缓存设置
|
||||
bool hasThresholds = 3; // 是否有阈值设置
|
||||
bool hasSSH = 4; // 是否有SSH设置
|
||||
bool hasSystemSettings = 5; // 是否有系统设置
|
||||
bool hasDDoSProtection = 6; // 是否有DDoS防护设置
|
||||
bool hasScheduleSettings = 7; // 是否有调度设置
|
||||
}
|
||||
|
||||
// 查找节点区域信息数量
|
||||
@@ -674,4 +687,35 @@ message FindNodeUAMPoliciesResponse {
|
||||
int64 nodeClusterId = 1; // 集群ID
|
||||
bytes uamPolicyJSON = 2; // UAM策略配置
|
||||
}
|
||||
}
|
||||
|
||||
// 查找节点调度信息
|
||||
message FindNodeScheduleInfoRequest {
|
||||
int64 nodeId = 1; // 节点ID
|
||||
}
|
||||
|
||||
message FindNodeScheduleInfoResponse {
|
||||
ScheduleInfo scheduleInfo = 1; // 调度信息
|
||||
|
||||
message ScheduleInfo {
|
||||
string offlineDay = 1; // 下线日期,格式YYYYMMDD
|
||||
bool isBackupForCluster = 2; // 是否为集群备份节点
|
||||
bool isBackupForGroup = 3; // 是否为分组备份节点
|
||||
repeated string backupIPs = 4; // 备用IP
|
||||
bytes actionStatusJSON = 5; // 动作状态
|
||||
}
|
||||
}
|
||||
|
||||
// 修改节点调度信息
|
||||
message UpdateNodeScheduleInfoRequest {
|
||||
int64 nodeId = 1; // 节点ID
|
||||
string offlineDay = 2; // 下线日期,格式YYYYMMDD
|
||||
bool isBackupForCluster = 3; // 是否为集群备份节点
|
||||
bool isBackupForGroup = 4; // 是否为分组备份节点
|
||||
repeated string backupIPs = 5; // 备用IP
|
||||
}
|
||||
|
||||
// 重置节点动作状态
|
||||
message ResetNodeActionStatusRequest {
|
||||
int64 nodeId = 1; // 节点ID
|
||||
}
|
||||
71
pkg/rpc/protos/service_node_action.proto
Normal file
71
pkg/rpc/protos/service_node_action.proto
Normal file
@@ -0,0 +1,71 @@
|
||||
syntax = "proto3";
|
||||
option go_package = "./pb";
|
||||
|
||||
package pb;
|
||||
|
||||
import "models/model_node_action.proto";
|
||||
import "models/rpc_messages.proto";
|
||||
|
||||
// 节点动作服务
|
||||
service NodeActionService {
|
||||
// 添加动作
|
||||
rpc createNodeAction(CreateNodeActionRequest) returns (CreateNodeActionResponse);
|
||||
|
||||
// 删除动作
|
||||
rpc deleteNodeAction(DeleteNodeActionRequest) returns (RPCSuccess);
|
||||
|
||||
// 修改动作
|
||||
rpc updateNodeAction(UpdateNodeActionRequest) returns (RPCSuccess);
|
||||
|
||||
// 列出某个节点的所有动作
|
||||
rpc findAllNodeActions(FindAllNodeActionsRequest) returns (FindAllNodeActionsResponse);
|
||||
|
||||
// 查找单个节点动作
|
||||
rpc findNodeAction(FindNodeActionRequest) returns (FindNodeActionResponse);
|
||||
}
|
||||
|
||||
// 添加动作
|
||||
message CreateNodeActionRequest {
|
||||
int64 nodeId = 1; // 节点ID
|
||||
string role = 2; // 节点角色
|
||||
bytes condsJSON = 3; // 条件设置
|
||||
bytes actionJSON = 4; // 动作设置
|
||||
bytes durationJSON = 5; // 持续时间
|
||||
}
|
||||
|
||||
message CreateNodeActionResponse {
|
||||
int64 nodeActionId = 1;
|
||||
}
|
||||
|
||||
// 删除动作
|
||||
message DeleteNodeActionRequest {
|
||||
int64 nodeActionId = 1;
|
||||
}
|
||||
|
||||
// 修改动作
|
||||
message UpdateNodeActionRequest {
|
||||
int64 nodeActionId = 1; // 动作ID
|
||||
bytes condsJSON = 2;
|
||||
bytes actionJSON = 3;
|
||||
bytes durationJSON = 4; // 持续时间
|
||||
bool isOn = 5; // 是否启用
|
||||
}
|
||||
|
||||
// 列出某个节点的所有动作
|
||||
message FindAllNodeActionsRequest {
|
||||
int64 nodeId = 1; // 节点ID
|
||||
string role = 2; // 节点角色
|
||||
}
|
||||
|
||||
message FindAllNodeActionsResponse {
|
||||
repeated NodeAction nodeActions = 1; // 动作列表
|
||||
}
|
||||
|
||||
// 查找单个节点动作
|
||||
message FindNodeActionRequest {
|
||||
int64 nodeActionId = 1; // 动作ID
|
||||
}
|
||||
|
||||
message FindNodeActionResponse {
|
||||
NodeAction nodeAction = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user