路由管理
1.更新路由重写策略
接口功能介绍
无
接口约束
无
URI
POST /cgw/v1/route/updateHttpRewriteConfig
Content-Type: application/json
路径参数
Query参数
请求参数
请求头header参数
参数 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 |
---|---|---|---|---|---|
regionId | 是 | String | 资源池编码 | 7a2828074ef6e32e041a2ef124b19e63 |
请求体body参数
参数 | 是否比必填 | 参数类型 | 说明 | 示例 | 下级对象 |
---|---|---|---|---|---|
id | 是 | String | 路由资源id | 1876543074ef6e32e041a2ef124b19e63 | |
instId | 是 | String | 实例Id | 7a2828074ef6e32e041a2ef124099765 | |
enable | 否 | Boolean | 是否启用 true:启用,false:停用 | false | |
originHost | 否 | String | 原主机域,从路由配置host中读取 | test.com | |
originPath | 否 | String | 原路径,从路由配置uri中读取 | /app/a | |
originType | 否 | String | 原类型,从路由配置中读取 | ||
pathMatchType | 是 | String | 重写路径匹配类型, 前缀匹配:PRE, 精确匹配:EQUAL, 正则匹配:REGEX | EQUAL | |
prefixMatchPattern | 否 | String | 前缀匹配类型时待匹配的路径 | ||
regexMatchPattern | 否 | String | 正则匹配时提供的正则表达式 | ||
rewriteHost | 是 | String | 重写主机域 | hello.com | |
rewritePath | 是 | String | 重写路径 | /app/c |
响应参数
参数 | 参数类型 | 说明 | 示例 | 下级对象 |
---|---|---|---|---|
statusCode | Integer | 接口状态码 | 2000 | |
code | String | 错误码,异常时非空 | CGW_1001 | |
returnObj | Object | 返回数据 | {} | |
message | String | 异常描述 | success |
请求示例
请求url
https://127.0.0.1:8080/cgw/v1/route/updateHttpRewriteConfig
请求头header
{
"regionId": "1234567890"
}
请求体body
{
"id": "00000000000000000020",
"pathMatchType": "EQUAL",
"rewritePath": "/user_test",
"rewriteHost": "[example.com](http://example.com)",
"regexMatchPattern": "",
"prefixMatchPattern": "",
"originPath": "/test1",
"enable": false,
"instId": "878da73f7dba36ff0ae80e004a4f28f9"
}
响应示例
{
"statusCode": 2000,
"message": "success",
"returnObj": {}
}
状态码
请参考 状态码说明。
错误码
请参考 错误码说明。