Initial commit
This commit is contained in:
91
reference/goedge 文档/HTTPRewriteRuleService.md
Normal file
91
reference/goedge 文档/HTTPRewriteRuleService.md
Normal file
@@ -0,0 +1,91 @@
|
||||
# HTTPRewriteRuleService
|
||||
> 重写规则服务
|
||||
|
||||
---
|
||||
|
||||
## createHTTPRewriteRule
|
||||
> 创建重写规则
|
||||
|
||||
- 角色:`admin`, `user`
|
||||
- HTTP:`POST https://backend.dooki.cloud/HTTPRewriteRuleService/createHTTPRewriteRule`
|
||||
- RPC:`rpc createHTTPRewriteRule (CreateHTTPRewriteRuleRequest) returns (CreateHTTPRewriteRuleResponse);`
|
||||
|
||||
**请求对象 (`CreateHTTPRewriteRuleRequest`)**
|
||||
|
||||
```json
|
||||
{
|
||||
"pattern": "string",
|
||||
"replace": "string",
|
||||
"mode": "string",
|
||||
"redirectStatus": "int32",
|
||||
"isBreak": "bool",
|
||||
"proxyHost": "string",
|
||||
"isOn": "bool // 是否启用",
|
||||
"withQuery": "bool",
|
||||
"condsJSON": "bytes"
|
||||
}
|
||||
```
|
||||
|
||||
**响应对象 (`CreateHTTPRewriteRuleResponse`)**
|
||||
|
||||
```json
|
||||
{
|
||||
"rewriteRuleId": "int64"
|
||||
}
|
||||
```
|
||||
|
||||
**调用示例**
|
||||
|
||||
```bash
|
||||
curl -X POST "https://backend.dooki.cloud/HTTPRewriteRuleService/createHTTPRewriteRule" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
|
||||
-d '{
|
||||
...
|
||||
}'
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## updateHTTPRewriteRule
|
||||
> 修改重写规则
|
||||
|
||||
- 角色:`admin`, `user`
|
||||
- HTTP:`POST https://backend.dooki.cloud/HTTPRewriteRuleService/updateHTTPRewriteRule`
|
||||
- RPC:`rpc updateHTTPRewriteRule (UpdateHTTPRewriteRuleRequest) returns (RPCSuccess);`
|
||||
|
||||
**请求对象 (`UpdateHTTPRewriteRuleRequest`)**
|
||||
|
||||
```json
|
||||
{
|
||||
"rewriteRuleId": "int64",
|
||||
"pattern": "string",
|
||||
"replace": "string",
|
||||
"mode": "string",
|
||||
"redirectStatus": "int32",
|
||||
"isBreak": "bool",
|
||||
"proxyHost": "string",
|
||||
"isOn": "bool // 是否启用",
|
||||
"withQuery": "bool",
|
||||
"condsJSON": "bytes"
|
||||
}
|
||||
```
|
||||
|
||||
**响应对象 (`RPCSuccess`)**
|
||||
|
||||
```json
|
||||
{}
|
||||
```
|
||||
|
||||
**调用示例**
|
||||
|
||||
```bash
|
||||
curl -X POST "https://backend.dooki.cloud/HTTPRewriteRuleService/updateHTTPRewriteRule" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-Edge-Access-Token: <YOUR_TOKEN>" \
|
||||
-d '{
|
||||
...
|
||||
}'
|
||||
```
|
||||
|
||||
---
|
||||
Reference in New Issue
Block a user