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

中转路由器

复制全文
下载 pdf
路由条目
CreateTransitRouterRouteEntry - 为TR路由表添加静态路由条目
复制全文
下载 pdf
CreateTransitRouterRouteEntry - 为TR路由表添加静态路由条目
调用CreateTransitRouterRouteEntry接口为指定的中转路由器路由表添加静态路由条目。​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
下方仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。​
Action String 必选 示例值:CreateTransitRouterRouteEntry​
接口名称。当前 API 的名称为CreateTransitRouterRouteEntry。​
​
Version String 必选 示例值:2020-04-01​
接口版本。当前 API 的版本为2020-04-01。​
​
TransitRouterRouteTableId String 必选 示例值:tr-rtb-hy13n2l4c6c0v****​
中转路由器实例关联的路由表的ID。您可以调用DescribeTransitRouterRouteTables接口获取TR路由表的ID。​
​
TransitRouterRouteEntryNextHopType String 必选 示例值:Attachment​
路由条目的下一跳类型。取值如下:​
  • Attachment:网络实例,表示匹配该路由条目的流量会被转发到指定的网络实例。​
  • BlackHole:黑洞,表示匹配该路由条目的流量会被丢弃。​
​
TransitRouterRouteEntryNextHopId String 可选 示例值:tr-attach-1ffn6gjk****​
路由条目的下一跳ID。​
​
DestinationCidrBlock String 可选 示例值:192.168.XX.XX/24​
路由条目的目标网段。​
该参数与DestinationPrefixListId不可同时传入。​
​
Description String 可选 示例值:This transit router is used for test.​
TR路由表路由条目的描述信息。​
  • 必须以字母、数字或中文开头,可包含字母、数字、中文和以下特殊字符:英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、短横线(-)、中文逗号(,)、中文句号(。)。​
  • 长度限制为0 ~ 255个字符。​
  • 不传入该参数或该参数不传入数值时,默认为空字符串。​
​
TransitRouterRouteEntryName String 可选 示例值:routeentry-01​
TR路由表路由条目的名称。​
  • 必须以字母、数字或中文开头,可包含字母、数字、中文及以下特殊字符:点号(.)、下划线(_)和短横线(-)。​
  • 长度限制为1 ~ 128个字符。​
  • 不传入该参数或该参数不传入数值时,默认为TR路由条目的ID。​
​
DestinationPrefixListId String 可选 示例值:pl-1234567890abcdef0​
路由条目的目标前缀列表 ID,用于指定路由条目的目标地址范围。​
该参数与DestinationCidrBlock不可同时传入。​
说明​
中转路由器支持VPC前缀列表的功能正在邀测中,如需使用,请联系客户经理。​
​
​
​
返回参数​
下方仅列出本接口特有的返回参数。更多信息请参见返回结构。​
TransitRouterRouteEntryId String 示例值:tr-rte-1i5i8khf9m58gae5kcx6****​
路由条目的ID。​
​
​
​
请求示例​
​
GET /?Action=CreateTransitRouterRouteEntry&Version=2020-04-01&TransitRouterRouteTableId=tr-rtb-hy13n2l4c6c0v****&TransitRouterRouteEntryNextHopType=Attachment&DestinationCidrBlock=192.168.XX.XX/24 HTTP/1.1​
Host: transitrouter.cn-beijing.volcengineapi.com​
X-Date: 20250804T035640Z​
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20250804/cn-beijing/transitrouter/request, SignedHeaders=host;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f​
​
返回示例​
​
{​
"ResponseMetadata": {​
"RequestId": "20250804115643130207110174097CF7",​
"Action": "CreateTransitRouterRouteEntry",​
"Version": "2020-04-01",​
"Service": "transitrouter",​
"Region": "cn-beijing"​
},​
"Result": {​
"TransitRouterRouteEntryId": "tr-rte-1i5i8khf9m58gae5kcx6****"​
}​
}​
​
错误码​
下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。​
​
状态码​
错误码​
错误信息​
说明​
400​
InvalidCidr.Malformed​
The specified cidr block is malformed.​
指定的网段格式不合法。​
400​
InvalidDescription.Malformed​
The specified description is malformed.​
指定的描述格式不合法。请修复描述格式后重试。​
400​
InvalidDescription.Malformed​
The specified description is malformed. Ensure the maximum length of description is 255.​
指定的描述格式不合法。描述长度不能超过255个字符。​
400​
InvalidName.Malformed​
The specified name is malformed.​
指定的名称格式不合法。请修复名称格式后重试。​
400​
InvalidName.Malformed​
The specified name is malformed. Ensure the maximum length of name is 128.​
指定的名称格式不合法。名称长度不能超过128个字符。​
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​
InvalidTransitRouterRouteEntry.DestinationInvalid​
Cannot specify destination CIDR and prefix list simultaneously.​
不支持在创建路由条目时同时指定目的网段和目的前缀列表。​
400​
InvalidTransitRouterRouteEntry.IPv4OnlyAttachment​
The specified Transit Router attachment supports IPv4 only, and cannot configure IPv6 route with it.​
指定的网络实例连接为IPv4单栈,不支持配置IPv6路由。​
400​
InvalidTransitRouterRouteEntry.IPv6OnlyAttachment​
The specified Transit Router attachment supports IPv6 only, and cannot configure IPv4 route with it.​
指定的网络实例连接为IPv6单栈,不支持配置IPv4路由。​
400​
InvalidTransitRouterRouteEntry.MulticastCidrNotSupported​
The specified cidr is a multicast cidr, and can not be configured as route entry.​
不支持配置目的网段为组播网段的路由条目。​
400​
InvalidTransitRouterRouteEntry.NextHopMissing​
The specified Transit Router route entry next hop is missing.​
指定的中转路由器路由条目下一跳不能为空。​
400​
InvalidTransitRouterRouteEntry.NextHopTypeMalformed​
The specified Transit Router route entry next hop type is malformed, only BlackHole and Attachment are supported.​
指定的中转路由器路由下一跳类型不支持,仅支持黑洞和网络实例连接。​
400​
InvalidTransitRouterRouteEntry.NextHopUnsupported​
The specified Transit Router route type is black hole, and does not support configuring next hop.​
黑洞路由不支持指定下一跳。​
400​
MissingParameter​
The request is missing a required parameter.​
该请求缺少必要参数。​
400​
QuotaExceeded.TransitRouterEcmpRouteEntry​
You've reached the maximum number of next hop attachment that one ECMP route entry can have.​
已到达可配置的最大等价路由条目数量上限。​
400​
QuotaExceeded.TransitRouterRouteEntry​
You've reached the maximum number of route entries that one Transit Router route table can have.​
已达到单个中转路由器路由表的路由条目数上限。​
403​
Forbidden.NoPermissionToOperate​
You are not authorized to operate the specified resource.​
无权限操作指定的资源。​
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​
InvalidTransitRouter.NotFound​
The specified Transit Router does not exist.​
指定的中转路由器不存在。​
404​
InvalidTransitRouterAttachment.NotFound​
The specified Transit Router attachment does not exist.​
指定的网络实例连接不存在。​
404​
InvalidTransitRouterRouteEntry.NextHopNotFound​
The specified Transit Router route entry next hop attachment does not exist.​
指定的中转路由器路由条目下一跳实例不存在。​
404​
InvalidTransitRouterRouteTable.NotFound​
The specified route table does not exist.​
指定的中转路由器路由表不存在。​
409​
InvalidTransitRouterRouteEntry.DestinationCidrBlockConflict​
The specified Transit Router route entry destination already exists.​
指定的目的网段在该中转路由器路由表中已经存在。​
409​
InvalidTransitRouterRouteEntry.DestinationPrefixListCidrConflict​
The CIDRs in the specified destination prefix list conflict with existing routes in the Transit Router route table.​
指定的前缀列表中存在网段与中转路由器路由表中的已有路由冲突。​
409​
InvalidTransitRouterRouteEntry.DestinationPrefixListConflict​
Cannot configure multiple routes with an empty prefix list.​
指定的前缀列表为空,不支持使用空的前缀列表创建多个路由。​
500​
InternalError​
An internal error has occurred.​
发生内部错误。​
​
​
最近更新时间:2026.03.24 10:26:55
这个页面对您有帮助吗?
有用
有用
无用
无用