Updates a routing rule for a gateway.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
mse:UpdateGatewayRoute | *Gateway acs:mse:{#regionId}:{#accountId}:instance/{#GatewayUniqueId} |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
GatewayId | long | No | The ID of the gateway. | 501 |
Name | string | No | The name of the route. | route-web |
RouteOrder | integer | No | The sequence number of the route. | 1 |
Predicates | object | Yes | The route matching conditions. | |
PathPredicates | object | Yes | The information about path matching. | |
Path | string | No | The path used for route matching. | /test |
Type | string | No | The matching type. | PRE |
IgnoreCase | boolean | No | Specifies whether to perform case-insensitive matching. | true |
MethodPredicates | array | No | The information about method matching. | |
string | No | The method. | GET | |
HeaderPredicates | array<object> | No | The information about header matching. | |
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 information about parameter matching. | |
object | No | The information about a URL parameter. | ||
Key | string | No | The name of the parameter. | userid |
Value | string | No | The value of the parameter. | test |
Type | string | No | The matching type. | PRE |
Services | array<object> | No | The information about destination services. | |
object | No | The services. | ||
ServiceId | long | No | The ID of the service. | 1 |
Percent | integer | No | The percentage. | 80 |
Version | string | No | The version of the service. | v1 |
Name | string | No | The name. | web |
SourceType | string | No | The source type. | MSE |
Namespace | string | No | The namespace in which the service resides. | default |
GroupName | string | No | The name of the group to which the service belongs. | test |
AgreementType | string | No | The type of the protocol. Valid values: | DUBBO |
HttpDubboTranscoder | object | No | The transcoder of the Dubbo protocol. | |
DubboServiceName | string | No | The name of the Dubbo service. | 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 forwarding rules of the Dubbo service. | |
MothedMapList | object | No | The method mapping object. | |
DubboMothedName | string | No | The method name of the Dubbo service. | sayHello |
HttpMothed | string | No | The HTTP method. Note
Valid values:
| ALL_GET |
Mothedpath | string | No | The path that is used to match a method. | /mytestzbk/sayhello |
PassThroughAllHeaders | string | No | The pass-through type of the header. Note
Valid values:
| PASS_NOT |
PassThroughList | array | No | The list of headers to be passed through. | |
PossThroughList | string | No | The value of the header to be passed through. | x-forward |
ParamMapsList | array<object> | No | The information of parameter mappings. | |
ParamMapsList | object | No | The parameter mapping object. | |
ExtractKeySpec | string | No | The position of the input parameter. Note
Valid values:
| ALL_QUERY_PARAMETER |
ExtractKey | string | No | The key extracted from the input parameter. | name |
MappingType | string | No | The type of the backend service parameter. | java.lang.String |
ServicePort | integer | No | The Dubbo port number. | 20880 |
Id | long | No | The ID of the route. | 139 |
DestinationType | string | No | The destination service type. | Mock |
DirectResponseJSON | object | No | The information about service mocking. | |
Code | long | No | The mock return code. | 200 |
Body | string | No | The mock return value. | hello |
GatewayUniqueId | string | Yes | The unique ID of the gateway. | gw-86575c0bc9f04ecfbacb92b8e392a2c4 |
DomainIdListJSON | string | Yes | The associated domain name. | [90] |
RedirectJSON | object | No | The information about redirection. | |
Code | integer | No | The status code returned. | 302 |
Host | string | No | The hostname to be redirected to. | test.com |
Path | string | No | The path to be redirected to. | /test |
EnableWaf | boolean | No | Specifies whether to activate Web Application Firewall (WAF). | false |
Fallback | boolean | No | Specifies whether to enable the Fallback service. | true |
FallbackServices | array<object> | No | The information about the Fallback service. | |
object | No | The data object. | ||
ServiceId | long | No | The ID of the service. | 1 |
Percent | integer | No | The weight in the form of a percentage value. | 80 |
Version | string | No | The version of the service. | v1 |
Name | string | No | The name. | name |
SourceType | string | No | The source type. | MSE |
Namespace | string | No | The namespace in which the service resides. | Namespace |
GroupName | string | No | The name of the group to which the service belongs. | test |
AgreementType | string | No | The type of the protocol. Valid values: | DUBBO |
ServicePort | integer | No | The service port number. | 8848 |
AcceptLanguage | string | No | The language of the response. Valid values:
| zh |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "73785414-2C5B-5E28-BD91-B2C742269C48",
"HttpStatusCode": 200,
"Message": "The request is successfully processed.\n",
"Code": 200,
"Success": true,
"Data": 337,
"ErrorCode": "NoPermission"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidParameter | Parameter error : %s | - |
400 | IllegalRequest | Illegal request : %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 |
500 | InternalError | Console error. Try again later:%s | Console error. Try again later: %s |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-01-18 | The request parameters of the API has changed | View Change Details |
2023-04-25 | The Error code has changed | View Change Details |
2022-07-28 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
2022-02-18 | Add Operation | View Change Details |