Updates a gateway route.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
mse:UpdateGatewayRoute |
update |
*Gateway
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| GatewayId |
integer |
No |
The ID of the gateway. |
501 |
Name
deprecated
|
string |
No |
The name of the route. |
route-web |
| RouteOrder |
integer |
No |
The order of the route. |
1 |
| Predicates |
object |
Yes |
The matching conditions of the route. |
|
| PathPredicates |
object |
Yes |
The path matching conditions. |
|
| Path |
string |
No |
The path of the route. |
/test |
| Type |
string |
No |
The matching type. |
PRE |
| IgnoreCase |
boolean |
No |
Specifies whether to ignore case. |
true |
| MethodPredicates |
array |
No |
The method matching conditions. |
|
|
string |
No |
The specific method. |
GET |
|
| HeaderPredicates |
array<object> |
No |
The request header matching conditions. |
|
|
object |
No |
The request header. |
||
| Key |
string |
No |
The key of the request header. |
debug |
| Value |
string |
No |
The value of the request header. |
on |
| Type |
string |
No |
The matching type. |
PRE |
| QueryPredicates |
array<object> |
No |
The query parameter matching conditions. |
|
|
object |
No |
The URL parameter. |
||
| Key |
string |
No |
The name of the parameter. |
userid |
| Value |
string |
No |
The matching value. |
test |
| Type |
string |
No |
The matching type. |
PRE |
| Services |
array<object> |
No |
The destination services. Specify this parameter when the route points to a single service, multiple services, or tag-based routing. |
|
|
array<object> |
No |
The list of services. |
||
| ServiceId |
integer |
No |
The ID of the service. |
1 |
| Percent |
integer |
No |
The traffic distribution percentage of the current service or service version. Specify this parameter only when multiple services or tag-based routing is used. |
80 |
| Version |
string |
No |
The service version. Specify this parameter only when tag-based routing is used. |
v1 |
| Name |
string |
No |
The name. |
web |
| SourceType |
string |
No |
The source type. |
MSE |
| Namespace |
string |
No |
The namespace where the service resides. |
default |
| GroupName |
string |
No |
The name of the service group. |
test |
| AgreementType |
string |
No |
The protocol type. |
DUBBO |
| HttpDubboTranscoder |
object |
No |
The Dubbo protocol transcoding configuration. |
|
| DubboServiceName |
string |
No |
The Dubbo service name. |
org.apache.dubbo.samples.basic.api.DemoService |
| DubboServiceVersion |
string |
No |
The version of the Dubbo service. |
0.0.0 |
| DubboServiceGroup |
string |
No |
The Dubbo service group. |
service name |
| MothedMapList |
array<object> |
No |
The list of Dubbo forwarding rules. |
|
|
array<object> |
No |
The method mapping configuration. |
||
| DubboMothedName |
string |
No |
The name of the Dubbo method. |
sayHello |
| HttpMothed |
string |
No |
The HTTP method. Note
Supported HTTP method parameter values:
|
ALL_GET |
| Mothedpath |
string |
No |
The matching path of the method. |
/mytestzbk/sayhello |
| PassThroughAllHeaders |
string |
No |
The header pass-through type. Note
Valid values for the pass-through type:
|
PASS_NOT |
| PassThroughList |
array |
No |
The list of specified headers to pass through. |
|
|
string |
No |
The specified header to pass through. |
x-forward |
|
| ParamMapsList |
array<object> |
No |
The list of parameter mappings. |
|
|
object |
No |
The parameter mapping configuration. |
||
| ExtractKeySpec |
string |
No |
The position of the input parameter. Note
Valid values for the position of the input parameter:
|
ALL_QUERY_PARAMETER |
| ExtractKey |
string |
No |
The key extracted from the input parameter position. |
name |
| MappingType |
string |
No |
The backend parameter type. |
java.lang.String |
| ServicePort |
integer |
No |
The Dubbo port. |
20880 |
| Id |
integer |
No |
The ID of the route. |
139 |
| DestinationType |
string |
No |
The type of the destination service. |
Mock |
| DirectResponseJSON |
object |
No |
The mock content. |
|
| Code |
integer |
No |
The mock response code. |
200 |
| Body |
string |
No |
The mock response body. |
hello |
| GatewayUniqueId |
string |
Yes |
The unique ID of the gateway. |
gw-86575c0bc9f04ecfbacb92b8e392a2c4 |
| DomainIdListJSON |
string |
Yes |
The associated domain names. |
[90] |
| RedirectJSON |
object |
No |
The redirect configuration. |
|
| Code |
integer |
No |
The status code. |
302 |
| Host |
string |
No |
The redirect hostname. |
test.com |
| Path |
string |
No |
The redirect path. |
/test |
EnableWaf
deprecated
|
boolean |
No |
[Deprecated] Use UpdateGatewayRouteWafStatus to update the WAF status of the route. |
false |
| Fallback |
boolean |
No |
Specifies whether to enable the fallback service. |
true |
| FallbackServices |
array<object> |
No |
The fallback services. |
|
|
object |
No |
The data object. |
||
| ServiceId |
integer |
No |
The ID of the service. |
1 |
| Percent |
integer |
No |
The weight percentage. |
80 |
| Version |
string |
No |
The service version. |
v1 |
| Name |
string |
No |
The name. |
name |
| SourceType |
string |
No |
The source type. |
MSE |
| Namespace |
string |
No |
The namespace where the service resides. |
Namespace |
| GroupName |
string |
No |
The name of the service group. |
test |
| AgreementType |
string |
No |
The protocol type. |
DUBBO |
| ServicePort |
integer |
No |
The service port. |
8848 |
| Description |
string |
No |
The description of the route. |
a route for xxx |
| AcceptLanguage |
string |
No |
The language of the returned information. Valid values:
|
zh |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The data structure. |
||
| RequestId |
string |
The request ID. |
73785414-2C5B-5E28-BD91-B2C742269C48 |
| HttpStatusCode |
integer |
The HTTP status code. |
200 |
| Message |
string |
The response description. |
The request is processed successfully. |
| Code |
integer |
The status code. |
200 |
| Success |
boolean |
Indicates whether the request is successful. Valid values:
|
true |
| Data |
integer |
The data. |
337 |
| ErrorCode |
string |
The error code. |
NoPermission |
Examples
Success response
JSON format
{
"RequestId": "73785414-2C5B-5E28-BD91-B2C742269C48",
"HttpStatusCode": 200,
"Message": "The request is processed successfully.",
"Code": 200,
"Success": true,
"Data": 337,
"ErrorCode": "NoPermission"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | IllegalRequest | Invalid request:%s | Invalid request: %s |
| 400 | InvalidParameter | Parameter error:%s | Request parameter error: %s |
| 500 | InternalError | Console error. Try again later:%s | Console error. Try again later: %s |
| 403 | NoPermission | You are not authorized to perform this operation:%s | You do not have the permission to use this interface:%s |
| 404 | NotFound | Not found:%s | The resource does not exist:%s |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.