4.6 KiB
4.6 KiB
NodeThresholdService
节点阈值服务
countAllEnabledNodeThresholds
计算阈值数量
- 角色:
admin - HTTP:
POST https://backend.dooki.cloud/NodeThresholdService/countAllEnabledNodeThresholds - RPC:
rpc countAllEnabledNodeThresholds (CountAllEnabledNodeThresholdsRequest) returns (RPCCountResponse);
请求对象 (CountAllEnabledNodeThresholdsRequest)
{
"role": "string",
"nodeClusterId": "int64 // 集群ID",
"nodeId": "int64 // 节点ID"
}
响应对象 (RPCCountResponse)
{
"count": "int64 // 数量"
}
调用示例
curl -X POST "https://backend.dooki.cloud/NodeThresholdService/countAllEnabledNodeThresholds" \
-H "Content-Type: application/json" \
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
-d '{
...
}'
createNodeThreshold
创建阈值
- 角色:
admin,node - HTTP:
POST https://backend.dooki.cloud/NodeThresholdService/createNodeThreshold - RPC:
rpc createNodeThreshold (CreateNodeThresholdRequest) returns (CreateNodeThresholdResponse);
请求对象 (CreateNodeThresholdRequest)
{
"role": "string",
"nodeClusterId": "int64 // 集群ID",
"nodeId": "int64 // 节点ID",
"item": "string",
"param": "string",
"operator": "string",
"valueJSON": "bytes",
"message": "string",
"duration": "int32",
"durationUnit": "string",
"sumMethod": "string",
"notifyDuration": "int32"
}
响应对象 (CreateNodeThresholdResponse)
{
"nodeThresholdId": "int64"
}
调用示例
curl -X POST "https://backend.dooki.cloud/NodeThresholdService/createNodeThreshold" \
-H "Content-Type: application/json" \
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
-d '{
...
}'
deleteNodeThreshold
删除阈值
- 角色:
admin - HTTP:
POST https://backend.dooki.cloud/NodeThresholdService/deleteNodeThreshold - RPC:
rpc deleteNodeThreshold (DeleteNodeThresholdRequest) returns (RPCSuccess);
请求对象 (DeleteNodeThresholdRequest)
{
"nodeThresholdId": "int64"
}
响应对象 (RPCSuccess)
{}
调用示例
curl -X POST "https://backend.dooki.cloud/NodeThresholdService/deleteNodeThreshold" \
-H "Content-Type: application/json" \
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
-d '{
...
}'
findAllEnabledNodeThresholds
查询阈值
- 角色:
admin - HTTP:
POST https://backend.dooki.cloud/NodeThresholdService/findAllEnabledNodeThresholds - RPC:
rpc findAllEnabledNodeThresholds (FindAllEnabledNodeThresholdsRequest) returns (FindAllEnabledNodeThresholdsResponse);
请求对象 (FindAllEnabledNodeThresholdsRequest)
{
"role": "string",
"nodeClusterId": "int64 // 集群ID",
"nodeId": "int64 // 节点ID"
}
响应对象 (FindAllEnabledNodeThresholdsResponse)
{
"nodeThresholds": "[]NodeThreshold"
}
调用示例
curl -X POST "https://backend.dooki.cloud/NodeThresholdService/findAllEnabledNodeThresholds" \
-H "Content-Type: application/json" \
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
-d '{
...
}'
findEnabledNodeThreshold
查询单个阈值详情
- 角色:
admin - HTTP:
POST https://backend.dooki.cloud/NodeThresholdService/findEnabledNodeThreshold - RPC:
rpc findEnabledNodeThreshold (FindEnabledNodeThresholdRequest) returns (FindEnabledNodeThresholdResponse);
请求对象 (FindEnabledNodeThresholdRequest)
{
"nodeThresholdId": "int64"
}
响应对象 (FindEnabledNodeThresholdResponse)
{
"nodeThreshold": "NodeThreshold"
}
调用示例
curl -X POST "https://backend.dooki.cloud/NodeThresholdService/findEnabledNodeThreshold" \
-H "Content-Type: application/json" \
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
-d '{
...
}'
updateNodeThreshold
修改阈值
- 角色:
admin - HTTP:
POST https://backend.dooki.cloud/NodeThresholdService/updateNodeThreshold - RPC:
rpc updateNodeThreshold (UpdateNodeThresholdRequest) returns (RPCSuccess);
请求对象 (UpdateNodeThresholdRequest)
{
"nodeThresholdId": "int64",
"item": "string",
"param": "string",
"operator": "string",
"valueJSON": "bytes",
"message": "string",
"duration": "int32",
"durationUnit": "string",
"sumMethod": "string",
"isOn": "bool // 是否启用",
"notifyDuration": "int32"
}
响应对象 (RPCSuccess)
{}
调用示例
curl -X POST "https://backend.dooki.cloud/NodeThresholdService/updateNodeThreshold" \
-H "Content-Type: application/json" \
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
-d '{
...
}'