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

123 lines
2.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# NodeValueService
> 节点指标数据服务
---
## createNodeValue
> 记录数据
- 角色:`dns`, `user`, `node`
- HTTP`POST https://backend.dooki.cloud/NodeValueService/createNodeValue`
- RPC`rpc createNodeValue (CreateNodeValueRequest) returns (RPCSuccess);`
**请求对象 (`CreateNodeValueRequest`)**
```json
{
"item": "string",
"valueJSON": "bytes",
"createdAt": "int64"
}
```
**响应对象 (`RPCSuccess`)**
```json
{}
```
**调用示例**
```bash
curl -X POST "https://backend.dooki.cloud/NodeValueService/createNodeValue" \
-H "Content-Type: application/json" \
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
-d '{
...
}'
```
---
## listNodeValues
> 读取数据
- 角色:`admin`
- HTTP`POST https://backend.dooki.cloud/NodeValueService/listNodeValues`
- RPC`rpc listNodeValues (ListNodeValuesRequest) returns (ListNodeValuesResponse);`
**请求对象 (`ListNodeValuesRequest`)**
```json
{
"role": "string",
"nodeId": "int64 // 节点ID",
"item": "string",
"range": "string"
}
```
**响应对象 (`ListNodeValuesResponse`)**
```json
{
"nodeValues": "[]NodeValue"
}
```
**调用示例**
```bash
curl -X POST "https://backend.dooki.cloud/NodeValueService/listNodeValues" \
-H "Content-Type: application/json" \
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
-d '{
...
}'
```
---
## sumAllNodeValueStats
> 读取所有节点的最新数据
- 角色:`admin`
- HTTP`POST https://backend.dooki.cloud/NodeValueService/sumAllNodeValueStats`
- RPC`rpc sumAllNodeValueStats(SumAllNodeValueStatsRequest) returns (SumAllNodeValueStatsResponse);`
**请求对象 (`SumAllNodeValueStatsRequest`)**
```json
{}
```
**响应对象 (`SumAllNodeValueStatsResponse`)**
```json
{
"totalTrafficBytesPerSecond": "int64",
"avgCPUUsage": "float",
"maxCPUUsage": "float",
"totalCPUCores": "int32",
"avgMemoryUsage": "float",
"maxMemoryUsage": "float",
"totalMemoryBytes": "int64",
"avgLoad1min": "float",
"maxLoad1min": "float",
"avgLoad5min": "float"
}
```
**调用示例**
```bash
curl -X POST "https://backend.dooki.cloud/NodeValueService/sumAllNodeValueStats" \
-H "Content-Type: application/json" \
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
-d '{
...
}'
```
---