更新网关路由。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
mse:UpdateGatewayRoute |
update |
*Gateway
|
无 | 无 |
请求参数
名称 |
类型 |
必填 |
描述 |
示例值 |
GatewayId |
integer |
否 |
网关 ID。 |
501 |
Name
deprecated
|
string |
否 |
路由名称。 |
route-web |
RouteOrder |
integer |
否 |
路由顺序。 |
1 |
Predicates |
array |
是 |
路由匹配条件。 |
|
PathPredicates |
object |
是 |
Path 匹配。 |
|
Path |
string |
否 |
路由 Path 路径。 |
/test |
Type |
string |
否 |
匹配类型。 |
PRE |
IgnoreCase |
boolean |
否 |
忽略大小写。 |
true |
MethodPredicates |
array |
否 |
方法匹配。 |
|
string |
否 |
具体方法。 |
GET |
|
HeaderPredicates |
array |
否 |
请求头匹配。 |
|
object |
否 |
请求头。 |
||
Key |
string |
否 |
请求头 Key。 |
debug |
Value |
string |
否 |
对应的 Value。 |
on |
Type |
string |
否 |
匹配类型。 |
PRE |
QueryPredicates |
array |
否 |
参数匹配。 |
|
object |
否 |
URL 参数。 |
||
Key |
string |
否 |
参数名。 |
userid |
Value |
string |
否 |
匹配值。 |
test |
Type |
string |
否 |
匹配类型。 |
PRE |
Services |
array |
否 |
目标服务(路由指向为单服务、多服务、标签路由时填写)。 |
|
array |
否 |
服务列表。 |
||
ServiceId |
integer |
否 |
服务 ID。 |
1 |
Percent |
integer |
否 |
当前服务/服务版本分流百分比(只在使用多服务、标签路由时填写)。 |
80 |
Version |
string |
否 |
服务版本(只在使用标签路由时填写)。 |
v1 |
Name |
string |
否 |
名称。 |
web |
SourceType |
string |
否 |
来源类型。 |
MSE |
Namespace |
string |
否 |
服务所在命名空间。 |
default |
GroupName |
string |
否 |
服务分组名称。 |
test |
AgreementType |
string |
否 |
协议类型。 |
DUBBO |
HttpDubboTranscoder |
object |
否 |
Dubbo 协议转换体。 |
|
DubboServiceName |
string |
否 |
Dubbo 服务名称。 |
org.apache.dubbo.samples.basic.api.DemoService |
DubboServiceVersion |
string |
否 |
Dubbot 服务版本。 |
0.0.0 |
DubboServiceGroup |
string |
否 |
Dubbo 服务组。 |
service name |
MothedMapList |
array |
否 |
Dubbo 转发规则列表。 |
|
array |
否 |
方法映射体。 |
||
DubboMothedName |
string |
否 |
Dubbo 方法名。 |
sayHello |
HttpMothed |
string |
否 |
Http 方法。 说明
支持 http 方法参数值。
|
ALL_GET |
Mothedpath |
string |
否 |
方法匹配路径。 |
/mytestzbk/sayhello |
PassThroughAllHeaders |
string |
否 |
Header 透传类型。 说明
透传类型枚举值。
|
PASS_NOT |
PassThroughList |
array |
否 |
指定透传 Header 列表。 |
|
string |
否 |
指定 Header 透传值。 |
x-forward |
|
ParamMapsList |
array |
否 |
参数映射列表。 |
|
object |
否 |
参数映射体。 |
||
ExtractKeySpec |
string |
否 |
入参位置。 说明
入参位置枚举值。
|
ALL_QUERY_PARAMETER |
ExtractKey |
string |
否 |
入参位提取 Key。 |
name |
MappingType |
string |
否 |
后端参数类型。 |
java.lang.String |
ServicePort |
integer |
否 |
Dubbo 端口。 |
20880 |
Id |
integer |
否 |
路由 ID。 |
139 |
DestinationType |
string |
否 |
目标服务类型。 |
Mock |
DirectResponseJSON |
object |
否 |
Mock 内容。 |
|
Code |
integer |
否 |
Mock 返回码。 |
200 |
Body |
string |
否 |
Mock 返回值。 |
hello |
GatewayUniqueId |
string |
是 |
网关唯一标识 ID。 |
gw-86575c0bc9f04ecfbacb92b8e392a2c4 |
DomainIdListJSON |
string |
是 |
关联域名。 |
[90] |
RedirectJSON |
object |
否 |
重定向。 |
|
Code |
integer |
否 |
状态码。 |
302 |
Host |
string |
否 |
重定向主机名。 |
test.com |
Path |
string |
否 |
重定向路径。 |
/test |
EnableWaf
deprecated
|
boolean |
否 |
已废弃,请使用 UpdateGatewayRouteWafStatus 更新路由 WAF 状态。 |
false |
Fallback |
boolean |
否 |
是否开启 Fallback 服务。 |
true |
FallbackServices |
array |
否 |
Fallback 服务。 |
|
object |
否 |
数据对象。 |
||
ServiceId |
integer |
否 |
服务 ID。 |
1 |
Percent |
integer |
否 |
权重百分比。 |
80 |
Version |
string |
否 |
服务版本。 |
v1 |
Name |
string |
否 |
名称。 |
name |
SourceType |
string |
否 |
来源类型。 |
MSE |
Namespace |
string |
否 |
服务所在命名空间。 |
Namespace |
GroupName |
string |
否 |
服务分组名称。 |
test |
AgreementType |
string |
否 |
协议类型。 |
DUBBO |
ServicePort |
integer |
否 |
服务端口。 |
8848 |
Description |
string |
否 |
路由描述 |
a route for xxx |
AcceptLanguage |
string |
否 |
返回信息的语言类型:
|
zh |
返回参数
名称 |
类型 |
描述 |
示例值 |
object |
数据结构 |
||
RequestId |
string |
请求 ID |
73785414-2C5B-5E28-BD91-B2C742269C48 |
HttpStatusCode |
integer |
HTTP 返回码。 |
200 |
Message |
string |
响应描述 |
请求处理成功 |
Code |
integer |
状态码 |
200 |
Success |
boolean |
请求结果,取值如下:
|
true |
Data |
integer |
数据。 |
337 |
ErrorCode |
string |
错误码。 |
NoPermission |
示例
正常返回示例
JSON
格式
{
"RequestId": "73785414-2C5B-5E28-BD91-B2C742269C48",
"HttpStatusCode": 200,
"Message": "请求处理成功",
"Code": 200,
"Success": true,
"Data": 337,
"ErrorCode": "NoPermission"
}
错误码
HTTP status code |
错误码 |
错误信息 |
描述 |
---|---|---|---|
400 | IllegalRequest | Invalid request:%s | 非法请求: %s |
400 | InvalidParameter | Parameter error:%s | 请求参数错误:%s |
500 | InternalError | Console error. Try again later:%s | 控制台错误.稍后重试:%s |
403 | NoPermission | You are not authorized to perform this operation:%s | 没有权限使用此接口:%s |
404 | NotFound | Not found:%s | 资源不存在:%s |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。