Initial commit
This commit is contained in:
234
reference/goedge 文档/MetricItemService.md
Normal file
234
reference/goedge 文档/MetricItemService.md
Normal file
@@ -0,0 +1,234 @@
|
||||
# MetricItemService
|
||||
> 指标相关服务
|
||||
|
||||
---
|
||||
|
||||
## countAllEnabledMetricItems
|
||||
> 计算指标数量
|
||||
|
||||
- 角色:`admin`
|
||||
- HTTP:`POST https://backend.dooki.cloud/MetricItemService/countAllEnabledMetricItems`
|
||||
- RPC:`rpc countAllEnabledMetricItems (CountAllEnabledMetricItemsRequest) returns (RPCCountResponse);`
|
||||
|
||||
**请求对象 (`CountAllEnabledMetricItemsRequest`)**
|
||||
|
||||
```json
|
||||
{
|
||||
"category": "string"
|
||||
}
|
||||
```
|
||||
|
||||
**响应对象 (`RPCCountResponse`)**
|
||||
|
||||
```json
|
||||
{
|
||||
"count": "int64 // 数量"
|
||||
}
|
||||
```
|
||||
|
||||
**调用示例**
|
||||
|
||||
```bash
|
||||
curl -X POST "https://backend.dooki.cloud/MetricItemService/countAllEnabledMetricItems" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
|
||||
-d '{
|
||||
...
|
||||
}'
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## createMetricItem
|
||||
> 创建指标
|
||||
|
||||
- 角色:`admin`
|
||||
- HTTP:`POST https://backend.dooki.cloud/MetricItemService/createMetricItem`
|
||||
- RPC:`rpc createMetricItem (CreateMetricItemRequest) returns (CreateMetricItemResponse);`
|
||||
|
||||
**请求对象 (`CreateMetricItemRequest`)**
|
||||
|
||||
```json
|
||||
{
|
||||
"code": "string",
|
||||
"category": "string",
|
||||
"name": "string // 名称",
|
||||
"keys": "[]string",
|
||||
"period": "int32",
|
||||
"periodUnit": "string",
|
||||
"expiresPeriod": "int32",
|
||||
"value": "string",
|
||||
"isPublic": "bool"
|
||||
}
|
||||
```
|
||||
|
||||
**响应对象 (`CreateMetricItemResponse`)**
|
||||
|
||||
```json
|
||||
{
|
||||
"metricItemId": "int64"
|
||||
}
|
||||
```
|
||||
|
||||
**调用示例**
|
||||
|
||||
```bash
|
||||
curl -X POST "https://backend.dooki.cloud/MetricItemService/createMetricItem" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
|
||||
-d '{
|
||||
...
|
||||
}'
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## deleteMetricItem
|
||||
> 删除指标
|
||||
|
||||
- 角色:`admin`
|
||||
- HTTP:`POST https://backend.dooki.cloud/MetricItemService/deleteMetricItem`
|
||||
- RPC:`rpc deleteMetricItem (DeleteMetricItemRequest) returns (RPCSuccess);`
|
||||
|
||||
**请求对象 (`DeleteMetricItemRequest`)**
|
||||
|
||||
```json
|
||||
{
|
||||
"metricItemId": "int64"
|
||||
}
|
||||
```
|
||||
|
||||
**响应对象 (`RPCSuccess`)**
|
||||
|
||||
```json
|
||||
{}
|
||||
```
|
||||
|
||||
**调用示例**
|
||||
|
||||
```bash
|
||||
curl -X POST "https://backend.dooki.cloud/MetricItemService/deleteMetricItem" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
|
||||
-d '{
|
||||
...
|
||||
}'
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## findEnabledMetricItem
|
||||
> 查找单个指标信息
|
||||
|
||||
- 角色:`admin`
|
||||
- HTTP:`POST https://backend.dooki.cloud/MetricItemService/findEnabledMetricItem`
|
||||
- RPC:`rpc findEnabledMetricItem (FindEnabledMetricItemRequest) returns (FindEnabledMetricItemResponse);`
|
||||
|
||||
**请求对象 (`FindEnabledMetricItemRequest`)**
|
||||
|
||||
```json
|
||||
{
|
||||
"metricItemId": "int64"
|
||||
}
|
||||
```
|
||||
|
||||
**响应对象 (`FindEnabledMetricItemResponse`)**
|
||||
|
||||
```json
|
||||
{
|
||||
"metricItem": "MetricItem"
|
||||
}
|
||||
```
|
||||
|
||||
**调用示例**
|
||||
|
||||
```bash
|
||||
curl -X POST "https://backend.dooki.cloud/MetricItemService/findEnabledMetricItem" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
|
||||
-d '{
|
||||
...
|
||||
}'
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## listEnabledMetricItems
|
||||
> 列出单页指标
|
||||
|
||||
- 角色:`admin`
|
||||
- HTTP:`POST https://backend.dooki.cloud/MetricItemService/listEnabledMetricItems`
|
||||
- RPC:`rpc listEnabledMetricItems (ListEnabledMetricItemsRequest) returns (ListEnabledMetricItemsResponse);`
|
||||
|
||||
**请求对象 (`ListEnabledMetricItemsRequest`)**
|
||||
|
||||
```json
|
||||
{
|
||||
"category": "string",
|
||||
"offset": "int64 // 读取位置",
|
||||
"size": "int64 // 数量,通常不能小于0"
|
||||
}
|
||||
```
|
||||
|
||||
**响应对象 (`ListEnabledMetricItemsResponse`)**
|
||||
|
||||
```json
|
||||
{
|
||||
"metricItems": "[]MetricItem"
|
||||
}
|
||||
```
|
||||
|
||||
**调用示例**
|
||||
|
||||
```bash
|
||||
curl -X POST "https://backend.dooki.cloud/MetricItemService/listEnabledMetricItems" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
|
||||
-d '{
|
||||
...
|
||||
}'
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## updateMetricItem
|
||||
> 修改指标
|
||||
|
||||
- 角色:`admin`
|
||||
- HTTP:`POST https://backend.dooki.cloud/MetricItemService/updateMetricItem`
|
||||
- RPC:`rpc updateMetricItem (UpdateMetricItemRequest) returns (RPCSuccess);`
|
||||
|
||||
**请求对象 (`UpdateMetricItemRequest`)**
|
||||
|
||||
```json
|
||||
{
|
||||
"metricItemId": "int64",
|
||||
"name": "string // 名称",
|
||||
"keys": "[]string",
|
||||
"period": "int32",
|
||||
"periodUnit": "string",
|
||||
"expiresPeriod": "int32",
|
||||
"value": "string",
|
||||
"isOn": "bool // 是否启用",
|
||||
"isPublic": "bool"
|
||||
}
|
||||
```
|
||||
|
||||
**响应对象 (`RPCSuccess`)**
|
||||
|
||||
```json
|
||||
{}
|
||||
```
|
||||
|
||||
**调用示例**
|
||||
|
||||
```bash
|
||||
curl -X POST "https://backend.dooki.cloud/MetricItemService/updateMetricItem" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
|
||||
-d '{
|
||||
...
|
||||
}'
|
||||
```
|
||||
|
||||
---
|
||||
Reference in New Issue
Block a user