You need to enable JavaScript to run this app.
导航

CreateTransitRouterRouteEntry

最近更新时间2024.04.11 16:25:32

首次发布时间2023.03.07 09:56:38

调用CreateTransitRouterRouteEntry接口为指定的中转路由器路由表添加静态路由条目。

请求参数

名称类型是否必选示例值描述
ActionStringCreateTransitRouterRouteEntry要执行的操作,取值为CreateTransitRouterRouteEntry。
VersionString2020-04-01API版本信息,当前版本为2020-04-01。
TransitRouterRouteTableIdStringtr-rtb-hy13n2l4c6c0v****中转路由器实例关联的路由表的ID。您可以调用DescribeTransitRouterRouteTables接口获取TR路由表的ID。

TransitRouterRouteEntryNextHopType

String

Attachment

路由条目的下一跳类型。取值如下:

  • Attachment:网络实例,表示匹配该路由条目的流量会被转发到指定的网络实例。
  • BlackHole:黑洞,表示匹配该路由条目的流量会被丢弃。

TransitRouterRouteEntryNextHopId

String

tr-attach-1ffn6gjk****

路由条目的下一跳ID。

说明

参数TransitRouterRouteEntryNextHopType为“Attachment”时,该参数必须填写。

DestinationCidrBlockString192.168.XX.XX/24路由条目的目标网段。

Description

String

This route entry is used for test.

TR路由表路由条目的描述信息。

  • 必须以字母、数字或中文开头,可包含字母、数字、中文及以下特殊字符:英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、短横线(-)、中文逗号(,)、中文句号(。)。
  • 长度限制为0 ~ 255个字符。
  • 不传入该参数或该参数不传入数值时,默认为空字符串。

TransitRouterRouteEntryName

String

routeentry-01

TR路由表路由条目的名称。

  • 必须以字母、数字或中文开头,可包含字母、数字、中文及以下特殊字符:点号(.)、下划线(_)和短横线(-)。
  • 长度限制为1 ~ 128个字符。
  • 不传入该参数或该参数不传入数值时,默认为TR路由条目的ID。

返回参数

名称
类型
示例值
描述
RequestIdString0ED8D006-F706-4D23-88ED-E11ED28D****请求ID。
TransitRouterRouteEntryIdStringtr-rte-1i5i8khf9m58gae5kcx6****路由条目的ID。

请求示例

GET /?Action=CreateTransitRouterRouteEntry&Version=2020-04-01&TransitRouterRouteTableId=tr-rtb-hy13n2l4c6c0v****&TransitRouterRouteEntryNextHopType=black&DestinationCidrBlock=192.168.XX.XX/24 HTTP/1.1
Host: open.volcengineapi.com
Service: transitrouter
Region: cn-guangzhou

返回示例

{
    "ResponseMetadata": {
        "RequestId": "0ED8D006-F706-4D23-88ED-E11ED28D****",
        "Action": "CreateTransitRouterRouteEntry",
        "Version": "2020-04-01",
        "Service": "transitrouter",
        "Region": "cn-guangzhou"
    },
    "Result": {
        "TransitRouterRouteEntryId": "tr-rte-1i5i8khf9m58gae5kcx6****"
    }
}

错误码

下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。

HttpCode错误码错误信息描述
400InvalidCidr.MalformedThe specified cidr block is malformed.指定的网段格式不合法。
400InvalidDescription.MalformedThe specified description is malformed. Ensure the maximum length of description is 255.指定的描述格式不合法。描述长度不能超过255个字符。
400InvalidDescription.MalformedThe specified description is malformed.指定的描述格式不合法。请修复描述格式后重试。
400InvalidName.MalformedThe specified name is malformed. Ensure the maximum length of name is 128.指定的名称格式不合法。名称长度不能超过128个字符。
400InvalidName.MalformedThe specified name is malformed.指定的名称格式不合法。请修复名称格式后重试。
400InvalidTransitRouter.InvalidBusinessStatusThe request is denied because the specified Transit Router is shut down due to arrears.指定的中转路由器欠费关停,不支持当前操作。
400InvalidTransitRouter.InvalidStatusThe specified Transit Router is not in the correct status for the request.指定的中转路由器所处状态无法响应该请求。
400InvalidTransitRouterRouteEntry.DestinationCidrBlockIsIPv6The specified Transit Router route entry destination cidr block is IPv6, only IPv4 cidr block is supported.指定的中转路由器路由为IPv6路由,当前仅支持IPv4路由。
400InvalidTransitRouterRouteEntry.NextHopMissingThe specified Transit Router route entry next hop is missing.指定的中转路由器路由条目下一跳不能为空。
400InvalidTransitRouterRouteEntry.NextHopTypeMalformedThe specified Transit Router route entry next hop type is malformed, only BlackHole and Attachment are supported.指定的中转路由器路由下一跳类型不支持,仅支持黑洞和网络实例连接。
400InvalidTransitRouterRouteEntry.NextHopUnsupportedThe specified Transit Router route type is black hole, and does not support configuring next hop.黑洞路由不支持指定下一跳。
400QuotaExceeded.TransitRouterRouteEntryYou've reached the maximum number of route entries that one Transit Router route table can have.已达到单个中转路由器路由表的路由条目数上限。
400QuotaExceeded.TransitRouterEcmpRouteEntryYou've reached the maximum number of next hop attachment that one ECMP route entry can have.已到达可配置的最大等价路由条目数量上限。
403Forbidden.NoPermissionToOperateYou are not authorized to operate the specified resource.无权限操作指定的资源。
404InvalidTransitRouterRouteEntry.NextHopNotFoundThe specified Transit Router route entry next hop attachment does not exist.指定的中转路由器路由条目下一跳实例不存在。
404InvalidTransitRouterRouteTable.NotFoundThe specified route table does not exist.指定的中转路由器路由表不存在。
409InvalidTransitRouterRouteEntry.DestinationCidrBlockConflictThe specified Transit Router route entry destination already exists.指定的目的网段在该中转路由器路由表中已经存在。