# ServerService
> 网站服务相关服务

---

## addServerOrigin
> 为网站添加源站

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/addServerOrigin`
- RPC：`rpc addServerOrigin(AddServerOriginRequest) returns (RPCSuccess);`

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

```json
{
  "serverId": "int64 // 网站ID",
  "originId": "int64 // 源站ID，通过 OriginService 创建和查询",
  "isPrimary": "bool // 是否为主要源站"
}
```

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

```json
{}
```

**调用示例**

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

---

## checkServerNameDuplicationInNodeCluster
> 检查域名是否在集群中已经存在

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/checkServerNameDuplicationInNodeCluster`
- RPC：`rpc checkServerNameDuplicationInNodeCluster (CheckServerNameDuplicationInNodeClusterRequest) returns (CheckServerNameDuplicationInNodeClusterResponse);`

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

```json
{
  "nodeClusterId": "int64 // 集群ID",
  "serverNames": "[]string // 可以同时检查一批域名",
  "excludeServerId": "int64 // 要排除的网站ID",
  "supportWildcard": "bool // 支持泛解析"
}
```

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

```json
{
  "duplicatedServerNames": "[]string"
}
```

**调用示例**

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

---

## checkServerNameInServer
> 检查域名是否在网站中已经绑定

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/checkServerNameInServer`
- RPC：`rpc checkServerNameInServer(CheckServerNameInServerRequest) returns (CheckServerNameInServerResponse);`

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

```json
{
  "serverId": "int64 // 网站ID",
  "serverName": "string // 域名"
}
```

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

```json
{
  "exists": "bool // 是否存在"
}
```

**调用示例**

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

---

## checkUserServer
> 检查网站是否属于某个用户

- 角色：`user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/checkUserServer`
- RPC：`rpc checkUserServer (CheckUserServerRequest) returns (RPCSuccess);`

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

```json
{
  "serverId": "int64 // 网站ID"
}
```

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

```json
{}
```

**调用示例**

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

---

## copyServerConfig
> 在网站之间复制配置

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/copyServerConfig`
- RPC：`rpc copyServerConfig(CopyServerConfigRequest) returns (RPCSuccess);`

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

```json
{
  "serverId": "int64 // 被复制网站ID",
  "configCode": "string // 要拷贝的配置代号：stat 统计；charset 字符编码；userAgent UA名单；referers 防盗链；webp WebP配置；accessLog 访问日志；cc CC配置；hostRedirects URL跳转；root ROOT配置；remoteAddr 访客设置；requestLimit 请求限制；compression 内容压缩设置；optimization 页面优化设置；cache 缓存设置；uam 五秒盾设置；websocket Websocket设置；pages 自定义页面设置；auth 访问鉴权；reverseProxy 反向代理设置；waf WAF设置",
  "targetType": "string // 目标类型：servers, groups, cluster（当前集群下所有网站，只有管理员才有权限）、user（当前用户下所有网站）",
  "targetServerIds": "[]int64 // 目标网站ID列表",
  "targetServerGroupIds": "[]int64 // 目标网站分组ID列表",
  "targetClusterId": "int64 // 目标集群ID",
  "targetUserId": "int64 // 目标用户ID",
  "wafCopyRegions": "bool // 可选项，WAF独立配置：是否拷贝区域封禁设置"
}
```

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

```json
{}
```

**调用示例**

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

---

## countAllEnabledServersMatch
> 计算匹配的网站数量

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/countAllEnabledServersMatch`
- RPC：`rpc countAllEnabledServersMatch (CountAllEnabledServersMatchRequest) returns (RPCCountResponse);`

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

```json
{
  "serverGroupId": "int64 // 网站分组ID，如果为-1表示查找未分组",
  "keyword": "string // 关键词",
  "userId": "int64 // 用户ID",
  "nodeClusterId": "int64 // 集群ID",
  "auditingFlag": "int32",
  "protocolFamily": "string",
  "userPlanId": "int64 // 用户套餐ID"
}
```

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

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

**调用示例**

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

---

## countAllEnabledServersWithNodeClusterId
> 计算运行在某个集群上的所有网站数量

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ServerService/countAllEnabledServersWithNodeClusterId`
- RPC：`rpc countAllEnabledServersWithNodeClusterId (CountAllEnabledServersWithNodeClusterIdRequest) returns (RPCCountResponse);`

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

```json
{
  "nodeClusterId": "int64 // 集群ID"
}
```

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

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

**调用示例**

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

---

## countAllEnabledServersWithSSLCertId
> 计算使用某个SSL证书的网站数量

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/countAllEnabledServersWithSSLCertId`
- RPC：`rpc countAllEnabledServersWithSSLCertId (CountAllEnabledServersWithSSLCertIdRequest) returns (RPCCountResponse);`

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

```json
{
  "sslCertId": "int64"
}
```

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

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

**调用示例**

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

---

## countAllEnabledServersWithServerGroupId
> 计算使用某个分组的网站数量

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/countAllEnabledServersWithServerGroupId`
- RPC：`rpc countAllEnabledServersWithServerGroupId (CountAllEnabledServersWithServerGroupIdRequest) returns (RPCCountResponse);`

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

```json
{
  "serverGroupId": "int64 // 服务分组ID（网站分组ID）"
}
```

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

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

**调用示例**

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

---

## countAllServerNamesWithUserId
> 计算一个用户下的所有域名数量

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/countAllServerNamesWithUserId`
- RPC：`rpc countAllServerNamesWithUserId (CountAllServerNamesWithUserIdRequest) returns (RPCCountResponse);`

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

```json
{
  "userId": "int64 // 用户ID",
  "userPlanId": "int64 // 用户套餐ID"
}
```

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

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

**调用示例**

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

---

## countAllUserServers
> 计算一个用户下的所有网站数量

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/countAllUserServers`
- RPC：`rpc countAllUserServers(CountAllUserServersRequest) returns (RPCCountResponse);`

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

```json
{
  "userId": "int64 // 用户ID",
  "userPlanId": "int64 // 用户套餐ID"
}
```

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

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

**调用示例**

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

---

## countServerNames
> 计算某个网站下的域名数量

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/countServerNames`
- RPC：`rpc countServerNames(CountServerNamesRequest) returns (RPCCountResponse);`

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

```json
{
  "serverId": "int64 // 网站ID"
}
```

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

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

**调用示例**

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

---

## createBasicHTTPServer
> 快速创建基本的HTTP网站

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/createBasicHTTPServer`
- RPC：`rpc createBasicHTTPServer(CreateBasicHTTPServerRequest) returns (CreateBasicHTTPServerResponse);`

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

```json
{
  "nodeClusterId": "int64 // 部署的集群ID，用户创建时不需要指定此项",
  "userId": "int64 // 管理员创建网站时可以指定此用户ID，也可以为0表示不指定",
  "domains": "[]string // 域名列表",
  "sslCertIds": "[]int64 // HTTPS用到的证书ID列表",
  "originAddrs": "[]string // 源站地址列表，每一个源站地址需要带协议部分，比如 http://example.com",
  "enableWebsocket": "bool // 可选项，是否启用Websocket"
}
```

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

```json
{
  "serverId": "int64 // 所创建的网站ID"
}
```

**调用示例**

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

---

## createBasicTCPServer
> 快速创建基本的TCP网站

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/createBasicTCPServer`
- RPC：`rpc createBasicTCPServer(CreateBasicTCPServerRequest) returns (CreateBasicTCPServerResponse);`

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

```json
{
  "nodeClusterId": "int64 // 部署的集群ID，用户创建时不需要指定此项",
  "userId": "int64 // 管理员创建网站时可以指定此用户ID，也可以为0表示不指定",
  "tcpPorts": "[]int32 // TCP端口",
  "tlsPorts": "[]int32 // TLS端口",
  "sslCertIds": "[]int64 // TLS用到的证书ID列表",
  "originAddrs": "[]string // 源站地址列表，每一个源站地址需要带协议部分，比如 tcp://example.com, tls://example.com"
}
```

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

```json
{
  "serverId": "int64 // 所创建的网站ID"
}
```

**调用示例**

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

---

## createServer
> 创建网站

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/createServer`
- RPC：`rpc createServer (CreateServerRequest) returns (CreateServerResponse);`

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

```json
{
  "userId": "int64 // 可选项，用户ID，如果不想指定用户，此值可以为0",
  "adminId": "int64 // 可选项，管理员ID",
  "type": "string // 类型：httpProxy（HTTP反向代理，一般CDN服务都选这个）、httpWeb（静态文件服务，只会从服务器上读取文件内容，不会转发到源站）、tcpProxy（TCP反向代理）、udpProxy（UDP反向代理）、pages （静态网站）",
  "name": "string // 网站名称，通常可以是一个域名",
  "description": "string // 可选项，网站描述",
  "serverNamesJSON": "bytes // 域名列表 json:server_names",
  "httpJSON": "bytes // HTTP协议设置，当type为httpProxy或者httpWeb时填写 json:http_protocol",
  "httpsJSON": "bytes // HTTPS协议设置，当type为httpProxy或者httpWeb时填写 json:https_protocol",
  "tcpJSON": "bytes // TCP协议设置，当type为tcpProxy时填写 json:tcp_protocol",
  "tlsJSON": "bytes // TLS协议设置，当type为tcpProxy时填写 json:tls_protocol",
  "udpJSON": "bytes // UDP协议设置，当type为udpProxy时填写 json:udp_protocol",
  "webId": "int64 // 可选项，Web配置ID，当type为httpProxy或者httpWeb时填写，可以通过 /HTTPWebService/createHTTPWeb 接口创建；如果你需要配置缓存等信息时需要在 HTTPWebService 接口操作",
  "reverseProxyJSON": "bytes // 反向代理（包含源站）配置引用，此项可以在创建网站后再设置 json:reverse_proxy_ref",
  "serverGroupIds": "[]int64 // 可选项，所属网站分组ID列表",
  "userPlanId": "int64 // 可选项，套餐ID",
  "nodeClusterId": "int64 // 所部署的集群ID",
  "includeNodesJSON": "bytes // 备用参数，不用填写",
  "excludeNodesJSON": "bytes // 备用参数，不用填写"
}
```

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

```json
{
  "serverId": "int64 // 所创建的网站ID"
}
```

**调用示例**

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

---

## deleteServer
> 删除某网站

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/deleteServer`
- RPC：`rpc deleteServer (DeleteServerRequest) returns (RPCSuccess);`

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

```json
{
  "serverId": "int64 // 网站ID"
}
```

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

```json
{}
```

**调用示例**

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

---

## deleteServerOrigin
> 从网站中删除某个源站

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/deleteServerOrigin`
- RPC：`rpc deleteServerOrigin(DeleteServerOriginRequest) returns (RPCSuccess);`

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

```json
{
  "serverId": "int64 // 网站ID",
  "originId": "int64 // 源站ID，通过 OriginService 创建和查询"
}
```

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

```json
{}
```

**调用示例**

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

---

## deleteServers
> 删除一组网站

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/deleteServers`
- RPC：`rpc deleteServers(DeleteServersRequest) returns (RPCSuccess);`

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

```json
{
  "serverIds": "[]int64 // 网站ID列表：[1, 2, ...]"
}
```

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

```json
{}
```

**调用示例**

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

---

## findAllEnabledServerNamesWithUserId
> 查找一个用户下的所有域名列表

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/findAllEnabledServerNamesWithUserId`
- RPC：`rpc findAllEnabledServerNamesWithUserId (FindAllEnabledServerNamesWithUserIdRequest) returns (FindAllEnabledServerNamesWithUserIdResponse);`

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

```json
{
  "userId": "int64 // 用户ID"
}
```

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

```json
{
  "serverNames": "[]string"
}
```

**调用示例**

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

---

## findAllEnabledServersDNSWithNodeClusterId
> 取得某个集群下的所有网站相关的DNS

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ServerService/findAllEnabledServersDNSWithNodeClusterId`
- RPC：`rpc findAllEnabledServersDNSWithNodeClusterId (FindAllEnabledServersDNSWithNodeClusterIdRequest) returns (FindAllEnabledServersDNSWithNodeClusterIdResponse);`

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

```json
{
  "nodeClusterId": "int64 // 集群ID"
}
```

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

```json
{
  "servers": "[]ServerDNSInfo"
}
```

**调用示例**

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

---

## findAllEnabledServersWithSSLCertId
> 查找使用某个SSL证书的所有网站

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/findAllEnabledServersWithSSLCertId`
- RPC：`rpc findAllEnabledServersWithSSLCertId (FindAllEnabledServersWithSSLCertIdRequest) returns (FindAllEnabledServersWithSSLCertIdResponse);`

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

```json
{
  "sslCertId": "int64"
}
```

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

```json
{
  "servers": "[]Server"
}
```

**调用示例**

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

---

## findAllUserServers
> 查找一个用户下的所有网站

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/findAllUserServers`
- RPC：`rpc findAllUserServers(FindAllUserServersRequest) returns (FindAllUserServersResponse);`

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

```json
{
  "userId": "int64 // 用户ID"
}
```

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

```json
{
  "servers": "[]Server // 只返回一些简要信息"
}
```

**调用示例**

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

---

## findAndInitServerReverseProxyConfig
> 查找反向代理设置

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/findAndInitServerReverseProxyConfig`
- RPC：`rpc findAndInitServerReverseProxyConfig (FindAndInitServerReverseProxyConfigRequest) returns (FindAndInitServerReverseProxyConfigResponse);`

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

```json
{
  "serverId": "int64 // 网站ID"
}
```

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

```json
{
  "reverseProxyJSON": "bytes",
  "reverseProxyRefJSON": "bytes"
}
```

**调用示例**

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

---

## findAndInitServerWebConfig
> 初始化Web设置

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/findAndInitServerWebConfig`
- RPC：`rpc findAndInitServerWebConfig (FindAndInitServerWebConfigRequest) returns (FindAndInitServerWebConfigResponse);`

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

```json
{
  "serverId": "int64 // 网站ID"
}
```

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

```json
{
  "webJSON": "bytes"
}
```

**调用示例**

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

---

## findEnabledServer
> 查找单个网站

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/findEnabledServer`
- RPC：`rpc findEnabledServer (FindEnabledServerRequest) returns (FindEnabledServerResponse);`

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

```json
{
  "serverId": "int64 // 网站ID",
  "ignoreSSLCerts": "bool // 忽略SSL证书数据"
}
```

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

```json
{
  "server": "Server // 网站信息"
}
```

**调用示例**

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

---

## findEnabledServerConfig
> 查找网站配置

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/findEnabledServerConfig`
- RPC：`rpc findEnabledServerConfig (FindEnabledServerConfigRequest) returns (FindEnabledServerConfigResponse);`

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

```json
{
  "serverId": "int64 // 网站ID"
}
```

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

```json
{
  "serverJSON": "bytes"
}
```

**调用示例**

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

---

## findEnabledServerDNS
> 查找单个网站的DNS信息

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/findEnabledServerDNS`
- RPC：`rpc findEnabledServerDNS (FindEnabledServerDNSRequest) returns (FindEnabledServerDNSResponse);`

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

```json
{
  "serverId": "int64 // 网站ID"
}
```

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

```json
{
  "dnsName": "string",
  "domain": "DNSDomain",
  "supportCNAME": "bool"
}
```

**调用示例**

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

---

## findEnabledServerTrafficLimit
> 查找流量限制

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/findEnabledServerTrafficLimit`
- RPC：`rpc findEnabledServerTrafficLimit(FindEnabledServerTrafficLimitRequest) returns (FindEnabledServerTrafficLimitResponse);`

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

```json
{
  "serverId": "int64 // 网站ID"
}
```

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

```json
{
  "trafficLimitJSON": "bytes"
}
```

**调用示例**

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

---

## findEnabledServerType
> 查找网站的网站类型

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/findEnabledServerType`
- RPC：`rpc findEnabledServerType (FindEnabledServerTypeRequest) returns (FindEnabledServerTypeResponse);`

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

```json
{
  "serverId": "int64 // 网站ID"
}
```

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

```json
{
  "type": "string"
}
```

**调用示例**

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

---

## findEnabledServerUAM
> 查找网站UAM设置

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/findEnabledServerUAM`
- RPC：`rpc findEnabledServerUAM(FindEnabledServerUAMRequest) returns (FindEnabledServerUAMResponse);`

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

```json
{
  "serverId": "int64 // 网站ID"
}
```

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

```json
{
  "uamJSON": "bytes // UAM设置"
}
```

**调用示例**

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

---

## findEnabledUserServerBasic
> 查找用户网站基本信息

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/findEnabledUserServerBasic`
- RPC：`rpc findEnabledUserServerBasic (FindEnabledUserServerBasicRequest) returns (FindEnabledUserServerBasicResponse);`

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

```json
{
  "serverId": "int64 // 网站ID"
}
```

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

```json
{
  "server": "Server"
}
```

**调用示例**

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

---

## findLatestServers
> 查找最近访问的网站

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ServerService/findLatestServers`
- RPC：`rpc findLatestServers (FindLatestServersRequest) returns (FindLatestServersResponse);`

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

```json
{
  "size": "int64 // 数量，通常不能小于0"
}
```

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

```json
{
  "servers": "[]Server"
}
```

**调用示例**

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

---

## findNearbyServers
> 查找某个网站附近的网站

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ServerService/findNearbyServers`
- RPC：`rpc findNearbyServers(FindNearbyServersRequest) returns (FindNearbyServersResponse);`

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

```json
{
  "serverId": "int64 // 网站ID"
}
```

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

```json
{
  "scope": "string // 范围 cluster|group",
  "groups": "[]GroupInfo",
  "name": "string // 名称",
  "servers": "[]Server"
}
```

**调用示例**

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

---

## findServerAuditingPrompt
> 获取域名审核时的提示文字

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/findServerAuditingPrompt`
- RPC：`rpc findServerAuditingPrompt(FindServerAuditingPromptRequest) returns (FindServerAuditingPromptResponse);`

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

```json
{
  "serverId": "int64 // 网站ID"
}
```

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

```json
{
  "promptText": "string // 提示文字"
}
```

**调用示例**

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

---

## findServerIdWithDNSName
> 使用CNAME查找网站

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ServerService/findServerIdWithDNSName`
- RPC：`rpc findServerIdWithDNSName(FindServerIdWithDNSNameRequest) returns (FindServerIdWithDNSNameResponse);`

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

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

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

```json
{
  "serverId": "int64 // 网站ID"
}
```

**调用示例**

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

---

## findServerNames
> 查找网站的域名设置

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/findServerNames`
- RPC：`rpc findServerNames (FindServerNamesRequest) returns (FindServerNamesResponse);`

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

```json
{
  "serverId": "int64 // 网站ID"
}
```

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

```json
{
  "serverNamesJSON": "bytes // 域名列表 json:server_names",
  "isAuditing": "bool",
  "auditingAt": "int64",
  "auditingServerNamesJSON": "bytes",
  "auditingResult": "ServerNameAuditingResult"
}
```

**调用示例**

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

---

## findServerUserPlan
> 获取网站套餐信息

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/findServerUserPlan`
- RPC：`rpc findServerUserPlan(FindServerUserPlanRequest) returns (FindServerUserPlanResponse);`

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

```json
{
  "serverId": "int64 // 网站ID"
}
```

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

```json
{
  "userPlan": "UserPlan"
}
```

**调用示例**

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

---

## listEnabledServersMatch
> 列出单页网站

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/listEnabledServersMatch`
- RPC：`rpc listEnabledServersMatch (ListEnabledServersMatchRequest) returns (ListEnabledServersMatchResponse);`

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

```json
{
  "offset": "int64 // 读取位置",
  "size": "int64 // 数量，通常不能小于0",
  "serverGroupId": "int64 // 网站分组ID，如果为-1表示查找未分组",
  "keyword": "string // 关键词",
  "userId": "int64 // 用户ID",
  "nodeClusterId": "int64 // 集群ID",
  "auditingFlag": "int32",
  "protocolFamily": "string",
  "trafficOutAsc": "bool // 是否流量正排序",
  "trafficOutDesc": "bool // 是否流量倒排序",
  "requestsAsc": "bool // 请求数正排序",
  "requestsDesc": "bool // 请求数倒排序",
  "attackRequestsAsc": "bool // 攻击请求数正排序",
  "attackRequestsDesc": "bool // 攻击请求数倒排序",
  "ignoreServerNames": "bool // 忽略域名",
  "ignoreSSLCerts": "bool // 忽略证书"
}
```

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

```json
{
  "servers": "[]Server"
}
```

**调用示例**

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

---

## notifyServersChange
> 通知更新

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ServerService/notifyServersChange`
- RPC：`rpc notifyServersChange (NotifyServersChangeRequest) returns (NotifyServersChangeResponse);`

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

```json
{}
```

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

```json
{}
```

**调用示例**

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

---

## purgeServerCache
> 清除缓存

- 角色：`node`, `admin`
- HTTP：`POST https://backend.dooki.cloud/ServerService/purgeServerCache`
- RPC：`rpc purgeServerCache(PurgeServerCacheRequest) returns (PurgeServerCacheResponse);`

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

```json
{
  "keys": "[]string",
  "prefixes": "[]string",
  "description": "string // 任务描述"
}
```

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

```json
{
  "isOk": "bool",
  "message": "string"
}
```

**调用示例**

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

---

## regenerateServerDNSName
> 重新生成CNAME

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ServerService/regenerateServerDNSName`
- RPC：`rpc regenerateServerDNSName(RegenerateServerDNSNameRequest) returns (RPCSuccess);`

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

```json
{
  "serverId": "int64 // 网站ID"
}
```

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

```json
{}
```

**调用示例**

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

---

## updateEnabledUserServerBasic
> 修改用户网站基本信息

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/updateEnabledUserServerBasic`
- RPC：`rpc updateEnabledUserServerBasic (UpdateEnabledUserServerBasicRequest) returns (RPCSuccess);`

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

```json
{
  "serverId": "int64 // 网站ID",
  "name": "string // 名称"
}
```

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

```json
{}
```

**调用示例**

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

---

## updateServerBasic
> 修改网站基本信息

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ServerService/updateServerBasic`
- RPC：`rpc updateServerBasic (UpdateServerBasicRequest) returns (RPCSuccess);`

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

```json
{
  "serverId": "int64 // 网站ID",
  "name": "string // 网站名称",
  "description": "string // 可选项，网站描述",
  "nodeClusterId": "int64 // 集群ID",
  "keepOldConfigs": "bool // 可选项，是否在老节点上保留一段时间配置",
  "isOn": "bool // 是否启用",
  "serverGroupIds": "[]int64 // 可选项，网站分组ID列表"
}
```

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

```json
{}
```

**调用示例**

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

---

## updateServerDNS
> 修改网站的DNS相关设置

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ServerService/updateServerDNS`
- RPC：`rpc updateServerDNS(UpdateServerDNSRequest) returns (RPCSuccess);`

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

```json
{
  "serverId": "int64 // 网站ID",
  "supportCNAME": "bool"
}
```

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

```json
{}
```

**调用示例**

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

---

## updateServerDNSName
> 修改网站的CNAME

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ServerService/updateServerDNSName`
- RPC：`rpc updateServerDNSName(UpdateServerDNSNameRequest) returns (RPCSuccess);`

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

```json
{
  "serverId": "int64 // 网站ID",
  "dnsName": "string"
}
```

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

```json
{}
```

**调用示例**

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

---

## updateServerGroupIds
> 修改网站所在分组

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/updateServerGroupIds`
- RPC：`rpc updateServerGroupIds(UpdateServerGroupIdsRequest) returns (RPCSuccess);`

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

```json
{
  "serverId": "int64 // 网站ID",
  "serverGroupIds": "[]int64"
}
```

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

```json
{}
```

**调用示例**

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

---

## updateServerHTTP
> 修改网站的HTTP设置

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/updateServerHTTP`
- RPC：`rpc updateServerHTTP (UpdateServerHTTPRequest) returns (RPCSuccess);`

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

```json
{
  "serverId": "int64 // 网站ID",
  "httpJSON": "bytes // HTTP协议设置，当type为httpProxy或者httpWeb时填写 json:http_protocol"
}
```

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

```json
{}
```

**调用示例**

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

---

## updateServerHTTPS
> 修改网站的HTTPS设置

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/updateServerHTTPS`
- RPC：`rpc updateServerHTTPS (UpdateServerHTTPSRequest) returns (RPCSuccess);`

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

```json
{
  "serverId": "int64 // 网站ID",
  "httpsJSON": "bytes // HTTPS协议设置，当type为httpProxy或者httpWeb时填写 json:https_protocol"
}
```

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

```json
{}
```

**调用示例**

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

---

## updateServerIsOn
> 修改网站是否启用

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/updateServerIsOn`
- RPC：`rpc updateServerIsOn (UpdateServerIsOnRequest) returns (RPCSuccess);`

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

```json
{
  "serverId": "int64 // 网站ID",
  "isOn": "bool // 是否启用"
}
```

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

```json
{}
```

**调用示例**

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

---

## updateServerName
> 修改网站名称

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/updateServerName`
- RPC：`rpc updateServerName(UpdateServerNameRequest) returns (RPCSuccess);`

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

```json
{
  "serverId": "int64 // 网站ID",
  "name": "string // 网站名称"
}
```

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

```json
{}
```

**调用示例**

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

---

## updateServerNames
> 修改网站的域名设置

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/updateServerNames`
- RPC：`rpc updateServerNames (UpdateServerNamesRequest) returns (RPCSuccess);`

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

```json
{
  "serverId": "int64 // 网站ID",
  "serverNamesJSON": "bytes // 域名列表 json:server_names"
}
```

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

```json
{}
```

**调用示例**

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

---

## updateServerNamesAuditing
> 审核网站的域名设置

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ServerService/updateServerNamesAuditing`
- RPC：`rpc updateServerNamesAuditing (UpdateServerNamesAuditingRequest) returns (RPCSuccess);`

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

```json
{
  "serverId": "int64 // 网站ID",
  "auditingResult": "ServerNameAuditingResult"
}
```

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

```json
{}
```

**调用示例**

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

---

## updateServerReverseProxy
> 修改网站的反向代理设置

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/updateServerReverseProxy`
- RPC：`rpc updateServerReverseProxy (UpdateServerReverseProxyRequest) returns (RPCSuccess);`

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

```json
{
  "serverId": "int64 // 网站ID",
  "reverseProxyJSON": "bytes // 反向代理（包含源站）配置引用，此项可以在创建网站后再设置 json:reverse_proxy_ref"
}
```

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

```json
{}
```

**调用示例**

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

---

## updateServerTCP
> 修改网站的TCP设置

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/updateServerTCP`
- RPC：`rpc updateServerTCP (UpdateServerTCPRequest) returns (RPCSuccess);`

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

```json
{
  "serverId": "int64 // 网站ID",
  "tcpJSON": "bytes // TCP协议设置，当type为tcpProxy时填写 json:tcp_protocol"
}
```

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

```json
{}
```

**调用示例**

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

---

## updateServerTLS
> 修改网站的TLS设置

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/updateServerTLS`
- RPC：`rpc updateServerTLS (UpdateServerTLSRequest) returns (RPCSuccess);`

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

```json
{
  "serverId": "int64 // 网站ID",
  "tlsJSON": "bytes // TLS协议设置，当type为tcpProxy时填写 json:tls_protocol"
}
```

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

```json
{}
```

**调用示例**

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

---

## updateServerTrafficLimit
> 设置流量限制

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ServerService/updateServerTrafficLimit`
- RPC：`rpc updateServerTrafficLimit(UpdateServerTrafficLimitRequest) returns (RPCSuccess);`

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

```json
{
  "serverId": "int64 // 网站ID",
  "trafficLimitJSON": "bytes"
}
```

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

```json
{}
```

**调用示例**

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

---

## updateServerUAM
> 修改网站UAM设置

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/updateServerUAM`
- RPC：`rpc updateServerUAM(UpdateServerUAMRequest) returns (RPCSuccess);`

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

```json
{
  "serverId": "int64 // 网站ID",
  "uamJSON": "bytes"
}
```

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

```json
{}
```

**调用示例**

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

---

## updateServerUDP
> 修改网站的UDP设置

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/updateServerUDP`
- RPC：`rpc updateServerUDP (UpdateServerUDPRequest) returns (RPCSuccess);`

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

```json
{
  "serverId": "int64 // 网站ID",
  "udpJSON": "bytes // UDP协议设置，当type为udpProxy时填写 json:udp_protocol"
}
```

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

```json
{}
```

**调用示例**

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

---

## updateServerUser
> 修改网站所属用户

- 角色：`admin`
- HTTP：`POST https://backend.dooki.cloud/ServerService/updateServerUser`
- RPC：`rpc updateServerUser(UpdateServerUserRequest) returns (RPCSuccess);`

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

```json
{
  "serverId": "int64 // 网站ID",
  "userId": "int64 // 用户ID"
}
```

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

```json
{}
```

**调用示例**

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

---

## updateServerUserPlan
> 修改网站套餐

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/updateServerUserPlan`
- RPC：`rpc updateServerUserPlan(UpdateServerUserPlanRequest) returns (RPCSuccess);`

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

```json
{
  "serverId": "int64 // 网站ID",
  "userPlanId": "int64"
}
```

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

```json
{}
```

**调用示例**

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

---

## updateServerWeb
> 修改网站的Web设置

- 角色：`admin`, `user`
- HTTP：`POST https://backend.dooki.cloud/ServerService/updateServerWeb`
- RPC：`rpc updateServerWeb (UpdateServerWebRequest) returns (RPCSuccess);`

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

```json
{
  "serverId": "int64 // 网站ID",
  "webId": "int64"
}
```

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

```json
{}
```

**调用示例**

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

---
