CreateCenRouteMap
Route policies let you filter routing information and customize your cloud network connectivity. You can call the CreateCenRouteMap API to create a route policy.
Operation description
Route maps are processed in order of priority. A lower value indicates a higher priority. Each route map consists of a set of match conditions and an action. The system evaluates a route against the match conditions of route maps in descending order of priority. If a route meets all match conditions in a route map, the system applies the corresponding action to either permit or deny the route. If a route is permitted, you can also modify its route attributes. If a route does not match any route map, the system permits it by default. For more information, see Route map overview.
The CreateCenRouteMap API is asynchronous. When you call this API, the system returns a route map ID while the route map is being created in the background. You can call the DescribeCenRouteMaps API to query the route map's status.
A status of Creating indicates that the route map is being created. In this state, you can only perform query operations.
A status of Active indicates that the route map has been created.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cen:CreateCenRouteMap |
create |
*CenInstance
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| CenId |
string |
Yes |
The ID of the Cloud Enterprise Network (CEN) instance. |
cen-7qthudw0ll6jmc**** |
| CenRegionId |
string |
Yes |
The ID of the region where the route map is applied. You can call the DescribeChildInstanceRegions operation to query region IDs. |
cn-hangzhou |
| TransmitDirection |
string |
Yes |
The direction in which the route map is applied. Valid values:
For example, routes are advertised from a network instance in the current region to the region gateway, or from another region to the region gateway in the current region.
For example, routes are advertised from the region gateway in the current region to a network instance in the current region, or to a region gateway in another region. |
RegionIn |
| Description |
string |
No |
The description of the route map. The description can be empty or 1 to 256 characters long. It cannot start with |
desctest |
| Priority |
integer |
Yes |
The priority of the route map. The value can be an integer from 1 to 100. A smaller value indicates a higher priority. Note
The priorities of route maps that are applied in the same region and direction must be unique. The system matches a route against these maps in ascending order of priority. Therefore, set priorities carefully to ensure the desired matching order. |
3 |
| MapResult |
string |
Yes |
The action to take if a route matches all conditions. Valid values:
|
Permit |
| NextPriority |
integer |
No |
The priority of the next associated route map.
|
20 |
| CidrMatchMode |
string |
No |
The match mode for the prefix list. Valid values:
For example, a prefix of 10.10.0.0/16 in the match conditions matches the route 10.10.1.0/24.
For example, a prefix of 10.10.0.0/16 in the match conditions matches only the route 10.10.0.0/16. |
Include |
| AsPathMatchMode |
string |
No |
The match mode for the AS Path list. Valid values:
|
Include |
| CommunityMatchMode |
string |
No |
The match mode for the community attribute. Valid values:
|
Include |
| CommunityOperateMode |
string |
No |
Specifies how to modify the community attribute of a matching route. Valid values:
|
Additive |
| Preference |
integer |
No |
The new preference value to set for matching routes. The value can be an integer from 1 to 100. The default preference is 50. A smaller value indicates a higher preference. |
50 |
| SourceInstanceIdsReverseMatch |
boolean |
No |
Specifies whether to perform a reverse match for the source instance IDs. Valid values:
|
false |
| DestinationInstanceIdsReverseMatch |
boolean |
No |
Specifies whether to perform a reverse match for the destination instance IDs. Valid values:
|
false |
| MatchAddressType |
string |
No |
The IP version of routes to match. Valid values:
If you do not specify this parameter, the route map matches routes of all IP versions. |
IPv4 |
| TransitRouterRouteTableId |
string |
No |
The ID of the route table of the Transit Router. If you do not specify a route table ID, the system automatically associates the route map with the default route table of the Transit Router. |
vtb-gw8nx3515m1mbd1z1**** |
| SourceInstanceIds |
array |
No |
The source instance IDs to match. The following instance types are supported:
You can enter up to 64 instance IDs. |
vpc-adeg3544fdf34vf**** |
|
string |
No |
The source instance IDs to match. The following instance types are supported:
You can enter up to 64 instance IDs. |
vpc-adeg3544fdf34vf**** |
|
| DestinationInstanceIds |
array |
No |
The destination instance IDs to match. The following instance types are supported:
You can enter up to 64 instance IDs. Note
This condition is evaluated only when the route map is applied in the outbound direction and to destination instances in the same region as the route map. |
vpc-afrfs434465fdf**** |
|
string |
No |
The destination instance IDs to match. The following instance types are supported:
You can enter up to 64 instance IDs. Note
This condition is evaluated only when the route map is applied in the outbound direction and to destination instances in the same region as the route map. |
vpc-afrfs434465fdf**** |
|
| SourceRouteTableIds |
array |
No |
The source route table IDs to match. You can enter up to 64 route table IDs. |
vtb-adfr233vf34rvd4**** |
|
string |
No |
The source route table IDs to match. You can enter up to 64 route table IDs. |
vtb-adfr233vf34rvd4**** |
|
| DestinationRouteTableIds |
array |
No |
The destination route table IDs to match. You can enter up to 64 route table IDs. Note
This parameter takes effect only when the route map is applied in the outbound direction and the destination route table belongs to a network instance in the same region as the route map. |
vtb-adefrgtr144vf**** |
|
string |
No |
The destination route table IDs to match. You can enter up to 64 route table IDs. Note
This parameter takes effect only when the route map is applied in the outbound direction and the destination route table belongs to a network instance in the same region as the route map. |
vtb-adefrgtr144vf**** |
|
| SourceRegionIds |
array |
No |
The source region IDs to match. You can enter up to 64 region IDs. You can call the DescribeChildInstanceRegions operation to query region IDs. |
cn-beijing |
|
string |
No |
The source region IDs to match. You can enter up to 64 region IDs. You can call the DescribeChildInstanceRegions operation to query region IDs. |
cn-beijing |
|
| SourceChildInstanceTypes |
array |
No |
The source instance types to match. The following instance types are supported:
You can enter multiple instance types. |
VPC |
|
string |
No |
The source instance types to match. The following instance types are supported:
You can enter multiple instance types. |
VPC |
|
| DestinationChildInstanceTypes |
array |
No |
The destination instance types to match. The following instance types are supported:
You can enter multiple instance types. Note
The list of destination instance types takes effect only when the route map is applied in the outbound direction and the destination instance is in the same region as the route map. |
VPC |
|
string |
No |
The destination instance types to match. The following instance types are supported:
You can enter multiple instance types. Note
The list of destination instance types takes effect only when the route map is applied in the outbound direction and the destination instance is in the same region as the route map. |
VPC |
|
| DestinationCidrBlocks |
array |
No |
A list of destination prefixes to match. Specify up to 64 prefixes in CIDR notation. Both IPv4 and IPv6 prefixes are supported. |
10.10.10.0/24 |
|
string |
No |
A list of destination prefixes to match. Specify up to 64 prefixes in CIDR notation. Both IPv4 and IPv6 prefixes are supported. |
10.10.10.0/24 |
|
| RouteTypes |
array |
No |
The route types to match. The following route types are supported:
You can enter multiple route types. |
System |
|
string |
No |
The route types to match. The following route types are supported:
You can enter multiple route types. |
System |
|
| MatchAsns |
array |
No |
The AS Path to match. You can enter up to 64 AS numbers. Note
You must specify the path as a sequence of AS numbers. Other formats, such as AS_SET, AS_CONFED_SEQUENCE, and AS_CONFED_SET, are not supported. |
65501 |
|
integer |
No |
The AS Path to match. You can enter up to 64 AS numbers. Note
You must specify the path as a sequence of AS numbers. Other formats, such as AS_SET, AS_CONFED_SEQUENCE, and AS_CONFED_SET, are not supported. |
65501 |
|
| MatchCommunitySet |
array |
No |
The community set to match. Each community must be in the You can enter up to 64 communities. Note
Incorrectly configuring the community can prevent routes from being advertised to your on-premises data center. |
65501:1 |
|
string |
No |
The community set to match. Each community must be in the You can enter up to 64 communities. Note
Incorrectly configuring the community can prevent routes from being advertised to your on-premises data center. |
65501:1 |
|
| OperateCommunitySet |
array |
No |
The community set to apply. Each community must be in the You can enter up to 32 communities. Note
Incorrectly configuring the community can prevent routes from being advertised to your on-premises data center. |
65501:1 |
|
string |
No |
The community set to apply. Each community must be in the You can enter up to 32 communities. Note
Incorrectly configuring the community can prevent routes from being advertised to your on-premises data center. |
65501:1 |
|
| PrependAsPath |
array |
No |
The AS Path to prepend when the region gateway receives or advertises a route. The requirements for prepending an AS Path vary based on the direction in which the route map is applied:
This action is applied to matching routes. You can enter up to 32 AS numbers. |
65501 |
|
integer |
No |
The AS Path to prepend when the region gateway receives or advertises a route. The requirements for prepending an AS Path vary based on the direction in which the route map is applied:
This action is applied to matching routes. You can enter up to 32 AS numbers. |
65501 |
|
| DestinationRegionIds |
array |
No |
The destination region IDs to match. You can enter up to 64 region IDs. |
|
|
string |
No |
The destination region IDs to match. You can enter up to 64 region IDs. |
cn-beijing |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response data. |
||
| RouteMapId |
string |
The ID of the route map. |
cenrmap-w4yf7toozfol3q**** |
| RequestId |
string |
The request ID. |
62172DD5-6BAC-45DF-8D44-56SDF467BAC |
Examples
Success response
JSON format
{
"RouteMapId": "cenrmap-w4yf7toozfol3q****",
"RequestId": "62172DD5-6BAC-45DF-8D44-56SDF467BAC"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | Forbidden.CenRouteMapExist | The specified CEN route map ID already exists. | The specified CEN route map ID already exists. |
| 400 | Invid.Parameter | When using PrependAsPath in the RegionIn, SourceRegionId must be local region Id. | |
| 400 | InvalidOperation.NoEffictiveAction | No effective action be configured. | The error message returned because the specified action is invalid. |
| 400 | IncorrectStatus.TransitRouterInstance | The status of TransitRouter is incorrect. | The error message returned because the transit router is in an invalid state. |
| 400 | InvalidDescription | Description is invalid. | The error message returned because the description is invalid. |
| 400 | IllegalParam.ZoneId | The specified ZoneId is illegal. | The error message returned because the specified zone is invalid. |
| 400 | Forbidden.NoMedAuthorized | Med operation is unauthorized. | Unable to operate on the specified Med routing policy. |
| 400 | InvalidOperation.MedRouteMapExist | Operation is invalid because the default med route map already exist. | The operation is invalid because there is already a med routeMap with the next hop destination for this Ecr instance. |
| 400 | InvalidOperation.MedRouteMapNotAllowedOtherAction | Operation is invalid because the default med not allowed other action. | the med policy does not allow to configure other policies. |
| 400 | InvalidOperation.MedRouteMapActionMustPermit | Operation is invalid because the default med map result must be permit. | Operation is invalid because the default med map result must be permit. |
| 400 | InvalidParameter.MedRouteMapDestInstanceIds | Param DestInstanceIds must be ecr instance id. | The destination instance list of med routeMap must be ECR instance. |
| 400 | InvalidParameter.MedRouteMapDestInstanceType | Param DestChildInstanceTypes must be ecr. | The destination instance type of the med routeMap must be ECR. |
| 400 | InvalidParameter | Invalid parameter. | The error message returned because the parameter is set to an invalid value. |
| 400 | Unauthorized | The AccessKeyId is unauthorized. | The error message returned because you do not have the permissions to perform this operation. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.