Files
EdgeCommon/pkg/rpc/protos/service_node_threshold.proto

95 lines
2.2 KiB
Protocol Buffer
Raw Normal View History

2021-05-04 21:02:21 +08:00
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/rpc_messages.proto";
import "models/model_node_threshold.proto";
// 节点阈值服务
service NodeThresholdService {
// 创建阈值
rpc createNodeThreshold (CreateNodeThresholdRequest) returns (CreateNodeThresholdResponse);
// 修改阈值
rpc updateNodeThreshold (UpdateNodeThresholdRequest) returns (RPCSuccess);
// 删除阈值
rpc deleteNodeThreshold (DeleteNodeThresholdRequest) returns (RPCSuccess);
// 查询阈值
rpc findAllEnabledNodeThresholds (FindAllEnabledNodeThresholdsRequest) returns (FindAllEnabledNodeThresholdsResponse);
// 计算阈值数量
rpc countAllEnabledNodeThresholds (CountAllEnabledNodeThresholdsRequest) returns (RPCCountResponse);
// 查询单个阈值详情
rpc findEnabledNodeThreshold (FindEnabledNodeThresholdRequest) returns (FindEnabledNodeThresholdResponse);
}
// 创建阈值
message CreateNodeThresholdRequest {
2021-05-05 19:51:46 +08:00
string role = 1;
int64 nodeClusterId = 2;
int64 nodeId = 3;
string item = 4;
string param = 5;
string operator = 6;
bytes valueJSON = 7;
string message = 8;
int32 duration = 9;
string durationUnit = 10;
string sumMethod = 11;
int32 notifyDuration = 12;
2021-05-04 21:02:21 +08:00
}
message CreateNodeThresholdResponse {
int64 nodeThresholdId = 1;
}
// 修改阈值
message UpdateNodeThresholdRequest {
int64 nodeThresholdId = 1;
string item = 2;
string param = 3;
string operator = 4;
bytes valueJSON = 5;
string message = 6;
int32 duration = 7;
string durationUnit = 8;
string sumMethod = 9;
bool isOn = 10;
2021-05-05 19:51:46 +08:00
int32 notifyDuration = 11;
2021-05-04 21:02:21 +08:00
}
// 删除阈值
message DeleteNodeThresholdRequest {
int64 nodeThresholdId = 1;
}
// 查询阈值
message FindAllEnabledNodeThresholdsRequest {
2021-05-05 19:51:46 +08:00
string role = 1;
int64 nodeClusterId = 2;
int64 nodeId = 3;
2021-05-04 21:02:21 +08:00
}
message FindAllEnabledNodeThresholdsResponse {
repeated NodeThreshold nodeThresholds = 1;
}
// 计算阈值数量
message CountAllEnabledNodeThresholdsRequest {
2021-05-05 19:51:46 +08:00
string role = 1;
int64 nodeClusterId = 2;
int64 nodeId = 3;
2021-05-04 21:02:21 +08:00
}
// 查询单个阈值详情
message FindEnabledNodeThresholdRequest {
int64 nodeThresholdId = 1;
}
message FindEnabledNodeThresholdResponse {
NodeThreshold nodeThreshold = 1;
}