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

11 KiB
Raw Blame History

ServerGroupService

服务分组服务


createServerGroup

创建分组

  • 角色:admin, user
  • HTTPPOST https://backend.dooki.cloud/ServerGroupService/createServerGroup
  • RPCrpc createServerGroup (CreateServerGroupRequest) returns (CreateServerGroupResponse);

请求对象 (CreateServerGroupRequest)

{
  "name": "string // 名称"
}

响应对象 (CreateServerGroupResponse)

{
  "serverGroupId": "int64 // 服务分组ID网站分组ID"
}

调用示例

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

deleteServerGroup

删除分组

  • 角色:admin, user
  • HTTPPOST https://backend.dooki.cloud/ServerGroupService/deleteServerGroup
  • RPCrpc deleteServerGroup (DeleteServerGroupRequest) returns (RPCSuccess);

请求对象 (DeleteServerGroupRequest)

{
  "serverGroupId": "int64 // 服务分组ID网站分组ID"
}

响应对象 (RPCSuccess)

{}

调用示例

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

findAllEnabledServerGroups

查询所有分组

  • 角色:admin, user
  • HTTPPOST https://backend.dooki.cloud/ServerGroupService/findAllEnabledServerGroups
  • RPCrpc findAllEnabledServerGroups (FindAllEnabledServerGroupsRequest) returns (FindAllEnabledServerGroupsResponse);

请求对象 (FindAllEnabledServerGroupsRequest)

{
  "userId": "int64 // 可选项用户ID只有管理员才可以指定用户ID"
}

响应对象 (FindAllEnabledServerGroupsResponse)

{
  "serverGroups": "[]ServerGroup // 分组列表"
}

调用示例

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

findAndInitServerGroupHTTPReverseProxyConfig

查找HTTP反向代理设置

  • 角色:admin, user
  • HTTPPOST https://backend.dooki.cloud/ServerGroupService/findAndInitServerGroupHTTPReverseProxyConfig
  • RPCrpc findAndInitServerGroupHTTPReverseProxyConfig (FindAndInitServerGroupHTTPReverseProxyConfigRequest) returns (FindAndInitServerGroupHTTPReverseProxyConfigResponse);

请求对象 (FindAndInitServerGroupHTTPReverseProxyConfigRequest)

{
  "serverGroupId": "int64 // 服务分组ID网站分组ID"
}

响应对象 (FindAndInitServerGroupHTTPReverseProxyConfigResponse)

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

调用示例

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

findAndInitServerGroupTCPReverseProxyConfig

查找TCP反向代理设置

  • 角色:admin, user
  • HTTPPOST https://backend.dooki.cloud/ServerGroupService/findAndInitServerGroupTCPReverseProxyConfig
  • RPCrpc findAndInitServerGroupTCPReverseProxyConfig (FindAndInitServerGroupTCPReverseProxyConfigRequest) returns (FindAndInitServerGroupTCPReverseProxyConfigResponse);

请求对象 (FindAndInitServerGroupTCPReverseProxyConfigRequest)

{
  "serverGroupId": "int64 // 服务分组ID网站分组ID"
}

响应对象 (FindAndInitServerGroupTCPReverseProxyConfigResponse)

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

调用示例

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

findAndInitServerGroupUDPReverseProxyConfig

查找UDP反向代理设置

  • 角色:admin, user
  • HTTPPOST https://backend.dooki.cloud/ServerGroupService/findAndInitServerGroupUDPReverseProxyConfig
  • RPCrpc findAndInitServerGroupUDPReverseProxyConfig (FindAndInitServerGroupUDPReverseProxyConfigRequest) returns (FindAndInitServerGroupUDPReverseProxyConfigResponse);

请求对象 (FindAndInitServerGroupUDPReverseProxyConfigRequest)

{
  "serverGroupId": "int64 // 服务分组ID网站分组ID"
}

响应对象 (FindAndInitServerGroupUDPReverseProxyConfigResponse)

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

调用示例

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

findAndInitServerGroupWebConfig

初始化Web设置

  • 角色:admin, user
  • HTTPPOST https://backend.dooki.cloud/ServerGroupService/findAndInitServerGroupWebConfig
  • RPCrpc findAndInitServerGroupWebConfig (FindAndInitServerGroupWebConfigRequest) returns (FindAndInitServerGroupWebConfigResponse);

请求对象 (FindAndInitServerGroupWebConfigRequest)

{
  "serverGroupId": "int64 // 服务分组ID网站分组ID"
}

响应对象 (FindAndInitServerGroupWebConfigResponse)

{
  "webJSON": "bytes"
}

调用示例

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

findEnabledServerGroup

查找单个分组信息

  • 角色:admin, user
  • HTTPPOST https://backend.dooki.cloud/ServerGroupService/findEnabledServerGroup
  • RPCrpc findEnabledServerGroup (FindEnabledServerGroupRequest) returns (FindEnabledServerGroupResponse);

请求对象 (FindEnabledServerGroupRequest)

{
  "serverGroupId": "int64 // 服务分组ID网站分组ID"
}

响应对象 (FindEnabledServerGroupResponse)

{
  "serverGroup": "ServerGroup"
}

调用示例

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

findEnabledServerGroupConfigInfo

取得分组的配置概要信息

  • 角色:admin, user
  • HTTPPOST https://backend.dooki.cloud/ServerGroupService/findEnabledServerGroupConfigInfo
  • RPCrpc findEnabledServerGroupConfigInfo (FindEnabledServerGroupConfigInfoRequest) returns (FindEnabledServerGroupConfigInfoResponse);

请求对象 (FindEnabledServerGroupConfigInfoRequest)

{
  "serverGroupId": "int64 // 服务分组ID网站分组ID",
  "serverId": "int64 // 服务ID网站ID"
}

响应对象 (FindEnabledServerGroupConfigInfoResponse)

{
  "hasHTTPReverseProxy": "bool",
  "hasTCPReverseProxy": "bool",
  "hasUDPReverseProxy": "bool",
  "serverGroupId": "int64 // 服务分组ID网站分组ID",
  "hasRootConfig": "bool",
  "hasWAFConfig": "bool",
  "hasCacheConfig": "bool",
  "hasCharsetConfig": "bool",
  "hasStatConfig": "bool",
  "hasCompressionConfig": "bool",
  "hasOptimizationConfig": "bool",
  "hasRequestHeadersConfig": "bool",
  "hasResponseHeadersConfig": "bool",
  "hasWebsocketConfig": "bool",
  "hasWebPConfig": "bool",
  "hasAccessLogConfig": "bool",
  "hasRemoteAddrConfig": "bool",
  "hasPagesConfig": "bool",
  "hasRequestLimitConfig": "bool",
  "hasRequestScriptsConfig": "bool"
}

调用示例

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

updateServerGroup

修改分组

  • 角色:admin, user
  • HTTPPOST https://backend.dooki.cloud/ServerGroupService/updateServerGroup
  • RPCrpc updateServerGroup (UpdateServerGroupRequest) returns (RPCSuccess);

请求对象 (UpdateServerGroupRequest)

{
  "serverGroupId": "int64 // 服务分组ID网站分组ID",
  "name": "string // 名称"
}

响应对象 (RPCSuccess)

{}

调用示例

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

updateServerGroupHTTPReverseProxy

修改分组的HTTP反向代理设置

  • 角色:admin, user
  • HTTPPOST https://backend.dooki.cloud/ServerGroupService/updateServerGroupHTTPReverseProxy
  • RPCrpc updateServerGroupHTTPReverseProxy (UpdateServerGroupHTTPReverseProxyRequest) returns (RPCSuccess);

请求对象 (UpdateServerGroupHTTPReverseProxyRequest)

{
  "serverGroupId": "int64 // 服务分组ID网站分组ID",
  "reverseProxyJSON": "bytes"
}

响应对象 (RPCSuccess)

{}

调用示例

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

updateServerGroupOrders

修改分组排序

  • 角色:admin, user
  • HTTPPOST https://backend.dooki.cloud/ServerGroupService/updateServerGroupOrders
  • RPCrpc updateServerGroupOrders (UpdateServerGroupOrdersRequest) returns (RPCSuccess);

请求对象 (UpdateServerGroupOrdersRequest)

{
  "serverGroupIds": "[]int64"
}

响应对象 (RPCSuccess)

{}

调用示例

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

updateServerGroupTCPReverseProxy

修改分组的TCP反向代理设置

  • 角色:admin, user
  • HTTPPOST https://backend.dooki.cloud/ServerGroupService/updateServerGroupTCPReverseProxy
  • RPCrpc updateServerGroupTCPReverseProxy (UpdateServerGroupTCPReverseProxyRequest) returns (RPCSuccess);

请求对象 (UpdateServerGroupTCPReverseProxyRequest)

{
  "serverGroupId": "int64 // 服务分组ID网站分组ID",
  "reverseProxyJSON": "bytes"
}

响应对象 (RPCSuccess)

{}

调用示例

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

updateServerGroupUDPReverseProxy

修改分组的UDP反向代理设置

  • 角色:admin, user
  • HTTPPOST https://backend.dooki.cloud/ServerGroupService/updateServerGroupUDPReverseProxy
  • RPCrpc updateServerGroupUDPReverseProxy (UpdateServerGroupUDPReverseProxyRequest) returns (RPCSuccess);

请求对象 (UpdateServerGroupUDPReverseProxyRequest)

{
  "serverGroupId": "int64 // 服务分组ID网站分组ID",
  "reverseProxyJSON": "bytes"
}

响应对象 (RPCSuccess)

{}

调用示例

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