# NodeIPAddressService
> 节点IP地址服务

---

## countAllEnabledNodeIPAddresses
> 计算IP地址数量

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/NodeIPAddressService/countAllEnabledNodeIPAddresses`
- RPC：`rpc countAllEnabledNodeIPAddresses(CountAllEnabledNodeIPAddressesRequest) returns (RPCCountResponse);`

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

```json
{
  "nodeClusterId": "int64 // 集群ID",
  "role": "string",
  "upState": "int32",
  "keyword": "string // 关键词"
}
```

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

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

**调用示例**

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

---

## createNodeIPAddress
> 创建IP地址

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/NodeIPAddressService/createNodeIPAddress`
- RPC：`rpc createNodeIPAddress (CreateNodeIPAddressRequest) returns (CreateNodeIPAddressResponse);`

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

```json
{
  "nodeId": "int64 // 节点ID",
  "role": "string // 角色：node：边缘节点，dns：智能DNS节点",
  "name": "string // 名称",
  "ip": "string // IP地址",
  "canAccess": "bool // 是否能够访问",
  "isUp": "bool // 是否上线",
  "nodeClusterIds": "[]int64 // 可选项，所属集群ID列表，如果没有指定，则表示应用于节点所属的所有集群"
}
```

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

```json
{
  "nodeIPAddressId": "int64"
}
```

**调用示例**

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

---

## createNodeIPAddresses
> 批量创建IP地址

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/NodeIPAddressService/createNodeIPAddresses`
- RPC：`rpc createNodeIPAddresses (CreateNodeIPAddressesRequest) returns (CreateNodeIPAddressesResponse);`

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

```json
{
  "nodeId": "int64 // 节点ID",
  "role": "string",
  "name": "string // 名称",
  "ipList": "[]string",
  "canAccess": "bool",
  "isUp": "bool",
  "groupValue": "string",
  "nodeClusterIds": "[]int64 // 可选项，所属集群ID列表，如果没有指定，则表示应用于节点所属的所有集群"
}
```

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

```json
{
  "nodeIPAddressIds": "[]int64"
}
```

**调用示例**

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

---

## disableAllNodeIPAddressesWithNodeId
> 禁用节点的所有IP地址

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/NodeIPAddressService/disableAllNodeIPAddressesWithNodeId`
- RPC：`rpc disableAllNodeIPAddressesWithNodeId (DisableAllNodeIPAddressesWithNodeIdRequest) returns (DisableAllNodeIPAddressesWithNodeIdResponse);`

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

```json
{
  "nodeId": "int64 // 节点ID",
  "role": "string"
}
```

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

```json
{}
```

**调用示例**

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

---

## disableNodeIPAddress
> 禁用单个IP地址

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/NodeIPAddressService/disableNodeIPAddress`
- RPC：`rpc disableNodeIPAddress (DisableNodeIPAddressRequest) returns (DisableNodeIPAddressResponse);`

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

```json
{
  "nodeIPAddressId": "int64"
}
```

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

```json
{}
```

**调用示例**

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

---

## findAllEnabledNodeIPAddressesWithNodeId
> 查找节点的所有地址

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/NodeIPAddressService/findAllEnabledNodeIPAddressesWithNodeId`
- RPC：`rpc findAllEnabledNodeIPAddressesWithNodeId (FindAllEnabledNodeIPAddressesWithNodeIdRequest) returns (FindAllEnabledNodeIPAddressesWithNodeIdResponse);`

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

```json
{
  "nodeId": "int64 // 节点ID",
  "role": "string"
}
```

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

```json
{
  "nodeIPAddresses": "[]NodeIPAddress"
}
```

**调用示例**

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

---

## findEnabledNodeIPAddress
> 查找单个IP地址

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/NodeIPAddressService/findEnabledNodeIPAddress`
- RPC：`rpc findEnabledNodeIPAddress (FindEnabledNodeIPAddressRequest) returns (FindEnabledNodeIPAddressResponse);`

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

```json
{
  "nodeIPAddressId": "int64"
}
```

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

```json
{
  "nodeIPAddress": "NodeIPAddress"
}
```

**调用示例**

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

---

## listEnabledNodeIPAddresses
> 列出单页IP地址

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/NodeIPAddressService/listEnabledNodeIPAddresses`
- RPC：`rpc listEnabledNodeIPAddresses(ListEnabledNodeIPAddressesRequest) returns (ListEnabledNodeIPAddressesResponse);`

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

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

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

```json
{
  "nodeIPAddresses": "[]NodeIPAddress"
}
```

**调用示例**

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

---

## restoreNodeIPAddressBackupIP
> 还原备用IP状态

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/NodeIPAddressService/restoreNodeIPAddressBackupIP`
- RPC：`rpc restoreNodeIPAddressBackupIP(RestoreNodeIPAddressBackupIPRequest) returns (RPCSuccess);`

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

```json
{
  "nodeIPAddressId": "int64"
}
```

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

```json
{}
```

**调用示例**

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

---

## updateNodeIPAddress
> 修改IP地址

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/NodeIPAddressService/updateNodeIPAddress`
- RPC：`rpc updateNodeIPAddress (UpdateNodeIPAddressRequest) returns (RPCSuccess);`

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

```json
{
  "nodeIPAddressId": "int64 // IP地址ID",
  "name": "string // 名称",
  "ip": "string",
  "canAccess": "bool // 是否能够访问",
  "isOn": "bool // 是否启用",
  "isUp": "bool // 是否上线",
  "clusterIds": "[]int64 // 可选项，所属集群ID列表，如果没有指定，则表示应用于节点所属的所有集群"
}
```

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

```json
{}
```

**调用示例**

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

---

## updateNodeIPAddressIsUp
> 设置上下线状态

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/NodeIPAddressService/updateNodeIPAddressIsUp`
- RPC：`rpc updateNodeIPAddressIsUp(UpdateNodeIPAddressIsUpRequest) returns (RPCSuccess);`

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

```json
{
  "nodeIPAddressId": "int64",
  "isUp": "bool"
}
```

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

```json
{}
```

**调用示例**

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

---

## updateNodeIPAddressNodeId
> 修改IP地址所属节点

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/NodeIPAddressService/updateNodeIPAddressNodeId`
- RPC：`rpc updateNodeIPAddressNodeId (UpdateNodeIPAddressNodeIdRequest) returns (RPCSuccess);`

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

```json
{
  "nodeIPAddressId": "int64",
  "nodeId": "int64 // 节点ID"
}
```

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

```json
{}
```

**调用示例**

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

---
