CreateRouteMapRule
Creates a route map rule.
Operation description
Request description
RouteMapIdis a required parameter used to specify the route map to which the new rule belongs.Priorityis a required parameter. A smaller value indicates a higher priority. Rule priorities within the same route map must be unique.NameandDescriptionare optional parameters used to identify the rule and describe its purpose.MatchConditionsis used to define the match conditions of the rule, andSetActionsis used to define the actions to be performed after a route meets all match conditions. Both are passed as JSON strings.DryRunis an optional parameter used to precheck the request without actually creating the route map rule.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cen:CreateRouteMapRule |
create |
*RouteMapRule
*RouteMap
|
None | None |
Request syntax
POST / HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ClientToken |
string |
No |
The client token used to ensure the idempotence of the request. Generate the value from your client and ensure it is unique across different requests. The client token can contain 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 |
Yes |
The ID of the route map. |
rm-0a1b2c3d4e5f6a7b8 |
| Name |
string |
No |
The name of the rule for easy identification. The name can be left empty or be 1 to 128 characters in length, and cannot start with http:// or https://. |
Permit-Prod-Prefixes-Set-LP |
| Description |
string |
No |
The detailed description of the rule. The description can be left empty or be 1 to 256 characters in length, and cannot start with http:// or https://. |
Matches production prefixes from on-prem and sets a higher local preference. |
| Priority |
integer |
Yes |
The priority of the rule. A smaller value indicates a higher priority. |
10 |
| DryRun |
boolean |
No |
Specifies whether to only precheck the request. Valid values:
|
false |
| MatchConditions |
object |
No |
The match conditions of the route map rule. The system performs the actions defined in SetActions only after a route meets all the match conditions defined in this parameter. |
|
| AddressPrefixesInclude |
array |
No |
The route prefix list for fuzzy matching. You can specify up to 64 IP address segments. A route is considered matched if the route prefix in the match condition contains the route prefix of the matched route. For example, a policy defined with 10.0.0.0/8 can fuzzy match a route with 10.10.10.0/24. IP address segments use the CIDR format, and support IPv4 and IPv6. This parameter is mutually exclusive with AddressPrefixesMatch and cannot be specified at the same time. |
|
|
string |
No |
The route prefix list for fuzzy matching. You can specify up to 64 IP address segments. A route is considered matched if the route prefix in the match condition contains the route prefix of the matched route. For example, a policy defined with 10.0.0.0/8 can fuzzy match a route with 10.10.10.0/24. IP address segments use the CIDR format, and support 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 |
No |
The route prefix list for exact matching. You can specify up to 64 IP address segments. A route is considered matched only if the route prefix in the match condition is exactly the same as the route prefix of the matched route. For example, a policy defined with 10.0.0.0/8 can only exactly match a route with 10.0.0.0/8. IP address segments use the CIDR format, and support IPv4 and IPv6. This parameter is mutually exclusive with AddressPrefixesInclude and cannot be specified at the same time. |
|
|
string |
No |
The route prefix list for exact matching. You can specify up to 64 IP address segments. A route is considered matched only if the route prefix in the match condition is exactly the same as the route prefix of the matched route. For example, a policy defined with 10.0.0.0/8 can only exactly match a route with 10.0.0.0/8. IP address segments use the CIDR format, and support 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 |
No |
The list of AS paths for fuzzy matching. You can specify up to 64 AS numbers. A route is considered matched if the AS path in the match condition overlaps with the AS path of the matched route. 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 only AS number lists are supported, and sets and sub-lists are not supported. |
|
|
integer |
No |
The list of AS paths for fuzzy matching. You can specify up to 64 AS numbers. A route is considered matched if the AS path in the match condition overlaps with the AS path of the matched route. 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 only AS number lists are supported, and sets and sub-lists are not supported. |
65000 |
|
| AsPathsMatch |
array |
No |
The list of AS paths for exact matching. You can specify up to 64 AS numbers. A route is considered matched only if the AS path in the match condition is exactly the same as the AS path of the matched route. 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 only AS number lists are supported, and sets and sub-lists are not supported. |
|
|
integer |
No |
The list of AS paths for exact matching. You can specify up to 64 AS numbers. A route is considered matched only if the AS path in the match condition is exactly the same as the AS path of the matched route. 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 only AS number lists are supported, and sets and sub-lists are not supported. |
65000 |
|
| CommunitySetInclude |
array |
No |
The community set for fuzzy matching. You can specify up to 64 communities. A route is considered matched if the community in the match condition overlaps with the community of the matched 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 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 |
No |
The community set for fuzzy matching. You can specify up to 64 communities. A route is considered matched if the community in the match condition overlaps with the community of the matched 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 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 |
No |
The community set for exact matching. You can specify up to 64 communities. A route is considered matched only if the community in the match condition is exactly the same as the community of the matched 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 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 |
No |
The community set for exact matching. You can specify up to 64 communities. A route is considered matched only if the community in the match condition is exactly the same as the community of the matched 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 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 |
No |
The list of destination instance IDs to match. You can specify the following types of instance IDs:
You can specify up to 64 instance IDs. Note
The list of destination instance IDs takes effect only when the direction of the route map is outbound. |
|
|
string |
No |
The list of destination instance IDs to match. You can specify the following types of instance IDs:
You can specify up to 64 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 |
No |
Specifies whether to use the reverse match mode for the destination instance ID list. Valid values:
|
false |
| DestinationInstanceTypes |
array |
No |
The list of destination instance types to match. Valid values:
You can specify multiple instance types. Note
The list of destination instance types takes effect only when the direction of the route map is outbound. |
|
|
string |
No |
The list of destination instance types to match. Valid values:
You can specify multiple instance types. Note
The list of destination instance types takes effect only when the direction of the route map is outbound. |
VPC |
|
| DestinationRegionIds |
array |
No |
The list of destination region IDs to match. You can specify up to 64 region IDs. |
|
|
string |
No |
The list of destination region IDs to match. You can specify up to 64 region IDs. |
all |
|
| DestinationRouteTableIds |
array |
No |
The list of destination route table IDs to match. You can specify up to 64 route table IDs. Note
The list of destination route table IDs takes effect only when the direction of the route map is outbound. |
|
|
string |
No |
The list of destination route table IDs to match. You can specify up to 64 route table IDs. Note
The list of destination route table IDs takes effect only when the direction of the route map is outbound. |
vtb-wz9x2kcw75vsceun3a0wg |
|
| MatchAddressType |
string |
No |
The IP address type of the routes to match. Valid values:
If this parameter is left empty, all types of routes are matched. |
IPv4 |
| RouteTypes |
array |
No |
The list of route types to match. Valid values:
You can specify multiple route types. |
|
|
string |
No |
The list of route types to match. Valid values:
You can specify multiple route types. |
System |
|
| SourceInstanceIds |
array |
No |
The list of source instance IDs to match. You can specify the following types of instance IDs:
You can specify up to 64 instance IDs. |
|
|
string |
No |
The list of source instance IDs to match. You can specify the following types of instance IDs:
You can specify up to 64 instance IDs. |
vpc-2zea9zsh6ce30nfcjlvyr |
|
| SourceInstanceIdsReverseMatch |
boolean |
No |
Specifies whether to use the reverse match mode for the source instance ID list. Valid values:
|
false |
| SourceInstanceTypes |
array |
No |
The list of source instance types to match. Valid values:
You can specify multiple instance types. |
|
|
string |
No |
The list of source instance types to match. Valid values:
You can specify multiple instance types. |
VPC |
|
| SourceRegionIds |
array |
No |
The list of source region IDs to match. You can specify up to 64 region IDs. |
|
|
string |
No |
The list of source region IDs to match. You can specify up to 64 region IDs. |
cn-hongkong |
|
| SourceRouteTableIds |
array |
No |
The list of source route table IDs to match. You can specify up to 64 route table IDs. |
|
|
string |
No |
The list of source route table IDs to match. You can specify up to 64 route table IDs. |
vtb-uf684wwipxgflzkpe4zgd |
|
| SetActions |
object |
No |
The actions to be performed 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 |
No |
The AS path to prepend when the regional gateway receives or advertises a route. You can specify up to 64 AS numbers. 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 |
No |
The AS path to prepend when the regional gateway receives or advertises a route. You can specify up to 64 AS numbers. 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 |
No |
The AS path to replace when the regional gateway receives or advertises a route. The original AS path of the route is replaced with the AS number list specified in this parameter. You can specify up to 64 AS numbers. 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 |
No |
The AS path to replace when the regional gateway receives or advertises a route. The original AS path of the route is replaced with the AS number list specified in this parameter. You can specify up to 64 AS numbers. 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 |
No |
The community set to add to the route. You can specify up to 64 communities. 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 be performed after a route meets the match conditions. Note
Incorrect community configurations may prevent routes from being advertised to the on-premises data center. |
|
|
string |
No |
The community set to add to the route. You can specify up to 64 communities. 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 be performed 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 |
No |
The community set to replace the original community of the route. You can specify up to 64 communities. 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 be performed after a route meets the match conditions. Note
Incorrect community configurations may prevent routes from being advertised to the on-premises data center. |
|
|
string |
No |
The community set to replace the original community of the route. You can specify up to 64 communities. 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 be performed 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 |
No |
Policy priority of the associated next route map rule.
|
1 |
| RouteAction |
string |
No |
The action to be performed after all conditions are met. Valid values:
Valid values:
|
Permit |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RouteMapRuleId |
string |
The ID of the route map rule. |
rmr-3dm13f66wtctcnydup |
| RequestId |
string |
The request ID. |
EF44D7B7-6248-5A60-8A4C-A92388605A57 |
Examples
Success response
JSON format
{
"RouteMapRuleId": "rmr-3dm13f66wtctcnydup",
"RequestId": "EF44D7B7-6248-5A60-8A4C-A92388605A57"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InstanceNotExist.RouteMap | The RouteMap does not exist. | The routing policy does not exist. |
| 400 | IncorrectStatus.RouteMap | RouteMap is not in a valid state for the operation. | RouteMap is not in a valid state for the operation. |
| 400 | InvalidOperation.RouteMapRulePriorityConflict | Operation is invalid because the route map rule priority conflicts with existing rules. | Operation is invalid because the route map rule priority conflicts with existing rules. |
| 400 | QuotaExceeded.RouteMapRule | The maximum number of RouteMap rule is exceeded. | The maximum number of RouteMap rule is exceeded. |
| 400 | QuotaExceeded.RouteMapRulePerEcr | The maximum number of RouteMap Rule per ECR instance is exceeded. | The maximum number of RouteMap Rule per ECR instance is exceeded. |
| 400 | InvalidOperation.RouteMapCheckFailed | Operation is invalid because the route map check failed. | Operation is invalid because the route map check failed. |
| 400 | InvalidOperation.UnsupportedRouteMapRule | Operation is invalid because the route map rule contains unsupported configurations for associated instances. | Operation is invalid because the route map rule contains unsupported configurations for associated instances. |
| 400 | ParamExclusive.AddressPrefixesIncludeAndAddressPrefixesMatch | AddressPrefixesInclude and AddressPrefixesMatch are mutually exclusive. | Parameter AddressPrefixesInclude and AddressPrefixesMatch are mutually exclusive. |
| 400 | ParamExclusive.CommunitySetMatchAndCommunitySetInclude | Parameter CommunitySetMatch And CommunitySetInclude are mutually exclusive. | Parameter CommunitySetMatch And CommunitySetInclude are mutually exclusive. |
| 400 | ParamExclusive.AsPathsMatchAndAsPathsInclude | Parameter AsPathsMatch And AsPathsInclude are mutually exclusive. | Parameter AsPathsMatch And AsPathsInclude are mutually exclusive. |
| 400 | InvalidParameter.MatchConditions.AddressPrefixesMatch | The specified parameter "MatchConditions.AddressPrefixesMatch" is invalid. | The specified parameter "MatchConditions.AddressPrefixesMatch" is invalid. |
| 400 | InvalidParameter.MatchConditions.AddressPrefixesInclude | The specified parameter "MatchConditions.AddressPrefixesInclude" is invalid. | The specified parameter "MatchConditions.AddressPrefixesInclude" is invalid. |
| 400 | InvalidParameter.MatchConditions.CommunitySetMatch | The specified parameter "MatchConditions.CommunitySetMatch" is invalid. | The specified parameter "MatchConditions.CommunitySetMatch" is invalid. |
| 400 | InvalidParameter.MatchConditions.CommunitySetInclude | The specified parameter "MatchConditions.CommunitySetInclude" is invalid. | The specified parameter "MatchConditions.CommunitySetInclude" is invalid. |
| 400 | InvalidParameter.MatchConditions.AsPathsMatch | The specified parameter "MatchConditions.AsPathsMatch" is invalid. | The specified parameter "MatchConditions.AsPathsMatch" is invalid. |
| 400 | InvalidParameter.MatchConditions.AsPathsInclude | The specified parameter "MatchConditions.AsPathsInclude" is invalid. | The specified parameter "MatchConditions.AsPathsInclude" is invalid. |
| 400 | InvalidParameter.MatchConditions.SourceInstanceTypes | The specified parameter "MatchConditions.SourceInstanceTypes" is invalid. | The specified parameter "MatchConditions.SourceInstanceTypes" is invalid. |
| 400 | InvalidParameter.MatchConditions.DestinationInstanceTypes | The specified parameter "MatchConditions.DestinationInstanceTypes" is invalid. | The specified parameter "MatchConditions.DestinationInstanceTypes" is invalid. |
| 400 | InvalidParameter.MatchConditions.MatchAddressType | The specified parameter "MatchConditions.MatchAddressType" is invalid. | The specified parameter "MatchConditions.MatchAddressType" is invalid. |
| 400 | InvalidParameter.MatchConditions.RouteTypes | The specified parameter "MatchConditions.RouteTypes" is invalid. | The specified parameter "MatchConditions.RouteTypes" is invalid. |
| 400 | InvalidParameter.SetActions.RouteAction | The specified parameter "SetActions.RouteAction" is invalid. | The specified parameter "SetActions.RouteAction" is invalid. |
| 400 | ParamExclusive.AsPathPrependAndAsPathReplace | Parameter AsPathPrepend And AsPathReplace are mutually exclusive. | Parameter AsPathPrepend And AsPathReplace are mutually exclusive. |
| 400 | ParamExclusive.CommunityAddAndCommunityReplace | Parameter CommunityAdd And CommunityReplace are mutually exclusive. | Parameter CommunityAdd And CommunityReplace are mutually exclusive. |
| 400 | InvalidParameter.SetActions.AsPathReplace | The specified parameter "SetActions.AsPathReplace" is invalid. | The specified parameter "SetActions.AsPathReplace" is invalid. |
| 400 | InvalidParameter.SetActions.AsPathPrepend | The specified parameter "SetActions.AsPathPrepend" is invalid. | The specified parameter "SetActions.AsPathPrepend" is invalid. |
| 400 | InvalidParameter.SetActions.CommunityAdd | The specified parameter "SetActions.CommunityAdd" is invalid. | The specified parameter "SetActions.CommunityAdd" is invalid. |
| 400 | InvalidParameter.SetActions.CommunityReplace | The specified parameter "SetActions.CommunityReplace" is invalid. | The specified parameter "SetActions.CommunityReplace" is invalid. |
| 400 | InvalidParameter.SetActions.NextPriority | The specified parameter "SetActions.NextPriority" is invalid. | The specified parameter "SetActions.NextPriority" is invalid. |
| 400 | InvalidParameter.RouteMapId | The specified parameter RouteMapId is invalid. | The parameter RouteMapId entered is illegal. |
| 400 | InvalidParameter.MatchConditions.SourceInstanceIds | The specified parameter "MatchConditions.SourceInstanceIds" is invalid. | The specified parameter "MatchConditions.SourceInstanceIds" is invalid. |
| 400 | InvalidParameter.SetActions.GatewayRegionId | The specified parameter "SetActions.GatewayRegionId" is invalid. | The specified parameter "SetActions.GatewayRegionId" is invalid. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.