You need to enable JavaScript to run this app.
文档中心
中转路由器

中转路由器

复制全文
下载 pdf
路由策略
CreateTransitRouterRoutePolicyEntry - 为路由策略添加路由策略条目
复制全文
下载 pdf
CreateTransitRouterRoutePolicyEntry - 为路由策略添加路由策略条目
调用CreateTransitRouterRoutePolicyEntry接口,为指定的路由策略添加路由策略条目。​
使用说明​
  • 单个路由策略中最多可添加20个路由策略条目。​
  • 路由策略已绑定TR路由表时,添加策略条目可能影响业务流量转发,请谨慎操作。​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
下方仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。​
Action String 必选 示例值:CreateTransitRouterRoutePolicyEntry​
接口名称。当前 API 的名称为CreateTransitRouterRoutePolicyEntry。​
​
Version String 必选 示例值:2020-04-01​
接口版本。当前 API 的版本为2020-04-01。​
​
IpPrefixMatchMode String 可选 示例值:Include​
路由前缀的匹配模式。​
  • Include:模糊匹配。匹配条件中的路由前缀包含被匹配路由的路由前缀即判定为匹配成功。例如:路由前缀为10.10.0.0/16 的策略条目可以模糊匹配到目标网段为10.10.1.0/24的路由。​
  • Complete(默认值):精确匹配。匹配条件中的路由前缀必须与被匹配路由的路由前缀一致,才判定为匹配成功。例如:路由前缀为10.10.0.0/16 的策略条目仅可以精确匹配到目标网段为10.10.0.0/16的路由。​
​
TransitRouterRoutePolicyTableId String 必选 示例值:tr-rpt-1i5i8khf9m58gae5kcx6****​
路由策略的ID。您可以调用DescribeTransitRouterRoutePolicyTables接口获取路由策略的ID。​
​
Priority Integer 必选 示例值:100​
路由策略条目的优先级,默认为空。取值范围为1~10000。数字越小则优先级越高。​
同一路由策略中不能存在优先级重复的路由策略条目。​
​
IpPrefixes.N String 可选 示例值:192.168.XX.XX/24​
路由策略条目的路由前缀。支持传入IPv4和IPv6网段。​
  • N:表示路由前缀的序号,取值范围1~200。多个路由前缀之间使用&分隔。​
  • 不传入该参数或该参数不传入数值时,默认为空字符串。​
说明​
中转路由器IPv6功能正在邀测中,如需使用,请联系客户经理。​
​
SourceResourceTypes.N String 可选 示例值:VPC​
路由策略条目的源实例类型。取值如下:​
  • VPC:私有网络。​
  • DirectConnectGateway:专线网关。​
  • TransitRouter:跨地域TR。​
说明​
  • N:表示源实例类型的序号,单次调用数量上限10个。多个源实例类型之间使用&分隔。​
  • 不传入该参数或该参数不传入数值时,默认为空字符串。​
​
SourceResourceIds.N String 可选 示例值:vpc-bp1aevy8sofi8mh1****​
路由策略条目的源实例ID。​
  • 您可以调用DescribeVpcs接口获取私有网络实例的ID。​
说明​
  • N:表示源实例ID的序号,取值范围1~10。多个源实例ID之间使用&分隔。​
  • 参数SourceResourceTypes.N传入数值后,该参数为必填。​
​
DestinationResourceTypes.N String 可选 示例值:VPC​
路由策略条目的目的实例类型。取值如下:​
  • 您可以调用DescribeVpcs接口获取私有网络实例的ID。​
说明​
  • N:表示源实例ID的序号,取值范围1~10。多个源实例ID之间使用&分隔。​
  • 参数SourceResourceTypes.N传入数值后,该参数为必填。​
​
DestinationResourceIds.N String 可选 示例值:vpc-bp1aevy8sofi8mh1****​
路由策略条目的目的实例ID。​
  • 您可以调用DescribeVpcs接口获取私有网络实例的ID。​
说明​
  • N:表示目的实例ID的序号,取值范围1~10。多个目的实例ID之间使用&分隔。​
  • 参数DestinationResourceIds.N传入数值后,该参数为必填。​
  • 指定的路由策略的作用方向为“In”时,不允许传入该字段。​
​
ActionResult String 必选 示例值:Permit​
路由策略条目的策略行为。取值如下:​
  • Permit:允许。指允许匹配该路由策略条目的路由通过。​
  • Deny:拒绝。指拒绝匹配该路由策略条目的路由通过。​
​
AsPathOperateMode String 可选 示例值:Additive​
路由策略条目的AsPath设置方式。取值如下:​
  • Additive:追加AsPath。指在允许通过的路由的AsPath最前面追加指定的AsPath。​
  • Replace:替换AsPath。指使用指定的AsPath替换允许通过的路由的AsPath。​
说明​
ActionResult取值为“Permit”时,该参数生效。​
​
ApplyAsPathValues.N String 可选 示例值:1234​
路由策略条目设置的路由AsPath。取值范围为1~4294967295。​
  • N:表示路由属性的序号,取值范围1~10。​
  • 多个路由属性之间使用&分隔。​
说明​
ActionResult取值为“Permit”时,该参数生效。​
​
Description String 可选 示例值:This transit router is used for test.​
路由策略条目的描述信息。​
  • 必须以字母、数字或中文开头,可包含字母、数字、中文和以下特殊字符:英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、短横线(-)、中文逗号(,)、中文句号(。)。​
  • 长度限制为0 ~ 255个字符。​
  • 不传入该参数或该参数不传入数值时,默认为空字符串。​
​
ClientToken String 可选 示例值:123e4567-e89b-12d3-a456-42665544****​
客户端Token,用于保证请求的幂等性。​
  • 该参数值由客户端自动生成,确保不同请求的取值唯一,避免当调用API超时或服务器内部错误时,客户端多次重试导致重复性操作。​
  • 取值仅支持ASCII字符,最大不超过64个字符。​
  • 未指定该参数值时,不进行幂等校验。​
​
PrefixListId String 可选 示例值:pl-1234567890abcdef0​
路由策略条目关联的前缀列表 ID。​
说明​
中转路由器支持VPC前缀列表的功能正在邀测中,如需使用,请联系客户经理。​
​
​
​
返回参数​
下方仅列出本接口特有的返回参数。更多信息请参见返回结构。​
TransitRouterRoutePolicyEntryId String 示例值:tr-rpe-13f1fdx5l****​
路由策略条目的ID。​
​
​
​
请求示例​
​
GET /?Action=CreateTransitRouterRoutePolicyEntry&Version=2020-04-01&TransitRouterRoutePolicyTableId=tr-rpt-1i5i8khf9m58gae5kcx6****&Priority=100&ActionResult=Permit HTTP/1.1​
Host: transitrouter.cn-beijing.volcengineapi.com​
X-Date: 20250722T113907Z​
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20250722/cn-beijing/transitrouter/request, SignedHeaders=host;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f​
​
返回示例​
​
{​
"ResponseMetadata": {​
"RequestId": "2025072219401622106011418461E668",​
"Action": "CreateTransitRouterRoutePolicyEntry",​
"Version": "2020-04-01",​
"Service": "transitrouter",​
"Region": "cn-beijing"​
},​
"Result": {​
"TransitRouterRoutePolicyEntryId": "tr-rpe-13f1fdx5l****"​
}​
}​
​
错误码​
下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。​
​
状态码​
错误码​
错误信息​
说明​
400​
IdempotentParameterMismatch​
Arguments on this idempotent request are inconsistent with arguments used in previous request(s).​
此幂等请求的参数与前一个请求中使用的参数不一致。​
400​
InvalidCidr.Malformed​
The specified cidr block is malformed.​
指定的网段格式不合法。​
400​
InvalidDescription.Malformed​
The specified description is malformed.​
指定的描述格式不合法。请修复描述格式后重试。​
400​
InvalidDescription.TooLong​
The specified description is malformed. Ensure the maximum length of description is 255.​
指定的描述格式不合法。描述长度不能超过255个字符。​
400​
InvalidParameter.ClientTokenMalformed​
The specified parameter ClientToken is malformed.​
指定的参数ClientToken格式不合法,长度不能超过64个ASCII字符。​
400​
InvalidTransitRouter.IPv6NotSupported​
The specified Transit Router does not support the IPv6 feature.​
指定的中转路由器实例不支持IPv6功能。​
400​
InvalidTransitRouter.InvalidBusinessStatus​
The request is denied because the specified Transit Router is shut down due to arrears.​
指定的中转路由器欠费关停,不支持当前操作。​
400​
InvalidTransitRouter.InvalidStatus​
The specified Transit Router is not in the correct status for the request.​
指定的中转路由器所处状态无法响应该请求。​
400​
InvalidTransitRouterAttachment.InvalidStatus​
The specified Transit Router Attachment is not in the correct status for the request.​
指定的网络实例连接所处状态无法响应该请求。​
400​
InvalidTransitRouterRoutePolicyEntry.ActionResultInvalid​
The specified Transit Router route policy entry action result is invalid. A route policy action result must be Permit or Deny.​
指定的策略行为不支持,仅支持允许和拒绝。​
400​
InvalidTransitRouterRoutePolicyEntry.AsPathInvalid​
The specified AsPath is invalid.​
指定的AsPath值不合法。​
400​
InvalidTransitRouterRoutePolicyEntry.AsPathOperateModeInvalid​
The specified AsPath operate mode of the route policy entry is invalid, only Additive and Replace are supported.​
指定的策略条目的AsPath操作不支持,仅支持添加和替换。​
400​
InvalidTransitRouterRoutePolicyEntry.IpPrefixMatchModeInvalid​
The specified ip prefix match mode of the Transit Router route policy entry is invalid.​
指定的路由策略匹配条件的路由前缀匹配类型不合法。​
400​
InvalidTransitRouterRoutePolicyEntry.IpPrefixMatchModeMismatch​
The specified ip prefix match mode does not match with the specified ip prefix.​
指定的路由前缀匹配类型和路由前缀不匹配。​
400​
InvalidTransitRouterRoutePolicyEntry.IpPrefixMatchModeNotSupported​
The Transit Router route policy entry does not support configuring ip prefix match mode.​
指定的策略路由条目不支持配置路由前缀模糊匹配。​
400​
InvalidTransitRouterRoutePolicyEntry.MatchConditionMissing​
The specified Transit Router route policy entry must have at least one match condition.​
指定的路由策略条目至少需配置一个匹配条件。​
400​
InvalidTransitRouterRoutePolicyEntry.PriorityInvalid​
The specified priority of the Transit Router route policy entry is invalid.​
指定的路由策略条目优先级不合法。​
400​
InvalidTransitRouterRoutePolicyEntry.ResourceTypeInvalid​
The specified resource type of the Transit Router route policy entry is invalid.​
指定的路由策略匹配条件的实例类型不合法。​
400​
LimitExceeded.RoutePolicyEntryApplyAsPath​
You've reached the limit on the number of AsPath that can be applied.​
已达到路由策略条目可支持配置的AsPath长度上限。​
400​
LimitExceeded.RoutePolicyEntryMatchCondition​
You've reached the limit on the number of match conditions that one route policy entry can have.​
已达到单路由策略条目的匹配条件数目上限。​
400​
MissingParameter​
The request is missing a required parameter.​
该请求缺少必要参数。​
400​
QuotaExceeded.TransitRouterRoutePolicyEntry​
You've reached the limit on the number of route policy entries that one Transit Router route policy can have.​
已达到单个路由策略的策略条目数上限。​
403​
Forbidden.CreateRoutePolicyEntryWithVpnAttachment​
You are not authorized to create route policy entry with vpn attachment on Transit Router.​
无权限创建关联VPN网络实例连接的路由策略条目,请在中转路由器上开通BGP路由类型的VPN网络实例连接白名单。​
403​
Forbidden.CreateTransitRouterBgpVpnAttachment​
You are not authorized to create BGP vpn attachment on Transit Router.​
无权限创建BGP类型的VPN网络实例连接,请在中转路由器产品开通对应的白名单。​
403​
Forbidden.TransitRouterIPv6​
You are not authorized to use ipv6 on Transit Router.​
未开通中转路由器IPv6功能,不支持该操作。​
403​
Forbidden.VpcPrefixList​
You are not authorized to use prefix list.​
无权限使用前缀列表,请开通前缀列表白名单。​
404​
InvalidPrefixList.NotFound​
The specified prefix list does not exist.​
指定的前缀列表不存在。​
404​
InvalidProject.NotFound​
The specified Project does not exist.​
指定的项目不存在。​
404​
InvalidTransitRouterRoutePolicy.NotFound​
The specified Transit Router route policy does not exist.​
指定的路由策略不存在。​
404​
InvalidTransitRouterRoutePolicyEntry.ResourceIdNotFound​
The specified Resource does not exist or is not attached to this Transit Router.​
指定的网络实例不存在或者没有关联到该中转路由器。​
409​
InvalidTransitRouterRoutePolicyEntry.ActionResultConflict​
The specified route attributes operation conflicts with the action result of route policy entry.​
指定的配置路由属性操作和路由策略的策略行为冲突,仅策略行为是允许的支持配置路由属性。​
409​
InvalidTransitRouterRoutePolicyEntry.DirectionConflict​
The route policy direction is In, destination resource types and ids are not supported.​
入方向路由策略,匹配条件不支持指定目的实例类型和目的实例列表。​
409​
InvalidTransitRouterRoutePolicyEntry.IpPrefixesInvalid​
Cannot specify destination CIDR and prefix list simultaneously.​
不支持同时指定目的网段和目的前缀列表。​
409​
InvalidTransitRouterRoutePolicyEntry.PriorityConflict​
The specified priority of the Transit Router route policy entry is conflict with another entry.​
指定的路由策略条目优先级和其它条目冲突。​
412​
IdempotentProcessing​
The request uses the same client token as a previous one that is still in process.​
幂等请求处理中。​
500​
InternalError​
An internal error has occurred.​
发生内部错误。​
​
​
最近更新时间:2026.03.24 10:26:55
这个页面对您有帮助吗?
有用
有用
无用
无用