All Products
Search
Document Center

Alibaba Cloud Service Mesh:CreateIstioGatewayRoutes

Last Updated:Dec 03, 2025

Creates routes for an ASM gateway.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

servicemesh:CreateIstioGatewayRoutes

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

ServiceMeshId

string

Yes

The ID of the ASM instance.

c08ba3fd1e6484b0f8cc1ad8fe10d****

IstioGatewayName

string

No

The name of the ASM gateway.

ingressgateway

GatewayRoute

object

No

The information about the gateway route.

RouteName

string

No

The name of the route.

reviews-v2-routes

RouteType

string

No

The route type. Valid values: HTTP, TLS, and TCP.

HTTP

MatchRequest

object

No

The route matching rule.

URI

object

No

The URI matching rule.

MatchingMode

string

No

The matching mode for the route rule. Valid values:

  • exact: exact match.

  • prefix: prefix match.

  • regex: regular expression match.

prefix

MatchingContent

string

No

The content to match.

/ratings/v2/

Headers

array<object>

No

The list of request headers to match.

object

No

The request header to match.

Name

string

No

The key of the header to match.

x-request-id

MatchingMode

string

No

The matching mode for the header value. Valid values:

  • exact: exact match.

  • prefix: prefix match.

  • regex: regular expression match.

exact

MatchingContent

string

No

The content to match in the header.

v1

TLSMatchAttributes

array<object>

No

The list of TLS connection matching attributes.

object

No

The TLS connection matching attribute.

TLSPort

integer

No

The TLS port.

443

SNIHosts

array

No

The list of SNI values.

string

No

You can use a wildcard character prefix in an SNI value. For example, *.com matches foo.example.com and example.com.

Note

The SNI value must be a subset of the hosts of the corresponding virtual service.

*.com

Ports

array

No

The list of Layer 4 destination ports.

integer

No

The port on the host to be addressed.

443

RouteDestinations

array<object>

No

The list of weighted destinations for the Layer 4 routing rule.

array<object>

No

A weighted destination for the Layer 4 routing rule.

Destination

object

No

The destination that uniquely identifies the service instance to which requests or connections are forwarded.

Host

string

No

The name of the service in the service registry.

reviews

Subset

string

No

The name of the subset in the service.

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 options for HTTP routing.

HTTPRedirect

object

No

The HTTP redirection.

Uri

string

No

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

/v1/getProductRatings

Authority

string

No

The value used to overwrite the Authority/Host part of the URL during redirection.

newratings.default.svc.cluster.local

RedirectCode

integer

No

The HTTP status code to use in the redirection response. The default response code is 301.

301

Delegate

object

No

The virtual service to which traffic is delegated.

Name

string

No

The name.

reviews

Namespace

string

No

The namespace.

default

Rewrite

object

No

The request rewrite rule.

Uri

string

No

The value used to rewrite the path or prefix of the URI.

/v1/getProductRatings

Authority

string

No

The value used to rewrite the Authority or Host header.

newratings.default.svc.cluster.local

Timeout

string

No

The timeout period.

5s

Retries

object

No

The request retry configuration.

Attempts

integer

No

The number of retries allowed for a given request.

3

PerTryTimeout

string

No

The timeout period for each retry of a given request. Example: 5s.

5s

RetryOn

string

No

The condition that triggers a retry. Example: connect-failure,refused-stream,503.

connect-failure,refused-stream,503

RetryRemoteLocalities

object

No

A flag that specifies whether to retry requests to other localities.

Value

boolean

No

A flag that specifies whether to retry requests to other localities. Valid values:

  • true: Retries requests to other localities.

  • false: Does not retry requests to other localities.

Default value: false.

false

Fault

object

No

The fault injection settings.

Delay

object

No

The delay settings.

FixedDelay

string

No

The fixed delay duration.

5s

Percentage

object

No

The percentage of requests to which the delay is injected.

Value

number

No

The percentage of requests to which the delay is injected, in decimals.

0.1

Abort

object

No

Aborts a request in advance with a specified error code.

HttpStatus

integer

No

The HTTP status code.

400

Percentage

object

No

The percentage of requests to abort with the specified error code.

Value

number

No

The percentage of requests to abort with the specified error code, in decimals.

0.1

Mirror

object

No

Mirrors HTTP traffic to another destination in addition to forwarding the requests to the intended destination.

Host

string

No

The name of the service in the service registry.

reviews.default.svc.cluster.local

Subset

string

No

The name of the subset in the service.

v1

MirrorPercentage

object

No

The percentage of traffic to mirror.

Value

number

No

The percentage of traffic to mirror, in decimals.

0.2

Namespace

string

No

The namespace.

default

Domains

array

No

The list of requested domain names.

string

No

The domain name.

test.asm.aliyun.com

RawVSRoute

any

No

A JSON string that corresponds to the three route types in a virtual service. It provides an entry point for advanced configurations. These configurations overwrite the settings of 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 route. A smaller integer indicates a higher priority.

1

Status

integer

No

The status of the gateway route. Valid values:

  • 0: online.

  • 1: offline.

  • 2: creation or update error.

1

Description

string

No

The description of the route.

demo route

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

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

Examples

Success response

JSON format

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

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.