mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-12-09 17:00:25 +08:00
实现基础的智能调度
This commit is contained in:
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