Files
pyGoEdge-UserPanel/reference/goedge 文档/HTTPLocationService.md

266 lines
5.2 KiB
Markdown
Raw Normal View History

2025-11-18 03:36:49 +08:00
# HTTPLocationService
> 路由规则服务
---
## createHTTPLocation
> 创建路径规则
- 角色:`admin`
- HTTP`POST https://backend.dooki.cloud/HTTPLocationService/createHTTPLocation`
- RPC`rpc createHTTPLocation (CreateHTTPLocationRequest) returns (CreateHTTPLocationResponse);`
**请求对象 (`CreateHTTPLocationRequest`)**
```json
{
"parentId": "int64",
"name": "string // 名称",
"description": "string // 描述(备注)",
"pattern": "string",
"isBreak": "bool",
"condsJSON": "bytes",
"domains": "[]string"
}
```
**响应对象 (`CreateHTTPLocationResponse`)**
```json
{
"locationId": "int64"
}
```
**调用示例**
```bash
curl -X POST "https://backend.dooki.cloud/HTTPLocationService/createHTTPLocation" \
-H "Content-Type: application/json" \
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
-d '{
...
}'
```
---
## deleteHTTPLocation
> 删除路径规则
- 角色:`admin`
- HTTP`POST https://backend.dooki.cloud/HTTPLocationService/deleteHTTPLocation`
- RPC`rpc deleteHTTPLocation (DeleteHTTPLocationRequest) returns (RPCSuccess);`
**请求对象 (`DeleteHTTPLocationRequest`)**
```json
{
"locationId": "int64"
}
```
**响应对象 (`RPCSuccess`)**
```json
{}
```
**调用示例**
```bash
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`
- HTTP`POST https://backend.dooki.cloud/HTTPLocationService/findAndInitHTTPLocationReverseProxyConfig`
- RPC`rpc findAndInitHTTPLocationReverseProxyConfig (FindAndInitHTTPLocationReverseProxyConfigRequest) returns (FindAndInitHTTPLocationReverseProxyConfigResponse);`
**请求对象 (`FindAndInitHTTPLocationReverseProxyConfigRequest`)**
```json
{
"locationId": "int64"
}
```
**响应对象 (`FindAndInitHTTPLocationReverseProxyConfigResponse`)**
```json
{
"reverseProxyJSON": "bytes",
"reverseProxyRefJSON": "bytes"
}
```
**调用示例**
```bash
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`
- HTTP`POST https://backend.dooki.cloud/HTTPLocationService/findAndInitHTTPLocationWebConfig`
- RPC`rpc findAndInitHTTPLocationWebConfig (FindAndInitHTTPLocationWebConfigRequest) returns (FindAndInitHTTPLocationWebConfigResponse);`
**请求对象 (`FindAndInitHTTPLocationWebConfigRequest`)**
```json
{
"locationId": "int64"
}
```
**响应对象 (`FindAndInitHTTPLocationWebConfigResponse`)**
```json
{
"webJSON": "bytes"
}
```
**调用示例**
```bash
curl -X POST "https://backend.dooki.cloud/HTTPLocationService/findAndInitHTTPLocationWebConfig" \
-H "Content-Type: application/json" \
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
-d '{
...
}'
```
---
## findEnabledHTTPLocationConfig
> 查找路径规则配置
- 角色:`admin`
- HTTP`POST https://backend.dooki.cloud/HTTPLocationService/findEnabledHTTPLocationConfig`
- RPC`rpc findEnabledHTTPLocationConfig (FindEnabledHTTPLocationConfigRequest) returns (FindEnabledHTTPLocationConfigResponse);`
**请求对象 (`FindEnabledHTTPLocationConfigRequest`)**
```json
{
"locationId": "int64"
}
```
**响应对象 (`FindEnabledHTTPLocationConfigResponse`)**
```json
{
"locationJSON": "bytes"
}
```
**调用示例**
```bash
curl -X POST "https://backend.dooki.cloud/HTTPLocationService/findEnabledHTTPLocationConfig" \
-H "Content-Type: application/json" \
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
-d '{
...
}'
```
---
## updateHTTPLocation
> 修改路径规则
- 角色:`admin`
- HTTP`POST https://backend.dooki.cloud/HTTPLocationService/updateHTTPLocation`
- RPC`rpc updateHTTPLocation (UpdateHTTPLocationRequest) returns (RPCSuccess);`
**请求对象 (`UpdateHTTPLocationRequest`)**
```json
{
"locationId": "int64",
"name": "string // 名称",
"description": "string // 描述(备注)",
"pattern": "string",
"isOn": "bool // 是否启用",
"isBreak": "bool",
"condsJSON": "bytes",
"domains": "[]string"
}
```
**响应对象 (`RPCSuccess`)**
```json
{}
```
**调用示例**
```bash
curl -X POST "https://backend.dooki.cloud/HTTPLocationService/updateHTTPLocation" \
-H "Content-Type: application/json" \
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
-d '{
...
}'
```
---
## updateHTTPLocationReverseProxy
> 修改反向代理设置
- 角色:`admin`
- HTTP`POST https://backend.dooki.cloud/HTTPLocationService/updateHTTPLocationReverseProxy`
- RPC`rpc updateHTTPLocationReverseProxy (UpdateHTTPLocationReverseProxyRequest) returns (RPCSuccess);`
**请求对象 (`UpdateHTTPLocationReverseProxyRequest`)**
```json
{
"locationId": "int64",
"reverseProxyJSON": "bytes"
}
```
**响应对象 (`RPCSuccess`)**
```json
{}
```
**调用示例**
```bash
curl -X POST "https://backend.dooki.cloud/HTTPLocationService/updateHTTPLocationReverseProxy" \
-H "Content-Type: application/json" \
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
-d '{
...
}'
```
---