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

5.2 KiB
Raw Blame History

HTTPLocationService

路由规则服务


createHTTPLocation

创建路径规则

  • 角色:admin
  • HTTPPOST https://backend.dooki.cloud/HTTPLocationService/createHTTPLocation
  • RPCrpc createHTTPLocation (CreateHTTPLocationRequest) returns (CreateHTTPLocationResponse);

请求对象 (CreateHTTPLocationRequest)

{
  "parentId": "int64",
  "name": "string // 名称",
  "description": "string // 描述(备注)",
  "pattern": "string",
  "isBreak": "bool",
  "condsJSON": "bytes",
  "domains": "[]string"
}

响应对象 (CreateHTTPLocationResponse)

{
  "locationId": "int64"
}

调用示例

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

deleteHTTPLocation

删除路径规则

  • 角色:admin
  • HTTPPOST https://backend.dooki.cloud/HTTPLocationService/deleteHTTPLocation
  • RPCrpc deleteHTTPLocation (DeleteHTTPLocationRequest) returns (RPCSuccess);

请求对象 (DeleteHTTPLocationRequest)

{
  "locationId": "int64"
}

响应对象 (RPCSuccess)

{}

调用示例

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

findAndInitHTTPLocationReverseProxyConfig

查找反向代理设置

  • 角色:admin, user
  • HTTPPOST https://backend.dooki.cloud/HTTPLocationService/findAndInitHTTPLocationReverseProxyConfig
  • RPCrpc findAndInitHTTPLocationReverseProxyConfig (FindAndInitHTTPLocationReverseProxyConfigRequest) returns (FindAndInitHTTPLocationReverseProxyConfigResponse);

请求对象 (FindAndInitHTTPLocationReverseProxyConfigRequest)

{
  "locationId": "int64"
}

响应对象 (FindAndInitHTTPLocationReverseProxyConfigResponse)

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

调用示例

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

findAndInitHTTPLocationWebConfig

初始化Web设置

  • 角色:admin, user
  • HTTPPOST https://backend.dooki.cloud/HTTPLocationService/findAndInitHTTPLocationWebConfig
  • RPCrpc findAndInitHTTPLocationWebConfig (FindAndInitHTTPLocationWebConfigRequest) returns (FindAndInitHTTPLocationWebConfigResponse);

请求对象 (FindAndInitHTTPLocationWebConfigRequest)

{
  "locationId": "int64"
}

响应对象 (FindAndInitHTTPLocationWebConfigResponse)

{
  "webJSON": "bytes"
}

调用示例

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

findEnabledHTTPLocationConfig

查找路径规则配置

  • 角色:admin
  • HTTPPOST https://backend.dooki.cloud/HTTPLocationService/findEnabledHTTPLocationConfig
  • RPCrpc findEnabledHTTPLocationConfig (FindEnabledHTTPLocationConfigRequest) returns (FindEnabledHTTPLocationConfigResponse);

请求对象 (FindEnabledHTTPLocationConfigRequest)

{
  "locationId": "int64"
}

响应对象 (FindEnabledHTTPLocationConfigResponse)

{
  "locationJSON": "bytes"
}

调用示例

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

updateHTTPLocation

修改路径规则

  • 角色:admin
  • HTTPPOST https://backend.dooki.cloud/HTTPLocationService/updateHTTPLocation
  • RPCrpc updateHTTPLocation (UpdateHTTPLocationRequest) returns (RPCSuccess);

请求对象 (UpdateHTTPLocationRequest)

{
  "locationId": "int64",
  "name": "string // 名称",
  "description": "string // 描述(备注)",
  "pattern": "string",
  "isOn": "bool // 是否启用",
  "isBreak": "bool",
  "condsJSON": "bytes",
  "domains": "[]string"
}

响应对象 (RPCSuccess)

{}

调用示例

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

updateHTTPLocationReverseProxy

修改反向代理设置

  • 角色:admin
  • HTTPPOST https://backend.dooki.cloud/HTTPLocationService/updateHTTPLocationReverseProxy
  • RPCrpc updateHTTPLocationReverseProxy (UpdateHTTPLocationReverseProxyRequest) returns (RPCSuccess);

请求对象 (UpdateHTTPLocationReverseProxyRequest)

{
  "locationId": "int64",
  "reverseProxyJSON": "bytes"
}

响应对象 (RPCSuccess)

{}

调用示例

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