# ReportNodeService
> 监控终端服务

---

## countAllEnabledReportNodes
> 计算终端数量

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ReportNodeService/countAllEnabledReportNodes`
- RPC：`rpc countAllEnabledReportNodes(CountAllEnabledReportNodesRequest) returns (RPCCountResponse);`

**请求对象 (`CountAllEnabledReportNodesRequest`)**

```json
{
  "keyword": "string // 关键词",
  "reportNodeGroupId": "int64"
}
```

**响应对象 (`RPCCountResponse`)**

```json
{
  "count": "int64 // 数量"
}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/ReportNodeService/countAllEnabledReportNodes" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## countAllReportNodeTasks
> 计算任务数量

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ReportNodeService/countAllReportNodeTasks`
- RPC：`rpc countAllReportNodeTasks(CountAllReportNodeTasksRequest) returns (RPCCountResponse);`

**请求对象 (`CountAllReportNodeTasksRequest`)**

```json
{
  "role": "string",
  "nodeClusterId": "int64 // 集群ID",
  "type": "string"
}
```

**响应对象 (`RPCCountResponse`)**

```json
{
  "count": "int64 // 数量"
}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/ReportNodeService/countAllReportNodeTasks" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## createReportNode
> 添加终端

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ReportNodeService/createReportNode`
- RPC：`rpc createReportNode(CreateReportNodeRequest) returns (CreateReportNodeResponse);`

**请求对象 (`CreateReportNodeRequest`)**

```json
{
  "name": "string // 名称",
  "location": "string",
  "isp": "string",
  "allowIPs": "[]string",
  "reportNodeGroupIds": "[]int64"
}
```

**响应对象 (`CreateReportNodeResponse`)**

```json
{
  "reportNodeId": "int64"
}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/ReportNodeService/createReportNode" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## deleteReportNode
> 删除终端

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ReportNodeService/deleteReportNode`
- RPC：`rpc deleteReportNode(DeleteReportNodeRequest) returns (RPCSuccess);`

**请求对象 (`DeleteReportNodeRequest`)**

```json
{
  "reportNodeId": "int64"
}
```

**响应对象 (`RPCSuccess`)**

```json
{}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/ReportNodeService/deleteReportNode" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## findEnabledReportNode
> 查找单个终端

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ReportNodeService/findEnabledReportNode`
- RPC：`rpc findEnabledReportNode(FindEnabledReportNodeRequest) returns (FindEnabledReportNodeResponse);`

**请求对象 (`FindEnabledReportNodeRequest`)**

```json
{
  "reportNodeId": "int64"
}
```

**响应对象 (`FindEnabledReportNodeResponse`)**

```json
{
  "reportNode": "ReportNode"
}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/ReportNodeService/findEnabledReportNode" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## findLatestReportNodeVersion
> 取得最新的版本号

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ReportNodeService/findLatestReportNodeVersion`
- RPC：`rpc findLatestReportNodeVersion(FindLatestReportNodeVersionRequest) returns (FindLatestReportNodeVersionResponse);`

**请求对象 (`FindLatestReportNodeVersionRequest`)**

```json
{}
```

**响应对象 (`FindLatestReportNodeVersionResponse`)**

```json
{
  "version": "string"
}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/ReportNodeService/findLatestReportNodeVersion" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## listEnabledReportNodes
> 列出单页终端

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ReportNodeService/listEnabledReportNodes`
- RPC：`rpc listEnabledReportNodes(ListEnabledReportNodesRequest) returns (ListEnabledReportNodesResponse);`

**请求对象 (`ListEnabledReportNodesRequest`)**

```json
{
  "keyword": "string // 关键词",
  "reportNodeGroupId": "int64",
  "offset": "int64 // 读取位置",
  "size": "int64 // 数量，通常不能小于0"
}
```

**响应对象 (`ListEnabledReportNodesResponse`)**

```json
{
  "reportNodes": "[]ReportNode"
}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/ReportNodeService/listEnabledReportNodes" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## listReportNodeTasks
> 列出单页任务

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ReportNodeService/listReportNodeTasks`
- RPC：`rpc listReportNodeTasks(ListReportNodeTasksRequest) returns (ListReportNodeTasksResponse);`

**请求对象 (`ListReportNodeTasksRequest`)**

```json
{
  "role": "string",
  "nodeClusterId": "int64 // 集群ID",
  "type": "string",
  "offset": "int64 // 读取位置",
  "size": "int64 // 数量，通常不能小于0"
}
```

**响应对象 (`ListReportNodeTasksResponse`)**

```json
{
  "ipAddrReportTasks": "[]IPAddrReportTask"
}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/ReportNodeService/listReportNodeTasks" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## readReportNodeGlobalSetting
> 读取全局设置

- 角色：`report`, `admin`
- HTTP：`POST https://backend.dooki.cloud/ReportNodeService/readReportNodeGlobalSetting`
- RPC：`rpc readReportNodeGlobalSetting(ReadReportNodeGlobalSettingRequest) returns (ReadReportNodeGlobalSettingResponse);`

**请求对象 (`ReadReportNodeGlobalSettingRequest`)**

```json
{}
```

**响应对象 (`ReadReportNodeGlobalSettingResponse`)**

```json
{
  "settingJSON": "bytes"
}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/ReportNodeService/readReportNodeGlobalSetting" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## updateReportNode
> 修改终端

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ReportNodeService/updateReportNode`
- RPC：`rpc updateReportNode(UpdateReportNodeRequest) returns (RPCSuccess);`

**请求对象 (`UpdateReportNodeRequest`)**

```json
{
  "reportNodeId": "int64",
  "name": "string // 名称",
  "location": "string",
  "isp": "string",
  "allowIPs": "[]string",
  "isOn": "bool // 是否启用",
  "reportNodeGroupIds": "[]int64"
}
```

**响应对象 (`RPCSuccess`)**

```json
{}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/ReportNodeService/updateReportNode" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---

## updateReportNodeGlobalSetting
> 修改全局设置

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ReportNodeService/updateReportNodeGlobalSetting`
- RPC：`rpc updateReportNodeGlobalSetting(UpdateReportNodeGlobalSetting) returns (RPCSuccess);`

**请求对象 (`UpdateReportNodeGlobalSetting`)**

```json
{
  "settingJSON": "bytes"
}
```

**响应对象 (`RPCSuccess`)**

```json
{}
```

**调用示例**

```bash
curl -X POST "https://backend.dooki.cloud/ReportNodeService/updateReportNodeGlobalSetting" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'
```

---
