Creates a routing rule for a Service Mesh (ASM) 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 |
---|---|---|---|---|
servicemesh:CreateIstioGatewayRoutes | create | *All Resources * |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ServiceMeshId | string | Yes | The ASM instance ID. | c08ba3fd1e6484b0f8cc1ad8fe10d**** |
IstioGatewayName | string | No | The name of the ASM gateway. | ingressgateway |
GatewayRoute | object | No | The information about the routing rule to be created for the ASM gateway. | |
RouteName | string | No | The name of the routing rule. | reviews-v2-routes |
RouteType | string | No | The type of the traffic to be routed. Valid values: | HTTP |
MatchRequest | object | No | The matching rules for traffic routing. | |
URI | object | No | The matching rule for URIs. | |
MatchingMode | string | No | The matching mode for the routing rule. Valid values:
| prefix |
MatchingContent | string | No | The content to be matched. | /ratings/v2/ |
Headers | array<object> | No | The request headers to be matched. | |
object | No | The request header to be matched. | ||
Name | string | No | The header key to be matched. | x-request-id |
MatchingMode | string | No | The matching mode for the header value. Valid values:
| exact |
MatchingContent | string | No | The header value to be matched. | v1 |
TLSMatchAttributes | array<object> | No | The matching rule for Transport Layer Security (TLS) traffic. | |
object | No | The matching rule for TLS traffic. | ||
TLSPort | integer | No | The TLS port. | 443 |
SNIHosts | array | No | The Server Name Indication (SNI) values to be matched. | |
string | No | Wildcards can be used as the prefix of an SNI value. For example, a value of Note
The SNI values must be a subset of the hostnames of the corresponding virtual hosts.
| *.com | |
Ports | array | No | The ports of destination services for Layer 4 weighted routing. | |
integer | No | The ports of the specified hosts to which the traffic is routed. | 443 | |
RouteDestinations | array<object> | No | The endpoints of destination services for Layer 4 weighted routing. | |
object | No | The endpoint of destination service for Layer 4 weighted routing. | ||
Destination | object | No | The unique endpoint of the destination service to which the specified requests are sent. | |
Host | string | No | The name of the service defined in the service registry. | reviews |
Subset | string | No | The name of the service subset. | v1 |
Port | object | No | The port. | |
Number | integer | No | The port number. | 80 |
Weight | integer | No | The weight of the service subset. | 80 |
HTTPAdvancedOptions | object | No | The advanced settings for routing HTTP traffic. | |
HTTPRedirect | object | No | The HTTP redirection rule. | |
Uri | string | No | The value to be used to overwrite the URL path during redirection. | /v1/getProductRatings |
Authority | string | No | The value to be used to overwrite the value of the Authority or Host header during redirection.`` | newratings.default.svc.cluster.local |
RedirectCode | integer | No | The HTTP status code to be used to indicate URL redirection. Default value: 301. | 301 |
Delegate | object | No | The virtual service that defines traffic routing. | |
Name | string | No | The name of the virtual service. | reviews |
Namespace | string | No | The namespace to which the virtual service belongs. | default |
Rewrite | object | No | The configurations for rewriting the virtual service. | |
Uri | string | No | The value to be used to overwrite the path or prefix of the URI. | /v1/getProductRatings |
Authority | string | No | The value to be used to overwrite the value of the Authority or Host header. | newratings.default.svc.cluster.local |
Timeout | string | No | The timeout period for requests. | 5s |
Retries | object | No | The configurations of retries for failed requests. | |
Attempts | integer | No | The number of retries that are allowed for a request. | 3 |
PerTryTimeout | string | No | The timeout period for each retry. Example: | 5s |
RetryOn | string | No | The condition for retries. Example: | connect-failure,refused-stream,503 |
RetryRemoteLocalities | object | No | Specifies whether to allow retries to other localities. | |
Value | boolean | No | Specifies whether to allow retries to other localities. Valid values:
Default value: | false |
Fault | object | No | The configurations of fault injection. | |
Delay | object | No | The duration to delay a request. | |
FixedDelay | string | No | The fixed duration for request delay. | 5s |
Percentage | object | No | The percentage of requests to which the delay fault is injected. | |
Value | float | No | The percentage of requests to which the delay fault is injected, which is expressed as a decimal. | 0.1 |
Abort | object | No | The configurations for aborting requests with specified error codes. | |
HttpStatus | integer | No | The HTTP status code. | 400 |
Percentage | object | No | The percentage of requests that are aborted with the specified error code. | |
Value | float | No | The percentage of requests that are aborted with the specified error code, which is expressed as a decimal. | 0.1 |
Mirror | object | No | The configurations for mirroring HTTP traffic to another destination in addition to forwarding requests to the specified destination. | |
Host | string | No | The name of the service defined in the service registry. | reviews.default.svc.cluster.local |
Subset | string | No | The name of the service subset. | v1 |
MirrorPercentage | object | No | The percentage of requests that are mirrored to another destination except for the original destination. | |
Value | float | No | The percentage of requests that are mirrored to another destination except for the original destination, which is expressed as a decimal. | 0.2 |
Namespace | string | No | The namespace. | default |
Domains | array | No | The requested domain names. | |
string | No | The domain name. | test.asm.aliyun.com | |
RawVSRoute | any | No | A JSON string. This parameter corresponds to the three routing types in virtual services and provides configuration entries for advanced features. The value of this parameter overwrites the configurations in RouteName, RouteType, MatchRequest, and HTTPAdvancedOptions. | { "http": { "route": [ { "destination": { "host": "httpbin" } } ], "name": "httpbin", "match": [ { "uri": { "prefix": "/" } } ], "fault": { "delay": { "fixedDelay": "2s", "percentage": { "value": 70 } } } } } |
Priority | integer | No | The priority of the routing rule. The value of this parameter is an integer. A smaller value indicates a higher priority. | 1 |
Status | integer | No | The status of the routing rule. Valid values:
| 1 |
Description | string | No | The description of the routing rule. | demo route |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "31d3a0f0-07ed-4f6e-9004-1804498c****"
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-06-25 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
2022-08-25 | The internal configuration of the API is changed, but the call is not affected | View Change Details |