Creates a route map for a CEN instance.

Make the API call

You can use OpenAPI Explorer to make API calls, search for API calls, perform debugging, and generate SDK example code.

Request parameters

Parameter Type Required? Example value Parameter
Action String  No CreateCenRouteMap

The name of the action. Valid value: CreateCenRouteMap.

CenId String  Yes cen-7qthudw0ll6jmc****

The ID of the CEN instance.

CenRegionId String  Yes cn-hangzhou

The ID of the region to which the CEN instance belongs. To query the region ID, call DescribeRegions.

Priority Integer Yes. 3

The priority of the route map. Value range: 1 to 100. A lower value indicates a higher priority.

Note After configuring a route map with a specific priority value, you cannot set the same priority value for another route map that is applied in the same region and in the same direction. When route maps are executed to evaluate a route, the system first checks whether the route matches the conditional statements of the route map with the highest priority. Therefore, we recommend that you specify an appropriate priority for each route map.
TransmitDirection String  Yes RegionIn

The direction in which the route map is applied. Valid values:

  • RegionIn: The direction in which routes are imported to the regional gateway of the CEN.

    For example, routes are imported to the regional gateway from an instance in the current region or another region.

  • RegionOut: The direction in which routes are exported from the regional gateway of the CEN.

    For example, routes are exported from the regional gateway of the current region to an instance in the same region, or to the regional gateway in another region.

MapResult String  Yes Permit

The action that is performed to a route if the route matches all the match conditions. Valid values:

  • Permit: Permit the route.
  • Deny: Deny the route.
NextPriority Integer No 20

The priority of the next route map that is associated with the current route map. Value range: 1 to 100.

  • If NextPriority is not set, the current route map is not associated with any route map that is ordered next to the current route map.
  • If this parameter is set to 1, the current route map is associated with the next route map.
  • If this parameter is set to a value other than 1, the priority of the associated route map must be lower than the priority of the current route map, that is, the value of NextPriority must be greater than the value of Priority.

Only when MapResult is set to Permit, the routes which match all the matching criteria will be evaluated by the associated route map that is configured with a specific priority value.

Description String No abc

The description of the route map.

SourceRegionIds.N RepeatList No cn-beijing

A match statement that indicates the list of IDs of the source regions. You can enter a maximum of 32 region IDs.

SourceInstanceIds.N RepeatList No vpc-adeg3544fdf34vf****

A match statement that indicates the list of IDs of the source instances.

You can enter IDs of Virtual Private Cloud (VPC) instances, Virtual Border Router (VBR) instances, mainland China Cloud Connect Network (CCN) instances, and Smart Access Gateway (SAG) instances. You can enter a maximum of 32 instance IDs.

SourceInstanceIdsReverseMatch Boolean No false

Indicates whether to enable the reverse match method for the SourceInstanceIds match condition. Valid values:

  • false (default): If the ID of a route's source instance is included in SourceInstanceIds, the route is permitted.
  • true: If the ID of a route's source instance is not included in SourceInstanceIds, the route is permitted.
DestinationInstanceIds.N RepeatList No vpc-afrfs434465fdf****

A match statement that indicates the list of IDs of the destination instances.

You can enter IDs of VPC instances, VBR instances, mainland China CCN instances, and Smart Access Gateway (SAG) instances. You can enter a maximum of 32 instance IDs.

Note This parameter is valid only when the TransmitDirection parameter is set to RegionOut and the ID of the destination instance is the ID of an instance in this region.
DestinationInstanceIdsReverseMatch Boolean No false

Indicates whether to enable the reverse match method for the DestinationInstanceIds match condition. Valid values:

  • false (default): If the ID of a route's destination instance is included in DestinationInstanceIds, the route is permitted.
  • true: If the ID of a route's destination instance is not included in DestinationInstanceIds, the route is permitted.
SourceRouteTableIds.N RepeatList No vtb-adfr233vf34rvd4****

A match statement that indicates the list of IDs of the source route tables. You can enter a maximum of 32 route table IDs.

DestinationRouteTableIds.N RepeatList No vtb-adefrgtr144vf****

A match statement that indicates the list of IDs of the destination route tables. You can enter a maximum of 32 route table IDs.

Note This parameter is valid only when the TransmitDirection parameter is set to RegionOut and the destination route table is a route table in this region.
SourceChildInstanceTypes.N RepeatList No VPC

A match statement that indicates the list of source instance types. Valid values:

  • VPC: VPC
  • VBR: VBR
  • CCN: Mainland China CCN
DestinationChildInstanceTypes.N RepeatList No VPC

A match statement that indicates the list of destination instance types. Valid values:

  • VPC: VPC
  • VBR: VBR
  • CCN: Mainland China CCN
Note This parameter is valid only when the TransmitDirection parameter is set to RegionOut and the type of the destination instance is the type of an instance in this region.
DestinationCidrBlocks.N RepeatList No 1.1.1.0/10

A match statement that indicates the prefix list. The prefix is in the CIDR format. You can enter a maximum of 32 CIDR blocks.

CidrMatchMode String No Include

A match statement. It indicates the mode in which the prefix attribute is matched. Valid values:

  • Include: Fuzzy match. If the prefix of a route is contained in the prefix in the match condition, the route matches the condition.

    For example, if the prefix in the match condition is set to 1.1.0.0/16 and the match method is set to Fuzzy Match, the route with the prefix of 1.1.1.0/24 matches the condition.

  • Complete: Exact match. A route matches the condition only when the prefix of the route is the same as the prefix in the match condition.

    For example, if the prefix in the match condition is set to 1.1.0.0/16 and the match method is set to Exact Match, only the route with the prefix of 1.1.1.0/16 matches the condition.

RouteTypes.N RepeatList No System

A match statement that indicates the list of route types. Valid values:

  • System: System routes generated by the system.
  • Custom: Custom routes added by users.
  • BGP: Routes advertised to BGP.

Multiple route types can be entered.

MatchAsns.N RepeatList No 65501

A match statement that indicates the AS path list. The AS path is a well-known mandatory attribute, which describes the numbers of the ASs that a BGP route passes through during transmission.

Only support AS SEQUENCE. AS SET, AS CONFED SEQUENCE, or AS CONFED SET are not supported. Specifically, only a list of AS numbers are supported. Sets or sub-lists are not supported.

AsPathMatchMode String No Include

A match statement. It indicates the mode in which the AS path attribute is matched. Valid values:

  • Include: Fuzzy match. A route matches the condition if the AS path in the route overlaps the AS path in the match condition.
  • Complete: Exact match. A route matches the condition only when the AS path of the route is the same as the AS path in the match condition.
MatchCommunitySet.N RepeatList No 65501:1

A match statement that indicates the community set. The format of each community is nn:nn, which ranges from 1 to 65535. You can enter a maximum of 32 communities. Communities must comply with RFC 1997. Large communities (RFC 8092) are not supported.

Note Community configuration errors may cause a problem that prevents the route from being published to the on-premises data center.
CommunityMatchMode String No Include

A match statement. It indicates the mode in which the community attribute is matched. Valid values:

  • Include: Fuzzy match. A route matches the condition if the community of the route overlaps the community in the match condition.
  • Complete: Exact match. A route matches the condition only when the community of the route is the same as the community in the match condition.
CommunityOperateMode String No Additive

An action statement. It indicates the mode in which the community attribute is operated. Valid values:

  • Additive: Sets a value for the community attribute.
  • Replace: Modifies the value of the community attribute.
OperateCommunitySet.N RepeatList No 65501:1

An action statement that operates the community attribute. The format of each community is nn:nn, which ranges from 1 to 65535. You can enter a maximum of 32 communities. Communities must comply with RFC 1997. Large communities (RFC 8092) are not supported.

Note Community configuration errors may cause a problem that prevents the route from being published to the on-premises data center.
Preference Integer No 22

An action statement that modifies the priority of the route. Value range: 1 to 100. The default priority of a route is 50. A lower value indicates a higher preference.

PrependAsPath.N RepeatList No 65501

An action statement that indicates an AS path is prepended when the regional gateway receives or advertises a route.

The requirements for configuring this parameter vary depending on the application direction of the route map. The requirements are described as follows:

  • If the TransmitDirection parameter is set to RegionIn, and you want to configure the AS Path prepending, the match conditions must include the Source Instance IDs and the Source Region. Furthermore, you must specify the same value for Source Region and Region.
  • If the TransmitDirection parameter is set to RegionOut, and you want to configure the AS Path prepending, the match conditions must include the Destination Instance IDs.

Response parameters

Parameter Type Example value Description
RequestId String  54B48E3D-DF70-471B-AA93-08E683A1B457

The ID of the request.

RouteMapId String  cenrmap-w4yf7toozfol3q****

The ID of the route map.

Examples

Request example

http(s)://[Endpoint]/? Action=CreateCenRouteMap
&CenId=cen-7qthudw0ll6jmc****
&CenRegionId=cn-hangzhou
&Priority=3
&TransmitDirection=RegionIn
&MapResult=Permit
&<CommonParameters>

Response example

XML format

<CreateCenRouteMapResponse>
    <RequestId>62172DD5-6BAC-45DF-8D44-6DFG456BAC</RequestId>
    <RouteMapId>rmap-df12d22sd23****</RouteMapId>
</CreateCenRouteMapResponse>

JSON format

{
    "RequestId": "62172DD5-6BAC-45DF-8D44-56SDF467BAC",
    "RouteMapId": "cenrmap-w4yf7toozfol3q****"
}

Errors

HTTP status code Error code Error message Description
400 Forbidden.CenRouteMapExist The specified CEN route map ID already exists. The specified route map already exists.

For a list of error codes, visit the API Error Center.