ListRouteMapRules

Updated at:

Queries the details of one or more route map rules.

Operation description

Request description

  • RouteMapId: specifies the ID of the route map whose rules you want to query.

  • RouteMapRuleIds: the list of rule IDs to query. You can use this parameter together with filter conditions. The logical relationship between them is OR.

  • Filter: the filter conditions. You can filter by attributes such as direction. Supported filter conditions include Status and Direction.

  • DryRun: specifies whether to enable the dry run mode. Default value: false.

You must specify at least one of RouteMapId and RouteMapRuleIds. If you specify both, the system performs a joint query based on the two parameters. If you specify only RouteMapId, all rules under the route map are returned. If you specify only RouteMapRuleIds, the details of the specified rules are returned.

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

cen:ListRouteMapRules

list

RouteMapRule

acs:cen:*:{#accountId}:routemaprule/*

RouteMap

acs:cen:*:{#accountId}:routemap/{#RouteMapId}

None None

Request syntax

GET / HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

ClientToken

string

No

The client token that is used to ensure the idempotence of the request.

You can generate a parameter value on your client to ensure that the value is unique across different requests. The ClientToken parameter supports only ASCII characters.

Note

If you do not specify this parameter, the system automatically uses the RequestId of the API request as the ClientToken. The RequestId of each API request may be different.

02fb3da4-130e-11e9-8e44-001****

RouteMapId

string

No

The ID of the route map to query.

rm-0a1b2c3d4e5f6a7b8

RouteMapRuleIds

array

No

The list of route map rule IDs to query. You can use this parameter together with filter conditions. The logical relationship between them is AND.

string

No

The list of route map rule IDs to query. You can use this parameter together with filter conditions. The logical relationship between them is AND.

rmr-0a1b2c3d4e5f6a7b8

Filter

array<object>

No

The filter conditions.

You can specify up to 5 filter conditions at a time.

object

No

The filter conditions.

You can specify up to 5 filter conditions at a time.

Key

string

No

The filter condition. Valid values:

  • Name: the name of the route map rule.

  • Priority: the priority of the route map rule.

By default, multiple filter conditions are evaluated with an AND logical operator. A route map rule matches the filter conditions only if it meets all the specified conditions.

You can specify up to 5 filter conditions at a time.

Name

Value

array

No

The value of the filter condition.

Specify the filter value based on the Key. You can specify multiple filter values for a single Key. Multiple filter values are evaluated with an OR logical operator. A route map rule matches the filter condition if it meets at least one of the specified filter values.

You can specify up to 5 filter values for a single filter condition.

string

No

The value of the filter condition.

Specify the filter value based on the Key. You can specify multiple filter values for a single Key. Multiple filter values are evaluated with an OR logical operator. A route map rule matches the filter condition if it meets at least one of the specified filter values.

You can specify up to 5 filter values for a single filter condition.

test

DryRun

boolean

No

Specifies whether to only precheck the request. Valid values:

  • true: sends a check request and does not query the route map rules. The system checks whether the required parameters are specified, the request format is valid, and the service limits are met. If the request fails the check, the system returns the corresponding error. If the request passes the check, the system returns the error code DryRunOperation.

  • false (default): sends a normal request and queries the route map rules after the request passes the check.

MaxResults

integer

No

The number of entries to return on each page.

20

NextToken

string

No

The token that is used to retrieve the next page of results. Valid values:

  • You do not need to specify this parameter for the first query or when no next page exists.

  • If a next page exists, set the value to the NextToken value returned from the previous API call.

dd20****

Response elements

Element

Type

Description

Example

object

The response.

TotalCount

integer

The total number of entries.

2

RequestId

string

The request ID.

EF44D7B7-6248-5A60-8A4C-A92388605A57

NextToken

string

The token that is used to retrieve the next page of results. Valid values:

  • If NextToken is empty, no next page exists.

  • If NextToken returns a value, the value is the token used to retrieve the next page.

dd20****

MaxResults

integer

The number of entries returned on each page.

20

RouteMapRules

array<object>

The list of route map rules.

array<object>

The information about the route map rule.

Description

string

The description of the rule.

Matches production prefixes from on-prem and sets a higher local preference.

MatchConditions

object

The match conditions of the route map rule. The system performs the actions defined in SetActions only if a route meets all the match conditions defined in this parameter.

AddressPrefixesInclude

array

The list of route prefixes for fuzzy matching.

A route matches the condition if the route prefix in the match condition contains the route prefix of the route to be matched.

For example, a policy defined with 10.0.0.0/8 can fuzzy match a route with the prefix 10.10.10.0/24.

The IP address range uses the CIDR format and supports IPv4 and IPv6.

This parameter is mutually exclusive with AddressPrefixesMatch and cannot be specified at the same time.

string

The list of route prefixes for fuzzy matching.

A route matches the condition if the route prefix in the match condition contains the route prefix of the route to be matched.

For example, a policy defined with 10.0.0.0/8 can fuzzy match a route with the prefix 10.10.10.0/24.

The IP address range uses the CIDR format and supports IPv4 and IPv6.

This parameter is mutually exclusive with AddressPrefixesMatch and cannot be specified at the same time.

10.0.0.0/8

AddressPrefixesMatch

array

The list of route prefixes for exact matching.

A route matches the condition only if the route prefix in the match condition is exactly the same as the route prefix of the route to be matched.

For example, a policy defined with 10.0.0.0/8 can only exactly match a route with the prefix 10.0.0.0/8.

The IP address range uses the CIDR format and supports IPv4 and IPv6.

This parameter is mutually exclusive with AddressPrefixesInclude and cannot be specified at the same time.

string

The list of route prefixes for exact matching.

A route matches the condition only if the route prefix in the match condition is exactly the same as the route prefix of the route to be matched.

For example, a policy defined with 10.0.0.0/8 can only exactly match a route with the prefix 10.0.0.0/8.

The IP address range uses the CIDR format and supports IPv4 and IPv6.

This parameter is mutually exclusive with AddressPrefixesInclude and cannot be specified at the same time.

10.0.0.0/8

AsPathsInclude

array

The list of AS paths for fuzzy matching.

A route matches the condition if the AS path in the match condition overlaps with the AS path of the route to be matched.

This parameter is mutually exclusive with AsPathsMatch and cannot be specified at the same time.

Note

Only AS SEQUENCE is supported. AS SET, AS CONFED SEQUENCE, and AS CONFED SET are not supported. This means that only a list of AS numbers is supported, and sets and sublists are not supported.

integer

The list of AS paths for fuzzy matching.

A route matches the condition if the AS path in the match condition overlaps with the AS path of the route to be matched.

This parameter is mutually exclusive with AsPathsMatch and cannot be specified at the same time.

Note

Only AS SEQUENCE is supported. AS SET, AS CONFED SEQUENCE, and AS CONFED SET are not supported. This means that only a list of AS numbers is supported, and sets and sublists are not supported.

65000

AsPathsMatch

array

The list of AS paths for exact matching.

A route matches the condition only if the AS path in the match condition is exactly the same as the AS path of the route to be matched.

This parameter is mutually exclusive with AsPathsInclude and cannot be specified at the same time.

Note

Only AS SEQUENCE is supported. AS SET, AS CONFED SEQUENCE, and AS CONFED SET are not supported. This means that only a list of AS numbers is supported, and sets and sublists are not supported.

integer

The list of AS paths for exact matching.

A route matches the condition only if the AS path in the match condition is exactly the same as the AS path of the route to be matched.

This parameter is mutually exclusive with AsPathsInclude and cannot be specified at the same time.

Note

Only AS SEQUENCE is supported. AS SET, AS CONFED SEQUENCE, and AS CONFED SET are not supported. This means that only a list of AS numbers is supported, and sets and sublists are not supported.

65000

CommunitySetInclude

array

The community set for fuzzy matching.

A route matches the condition if the community in the match condition overlaps with the community of the route to be matched.

Each community is in the format of n:m, where n and m range from 1 to 65535. The community must comply with RFC 1997. Large communities (RFC 8092) are not supported.

This parameter is mutually exclusive with CommunitySetMatch and cannot be specified at the same time.

Note

Incorrect community configurations may prevent routes from being advertised to the on-premises data center.

string

The community set for fuzzy matching.

A route matches the condition if the community in the match condition overlaps with the community of the route to be matched.

Each community is in the format of n:m, where n and m range from 1 to 65535. The community must comply with RFC 1997. Large communities (RFC 8092) are not supported.

This parameter is mutually exclusive with CommunitySetMatch and cannot be specified at the same time.

Note

Incorrect community configurations may prevent routes from being advertised to the on-premises data center.

65000:100

CommunitySetMatch

array

The community set for exact matching.

A route matches the condition only if the community in the match condition is exactly the same as the community of the route to be matched.

Each community is in the format of n:m, where n and m range from 1 to 65535. The community must comply with RFC 1997. Large communities (RFC 8092) are not supported.

This parameter is mutually exclusive with CommunitySetInclude and cannot be specified at the same time.

Note

Incorrect community configurations may prevent routes from being advertised to the on-premises data center.

string

The community set for exact matching.

A route matches the condition only if the community in the match condition is exactly the same as the community of the route to be matched.

Each community is in the format of n:m, where n and m range from 1 to 65535. The community must comply with RFC 1997. Large communities (RFC 8092) are not supported.

This parameter is mutually exclusive with CommunitySetInclude and cannot be specified at the same time.

Note

Incorrect community configurations may prevent routes from being advertised to the on-premises data center.

65000:100

DestinationInstanceIds

array

The list of destination instance IDs to match. The following instance types are supported:

  • Virtual private cloud (VPC) instance IDs

  • Virtual border router (VBR) instance IDs

Note

The list of destination instance IDs takes effect only when the direction of the route map is outbound.

string

The list of destination instance IDs to match. The following instance types are supported:

  • Virtual private cloud (VPC) instance IDs

  • Virtual border router (VBR) instance IDs

Note

The list of destination instance IDs takes effect only when the direction of the route map is outbound.

vbr-gw8jiyiedko141709c903

DestinationInstanceIdsReverseMatch

boolean

Specifies whether to use the reverse match mode for the list of destination instance IDs. Valid values:

  • false (default): no. A route matches the condition if the destination instance ID of the route is included in DestinationInstanceIds.N.

  • true: yes. A route matches the condition if the destination instance ID of the route is not included in DestinationInstanceIds.N.

false

DestinationInstanceTypes

array

The list of destination instance types to match. The following instance types are supported:

  • VPC: VPC instance.

  • VBR: VBR instance.

Note

The list of destination instance types takes effect only when the direction of the route map is outbound.

string

The list of destination instance types to be matched by the route. The following instance types are supported:

  • VPC: VPC instance.

  • VBR: VBR instance.

Note

The list of destination instance types takes effect only when the direction of the route map is outbound.

VPC

DestinationRegionIds

array

The list of destination region IDs to match.

string

The list of destination region IDs to match.

all

DestinationRouteTableIds

array

The list of destination route table IDs to match.

Note

The list of destination route table IDs takes effect only when the direction of the route map is outbound.

string

The list of destination route table IDs to match.

Note

The list of destination route table IDs takes effect only when the route map direction is outbound.

vtb-wz9x2kcw75vsceun3a0wg

MatchAddressType

string

The IP address type of the route to match. Valid values:

  • IPv4: matches only IPv4 routes.

  • IPv6: matches only IPv6 routes.

You can leave this parameter empty to match routes of all types.

IPv4

RouteTypes

array

The list of route types to match. The following route types are supported:

  • System: system route, which is automatically generated by the system.

  • Custom: custom route, which is manually added by a user.

  • BGP: BGP route, which is propagated through the BGP routing protocol.

You can specify multiple route types.

string

The list of route types to match. The following route types are supported:

  • System: system route, which is automatically generated by the system.

  • Custom: custom route, which is manually added by a user.

  • BGP: BGP route, which is propagated through the BGP routing protocol.

You can specify multiple route types.

System

SourceInstanceIds

array

The list of source instance IDs to match. The following instance types are supported:

  • Virtual private cloud (VPC) instance IDs

  • Virtual border router (VBR) instance IDs

string

The list of source instance IDs to match. The following instance types are supported:

  • Virtual private cloud (VPC) instance IDs

  • Virtual border router (VBR) instance IDs

vpc-2zea9zsh6ce30nfcjlvyr

SourceInstanceIdsReverseMatch

boolean

Specifies whether to use the reverse match mode for the list of source instance IDs. Valid values:

  • false (default): no. A route matches the condition if the source instance ID of the route is included in SourceInstanceIds.N.

  • true: yes. A route matches the condition if the source instance ID of the route is not included in SourceInstanceIds.N.

false

SourceInstanceTypes

array

The list of source instance types to match. The following instance types are supported:

  • VPC: VPC instance.

  • VBR: VBR instance.

string

The list of source instance types to match. The following instance types are supported:

  • VPC: VPC instance.

  • VBR: VBR instance.

VPC

SourceRegionIds

array

The list of source region IDs to match.

string

The list of source region IDs to match.

cn-hongkong

SourceRouteTableIds

array

The list of source route table IDs to match.

string

The list of source route table IDs to match.

vtb-uf684wwipxgflzkpe4zgd

Name

string

The name of the rule.

Permit-Prod-Prefixes-Set-LP

Priority

integer

The priority of the rule. A smaller value indicates a higher priority.

10

RouteMapId

string

The ID of the route map.

rm-0a1b2c3d4e5f6a7b8

SetActions

object

The actions to perform for the route map rule. After a route meets all the match conditions defined in MatchConditions, the system processes the route based on the actions defined in this parameter.

AsPathPrepend

array

The AS path to prepend when the regional gateway receives a route or performs a publish route entry operation.

This parameter is mutually exclusive with AsPathReplace and cannot be specified at the same time.

This parameter specifies the action to execute after a route meets the match conditions.

integer

The AS path to prepend when the regional gateway receives a route or performs a publish route entry operation.

This parameter is mutually exclusive with AsPathReplace and cannot be specified at the same time.

This parameter specifies the action to execute after a route meets the match conditions.

65000

AsPathReplace

array

The AS path to replace when the regional gateway receives a route or performs a publish route entry operation. The original AS path of the route is replaced with the list of AS numbers specified in this parameter.

This parameter is mutually exclusive with AsPathPrepend and cannot be specified at the same time.

This parameter specifies the action to execute after a route meets the match conditions.

integer

The AS path to replace when the regional gateway receives a route or performs a publish route entry operation. The original AS path of the route is replaced with the list of AS numbers specified in this parameter.

This parameter is mutually exclusive with AsPathPrepend and cannot be specified at the same time.

This parameter specifies the action to execute after a route meets the match conditions.

65123

CommunityAdd

array

The community set to add to the route.

Each community is in the format of n:m, where n and m range from 1 to 65535. The community must comply with RFC 1997. Large communities (RFC 8092) are not supported.

This parameter is mutually exclusive with CommunityReplace and cannot be specified at the same time.

This parameter specifies the action to perform after a route meets the match conditions.

Note

Incorrect community configurations may prevent routes from being advertised to the on-premises data center.

string

The community set to add to the route.

Each community is in the format of n:m, where n and m range from 1 to 65535. The community must comply with RFC 1997. Large communities (RFC 8092) are not supported.

This parameter is mutually exclusive with CommunityReplace and cannot be specified at the same time.

This parameter specifies the action to perform after a route meets the match conditions.

Note

Incorrect community configurations may prevent routes from being advertised to the on-premises data center.

65000:100

CommunityReplace

array

The community set to replace the original community of the route.

Each community is in the format of n:m, where n and m range from 1 to 65535. The community must comply with RFC 1997. Large communities (RFC 8092) are not supported.

This parameter is mutually exclusive with CommunityAdd and cannot be specified at the same time.

This parameter specifies the action to perform after a route meets the match conditions.

Note

Incorrect community configurations may prevent routes from being advertised to the on-premises data center.

string

The community set to replace the original community of the route.

Each community is in the format of n:m, where n and m range from 1 to 65535. The community must comply with RFC 1997. Large communities (RFC 8092) are not supported.

This parameter is mutually exclusive with CommunityAdd and cannot be specified at the same time.

This parameter specifies the action to perform after a route meets the match conditions.

Note

Incorrect community configurations may prevent routes from being advertised to the on-premises data center.

65000:200

NextPriority

integer

Policy priority of the associated next route map rule.

  • You can set policy priority of the associated route map rule only when RouteAction is set to Permit. Only the routes that are permitted can continue to match the associated next route map rule.

  • Policy priority of the associated next route map rule must be lower than policy priority of the current route map rule.

1

RouteAction

string

The action to perform after all conditions are met. Valid values:

  • Permit: permits the matched route.

  • Deny: denies the matched route.

Permit

RouteMapRuleId

string

The ID of the route map rule.

rmr-3dm13f66wtctcnydup

Status

string

The status of the route map rule. Valid values:

  • Creating: The rule is being created.

  • Updating: The rule is being updated.

  • Active: The rule is available.

  • Deleting: The rule is being deleted.

  • Deleted: The rule is deleted.

Active

Examples

Success response

JSON format

{
  "TotalCount": 2,
  "RequestId": "EF44D7B7-6248-5A60-8A4C-A92388605A57",
  "NextToken": "dd20****",
  "MaxResults": 20,
  "RouteMapRules": [
    {
      "Description": "Matches production prefixes from on-prem and sets a higher local preference.",
      "MatchConditions": {
        "AddressPrefixesInclude": [
          "10.0.0.0/8"
        ],
        "AddressPrefixesMatch": [
          "10.0.0.0/8"
        ],
        "AsPathsInclude": [
          65000
        ],
        "AsPathsMatch": [
          65000
        ],
        "CommunitySetInclude": [
          "65000:100"
        ],
        "CommunitySetMatch": [
          "65000:100"
        ],
        "DestinationInstanceIds": [
          "vbr-gw8jiyiedko141709c903"
        ],
        "DestinationInstanceIdsReverseMatch": false,
        "DestinationInstanceTypes": [
          "VPC"
        ],
        "DestinationRegionIds": [
          "all"
        ],
        "DestinationRouteTableIds": [
          "vtb-wz9x2kcw75vsceun3a0wg"
        ],
        "MatchAddressType": "IPv4",
        "RouteTypes": [
          "System"
        ],
        "SourceInstanceIds": [
          "vpc-2zea9zsh6ce30nfcjlvyr"
        ],
        "SourceInstanceIdsReverseMatch": false,
        "SourceInstanceTypes": [
          "VPC"
        ],
        "SourceRegionIds": [
          "cn-hongkong"
        ],
        "SourceRouteTableIds": [
          "vtb-uf684wwipxgflzkpe4zgd"
        ]
      },
      "Name": "Permit-Prod-Prefixes-Set-LP",
      "Priority": 10,
      "RouteMapId": "rm-0a1b2c3d4e5f6a7b8",
      "SetActions": {
        "AsPathPrepend": [
          65000
        ],
        "AsPathReplace": [
          65123
        ],
        "CommunityAdd": [
          "65000:100"
        ],
        "CommunityReplace": [
          "65000:200"
        ],
        "NextPriority": 1,
        "RouteAction": "Permit"
      },
      "RouteMapRuleId": "rmr-3dm13f66wtctcnydup",
      "Status": "Active"
    }
  ]
}

Error codes

HTTP status code

Error code

Error message

Description

400 IllegalParam.NextToken NextToken is illegal The error message returned because the NextToken parameter is set to an invalid value.
400 InvalidParameter.MaxResults The specified MaxResults is invalid. The error message returned because the MaxResults parameter is set to an invalid value.
400 InvalidParameter.RouteMapIds The specified RouteMapIds is invalid. The specified RouteMapIds is invalid.
400 InvalidParameter.Filter The specified Filter is invalid. The specified Filter is invalid.
400 InvalidParameter.RouteMapRuleIds The specified parameter "RouteMapRuleIds" is invalid. The specified parameter "RouteMapRuleIds" is invalid.
400 InvalidParameter.RouteMapId The specified parameter RouteMapId is invalid. The parameter RouteMapId entered is illegal.
400 MissingParameter.RouteMapIdOrRouteMapRuleIds The input parameter "RouteMapId" or "RouteMapRuleIds" that is mandatory for processing this request is not supplied. The input parameter "RouteMapId" or "RouteMapRuleIds" that is mandatory for processing this request is not supplied.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.