All Products
Search
Document Center

Alibaba Cloud Service Mesh:CreateIstioGatewayRoutes

Last Updated:Mar 05, 2024

Creates a routing rule for a Service Mesh (ASM) gateway.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
ServiceMeshIdstringYes

The ASM instance ID.

c08ba3fd1e6484b0f8cc1ad8fe10d****
IstioGatewayNamestringNo

The name of the ASM gateway.

ingressgateway
GatewayRouteobjectNo

The information about the routing rule to be created for the ASM gateway.

RouteNamestringNo

The name of the routing rule.

reviews-v2-routes
RouteTypestringNo

The type of the traffic to be routed. Valid values: HTTP, TLS, and TCP.

HTTP
MatchRequestobjectNo

The matching rules for traffic routing.

URIobjectNo

The matching rule for URIs.

MatchingModestringNo

The matching mode for the routing rule. Valid values:

  • exact: exact match
  • prefix: match by prefix
  • regex: match by regular expression
prefix
MatchingContentstringNo

The content to be matched.

/ratings/v2/
Headersobject []No

The request headers to be matched.

NamestringNo

The header key to be matched.

x-request-id
MatchingModestringNo

The matching mode for the header value. Valid values:

  • exact: exact match
  • prefix: match by prefix
  • regex: match by regular expression
exact
MatchingContentstringNo

The header value to be matched.

v1
TLSMatchAttributesobject []No

The matching rule for Transport Layer Security (TLS) traffic.

TLSPortintegerNo

The TLS port.

443
SNIHostsarrayNo

The Server Name Indication (SNI) values to be matched.

stringNo

Wildcards can be used as the prefix of an SNI value. For example, a value of *.com matches foo.example.com and example.com.

Note The SNI values must be a subset of the hostnames of the corresponding virtual hosts.
*.com
PortsarrayNo

The ports of destination services for Layer 4 weighted routing.

integerNo

The ports of the specified hosts to which the traffic is routed.

443
RouteDestinationsobject []No

The endpoints of destination services for Layer 4 weighted routing.

DestinationobjectNo

The unique endpoint of the destination service to which the specified requests are sent.

HoststringNo

The name of the service defined in the service registry.

reviews
SubsetstringNo

The name of the service subset.

v1
PortobjectNo

The port.

NumberintegerNo

The port number.

80
WeightintegerNo

The weight of the service subset.

80
HTTPAdvancedOptionsobjectNo

The advanced settings for routing HTTP traffic.

HTTPRedirectobjectNo

The HTTP redirection rule.

UristringNo

The value to be used to overwrite the URL path during redirection.

/v1/getProductRatings
AuthoritystringNo

The value to be used to overwrite the value of the Authority or Host header during redirection.``

newratings.default.svc.cluster.local
RedirectCodeintegerNo

The HTTP status code to be used to indicate URL redirection. Default value: 301.

301
DelegateobjectNo

The virtual service that defines traffic routing.

NamestringNo

The name of the virtual service.

reviews
NamespacestringNo

The namespace to which the virtual service belongs.

default
RewriteobjectNo

The configurations for rewriting the virtual service.

UristringNo

The value to be used to overwrite the path or prefix of the URI.

/v1/getProductRatings
AuthoritystringNo

The value to be used to overwrite the value of the Authority or Host header.

newratings.default.svc.cluster.local
TimeoutstringNo

The timeout period for requests.

5s
RetriesobjectNo

The configurations of retries for failed requests.

AttemptsintegerNo

The number of retries that are allowed for a request.

3
PerTryTimeoutstringNo

The timeout period for each retry. Example: 5s.

5s
RetryOnstringNo

The condition for retries. Example: connect-failure,refused-stream,503.

connect-failure,refused-stream,503
RetryRemoteLocalitiesobjectNo

Specifies whether to allow retries to other localities.

ValuebooleanNo

Specifies whether to allow retries to other localities. Valid values:

  • true
  • false

Default value: false.

false
FaultobjectNo

The configurations of fault injection.

DelayobjectNo

The duration to delay a request.

FixedDelaystringNo

The fixed duration for request delay.

5s
PercentageobjectNo

The percentage of requests to which the delay fault is injected.

ValuefloatNo

The percentage of requests to which the delay fault is injected, which is expressed as a decimal.

0.1
AbortobjectNo

The configurations for aborting requests with specified error codes.

HttpStatusintegerNo

The HTTP status code.

400
PercentageobjectNo

The percentage of requests that are aborted with the specified error code.

ValuefloatNo

The percentage of requests that are aborted with the specified error code, which is expressed as a decimal.

0.1
MirrorobjectNo

The configurations for mirroring HTTP traffic to another destination in addition to forwarding requests to the specified destination.

HoststringNo

The name of the service defined in the service registry.

reviews.default.svc.cluster.local
SubsetstringNo

The name of the service subset.

v1
MirrorPercentageobjectNo

The percentage of requests that are mirrored to another destination except for the original destination.

ValuefloatNo

The percentage of requests that are mirrored to another destination except for the original destination, which is expressed as a decimal.

0.2
NamespacestringNo

The namespace.

default
DomainsarrayNo

The requested domain names.

stringNo

The domain name.

test.asm.aliyun.com
RawVSRouteanyNo

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 } } } } }
PriorityintegerNo

The priority of the routing rule. The value of this parameter is an integer. A smaller value indicates a higher priority.

1
StatusintegerNo

The status of the routing rule. Valid values:

  • 0: The routing rule is valid.
  • 1: The routing rule is invalid.
  • 2: An error occurs during the creation or update of the routing rule.
1
DescriptionstringNo

The description of the routing rule.

demo route

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

31d3a0f0-07ed-4f6e-9004-1804498c****

Examples

Sample success responses

JSONformat

{
  "RequestId": "31d3a0f0-07ed-4f6e-9004-1804498c****"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-06-25The internal configuration of the API is changed, but the call is not affectedsee changesets
Change itemChange content
The internal configuration of the API is changed, but the call is not affected.
2022-08-25The internal configuration of the API is changed, but the call is not affectedsee changesets
Change itemChange content
The internal configuration of the API is changed, but the call is not affected.