Files
pyGoEdge-UserPanel/reference/goedge 文档/NodeThresholdService.md
2025-11-18 03:36:49 +08:00

4.6 KiB
Raw Blame History

NodeThresholdService

节点阈值服务


countAllEnabledNodeThresholds

计算阈值数量

  • 角色:admin
  • HTTPPOST https://backend.dooki.cloud/NodeThresholdService/countAllEnabledNodeThresholds
  • RPCrpc 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
  • HTTPPOST https://backend.dooki.cloud/NodeThresholdService/createNodeThreshold
  • RPCrpc 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
  • HTTPPOST https://backend.dooki.cloud/NodeThresholdService/deleteNodeThreshold
  • RPCrpc 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
  • HTTPPOST https://backend.dooki.cloud/NodeThresholdService/findAllEnabledNodeThresholds
  • RPCrpc 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
  • HTTPPOST https://backend.dooki.cloud/NodeThresholdService/findEnabledNodeThreshold
  • RPCrpc 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
  • HTTPPOST https://backend.dooki.cloud/NodeThresholdService/updateNodeThreshold
  • RPCrpc 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 '{
    ...
  }'