Creates a routing rule for an Alibaba Cloud Service Mesh (ASM) gateway.
Authorization information
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 | object [] | No | The request headers 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 | object [] | No | The matching rule for Transport Layer Security (TLS) traffic. | |
TLSPort | integer | No | The TLS port. | 443 |
SNIHosts | array | No | The Server Name Indication (SNI) values to be matched. | |
string | No | The SNI values to be matched. Wildcards can be used as the prefix of an SNI value. For example, the value NoteThe 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 | object [] | No | The endpoints of destination services 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 |
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 redirect 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 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 name of the namespace. | default |
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 | ||
---|---|---|---|---|
2022-08-25 | The internal configurations of the API operation change but you can still call the operation. | |||
|