Adds a gateway route.
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:AddGatewayRoute | *Gateway acs:mse:{#regionId}:{#accountId}:instance/{#GatewayUniqueId} |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
GatewayId | long | No | The ID of the gateway. | 526 |
Name | string | Yes | The name of the route. | test |
RouteOrder | integer | No | The sequence number of the route. (A small value indicates a high priority.) | 1 |
Predicates | object | No | The matching rule. | |
PathPredicates | object | No | The information about route matching. | |
Path | string | No | The path. | /test |
Type | string | No | The route matching type. Valid values:
| PRE |
IgnoreCase | boolean | No | Specifies whether to ignore case sensitivity. | 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. | test |
Type | string | No | The matching type. | PRE |
QueryPredicates | array<object> | No | The information about URL parameter matching. | |
object | No | The information about the 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 list of services. | |
object | No | The list of services. | ||
ServiceId | long | No | The ID of the service. | 353 |
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. | user |
SourceType | string | No | The source type. | MSE |
Namespace | string | No | The namespace to which the service belongs. | default |
GroupName | string | No | The name of the group to which the service belongs. | test |
AgreementType | string | No | The type of the protocol. | 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 name of the service group. | None |
MothedMapList | array<object> | No | The forwarding rules of the Dubbo service. | |
MothedMapList | object | No | The method mapping. | |
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 used for method matching. | /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 about 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 service port number. | 443 |
DomainId | long | No | The domain ID. | 20 |
DestinationType | string | No | The type of the destination service. Valid values:
| Multiple |
DirectResponseJSON | object | No | The mock response configuration. | |
Code | long | No | The mock return code. | 403 |
Body | string | No | The mock return value. | hello |
GatewayUniqueId | string | Yes | The unique ID of the gateway. | gw-492af9b04bb4474cae9d645be8***** |
DomainIdListJSON | string | Yes | The domain IDs. | [0,94] |
RedirectJSON | object | No | The configuration of the 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). | true |
Fallback | boolean | No | Specifies whether to enable the Fallback service. | true |
FallbackServices | array<object> | No | The information about the Fallback service. | |
object | No | |||
ServiceId | long | No | The ID of the service. | 353 |
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. | user |
SourceType | string | No | The source type. | MSE |
Namespace | string | No | The namespace to which the service belongs. | default |
GroupName | string | No | The name of the group to which the service belongs. | test |
AgreementType | string | No | The type of the protocol. | DUBBO |
ServicePort | integer | No | The service port number. | 443 |
RouteType | string | No | The route type. Valid values: Op: Manage routes. | Op |
Policies | string | No | The routing policy in a JSON string. | {"CORS":"{\"allowMethods\":\"GET,POST,PUT,DELETE,HEAD,OPTIONS,PATCH\",\"allowHeaders\":\"*\",\"exposeHeaders\":\"*\",\"unitNum\":12,\"allowCredentials\":true,\"status\":\"off\",\"allowOrigins\":\"*\",\"timeUnit\":\"h\"}","Timeout":"{\"unitNum\":10,\"timeUnit\":\"s\",\"status\":\"off\"}","Retry":"{\"attempts\":2,\"retryOn\":[\"5xx\"],\"status\":\"off\"}","HTTPRewrite":"{\"pathType\":\"EQUAL\",\"path\":\"/o\",\"status\":\"off\"}","Waf":"{\"enabled\":false}","HeaderOp":"{\"status\":\"off\",\"headerOpItems\":[{\"directionType\":\"Request\",\"opType\":\"Add\",\"key\":\"kkk\",\"value\":\"ll\"}]}"} |
AcceptLanguage | string | No | The language of the response. Valid values:
| zh |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "03A3E2F4-6804-5663-9D5D-2EC47A1*****",
"HttpStatusCode": 200,
"Message": "The request is successfully processed.\n",
"Code": 200,
"Success": true,
"Data": 555,
"ErrorCode": "InvalidParameter"
}
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 |
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-03-31 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
2023-03-02 | The request parameters of the API 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 |