调用CreateRouterInterface接口创建路由器接口。

限制说明

调用本接口创建路由器接口时,请注意:

  • 任意两个路由器之间,最多只能存在一对互连的路由器接口。
  • 一个路由器上可以最多创建5个路由器接口。
  • 如果账户下存在欠费状态的路由器接口,则无法再创建路由器接口。
  • 同一路由表下的路由条目的目标网段(DestinationCidrBlock)不允许相同。
  • 边界路由器(VBR)只能是连接发起端,并且是已激活状态。
  • 通过该API创建的路由器接口只支持按天计费,不支持包年包月的计费方式。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String CreateRouterInterface

要执行的操作,取值:CreateRouterInterface

OppositeRegionId String cn-shanghai

连接接收端所在的地域ID。

RegionId String cn-hangzhou

路由器接口所在的地域ID。

您可以通过调用DescribeRegions接口获取地域ID。

Role String InitiatingSide

路由器接口的角色,取值:

  • InitiatingSide:连接发起端。
  • AcceptingSide:连接接收端。
RouterId String vrt-12345

路由器接口关联的路由器ID。

RouterType String VRouter

路由器接口关联的路由器类型,取值:

  • VRouter:VPC路由器。
  • VBR:边界路由器。
Spec String Mini.2

路由器接口的规格。可用的规格和对应的带宽如下:

  • Mini.2:2 Mbps
  • Mini.5:5 Mbps
  • Small.1:10 Mbps
  • Small.2:20 Mbps
  • Small.5:50 Mbps
  • Middle.1:100 Mbps
  • Middle.2:200 Mbps
  • Middle.5:500 Mbps
  • Large.1:1000 Mbps
  • Large.2:2000 Mbps
  • Large.5:5000 Mbps
  • Xlarge.1:10000 Mbps
说明RoleAcceptingSide(连接接收端)时, Spec取值为 Negative
OppositeInterfaceId String ri-2zeo3xzyf38r4urzd****

对端路由器接口ID。

OppositeRouterId String vrt-bp1lhl0taikrteen8****

对端路由器的ID。

OppositeRouterType String VRouter

对端路由器接口关联的路由器类型,取值:

  • VRouter:VPC路由器。
  • VBR:边界路由器。
OppositeInterfaceOwnerId String 2348***

对端路由器接口的所有者ID。

HealthCheckSourceIp String 192.168.0.6

健康检查源IP地址,必须是本端VPC内的一个未被使用的IP。

说明 物理专线接入场景下可指定该参数。
HealthCheckTargetIp String 192.168.0.8

健康检查目的IP地址。

说明 当指定了 HealthCheckSourceIp后,该参数为必选。
AccessPointId String ap-cn-shanghaiSZ-****

VBR所属的接入点ID。 您可以通过调用DescribeAccessPoints接口获取物理专线接入点ID。

说明 物理专线接入场景下需指定该参数。
OppositeAccessPointId String ap-cn-shanghaiSZ-****

对端所属的接入点ID。

说明 对端路由器接口位于VBR上时需指定该参数,创建路由器接口后无法修改。
Description String abcabc

路由器接口的描述信息。

长度为2~256个字符,必须以字母或中文开头,但不能以http:// https://开头。

Name String abc

路由器接口的名称。

长度为2~128个字符,必须以字母或中文开头,可包含数字、半角句号(.)、下划线(_)和短划线(-)。但不能以http://https://开头。

Period Integer 3

购买时长,取值:

  • 当选择按月付费时,取值范围为1~9
  • 当选择按年付费时,取值范围为1~3
说明 InstanceChargeType参数的值为 PrePaid时,该参数必选。
InstanceChargeType String PrePaid

路由器接口的付费方式,取值:

  • PrePaid:预付费。
  • PostPaid(默认值):后付费。
AutoPay Boolean false

是否自动付费,取值:

  • false:不开启自动付费,生成订单后需要到订单中心完成支付。
  • true:开启自动付费,自动支付订单。
说明 InstanceChargeType参数的值为 PrePaid时,该参数必选。
PricingCycle String Month

预付费的计费周期,取值:

  • Month(默认值):按月付费。
  • Year:按年付费。
    说明 InstanceChargeType参数的值为 PrePaid时,该参数必选。
ClientToken String 123e4567-e89b-12d3-a456-426655440000

客户端Token,用于保证请求的幂等性。

由客户端生成该参数值,要保证在不同请求间唯一,最大值不超过64个ASCII字符。

说明 若您未指定,则系统自动使用API请求的RequestId作为ClientToken标识。每次API请求的RequestId可能不一样。

返回数据

名称 类型 示例值 描述
OrderId Long 202008594930117

订单号,选择预付费时返回该参数。

RequestId String 079874CD-AEC1-43E6-AC03-ADD96B6E4907

请求ID。

RouterInterfaceId String ri-2ze7fbuohm****

路由器接口的ID。

示例

请求示例

http(s)://vpc.aliyuncs.com/?Action=CreateRouterInterface
&OppositeRegionId=cn-shanghai
&RegionId=cn-hangzhou
&Role=InitiatingSide
&RouterId=vrt-12345
&RouterType=VRouter
&Spec=Mini.2
&<公共请求参数>

正常返回示例

XML格式

<CreateRouterInterfaceResponse>
      <RequestId>980960B0-2969-40BF-8542-EBB34FD358AB</RequestId>
      <RouterInterfaceId>ri-2ze7fbuohm****</RouterInterfaceId>
</CreateRouterInterfaceResponse>

JSON格式

{
    "RequestId": "980960B0-2969-40BF-8542-EBB34FD358AB",
    "RouterInterfaceId": "ri-2ze7fbuohm****"
}

错误码

HttpCode 错误码 错误信息 描述
404 InvalidRegionId.NotFound The regionId provided does not exist in our records. 指定的RegionId不存在。请检查该参数是否正确。
400 InvalidRole.ValueNotSupported The specified Role is not valid. 指定的 Role 不合法,请您检查该参数是否正确。
400 InvalidSpec.ValudNotSupported The specified Spec is not supported. 该规格不支持该操作,请您更换规格后重试。
400 InvalidRouterType.ValueNotSupported The specified RouterType is not valid. 该路由器类型不合法。
404 InvalidRouterId.NotFound The specified RouterId does not exist in our recored. 该 RouterId 不存在。
400 InvalidName.Malformed The specified "Name" is not valid. 该名称格式不合法。
400 InvalidDescription.Malformed The specifid "Description" is not valid. 指定的资源描述格式不合法。长度为2-256个字符,不能以 http:// 和 https:// 开头。
400 Forbidden.BillsOutstanding You cannot create more RouterInterface because you have bills outstanding. 无法创建路由器接口,您有未结算的账单。
400 LimitationExceed.InterfaceNumberOnRouter Total number of RouterInterfaces on a Router exceeded. 路由器接口数量已达到配额上限。
400 Forbidden.NotInRouterInterfaceCreateWhitelist Not in router interface create whitelist. 不在路由器接口的白名单中。
400 RI_CREATE_ONE_LIMIT_BY_SYNC Create ri only one limit by sync. 限制同步创建路由器接口。
400 InvalidAccessPoint.ValueNotAllowed The non-vbr router interface cannot have access point configured. 非边界路由器的路由器接口不能配置接入点。
400 InvalidAccessPoint.ValueNotAllowed The non-vbr opposite router interface cannot have opposite access point configured. 非边界路由器的路由器接口不能配置接入点。
400 InvalidAccessPoint.NotMatch The accessPoint id is not matched 该接入点ID不正确。
400 InvalidAccessPoint.NotExist The accessPoint not exit 该接入点不存在。
400 InvalidRouterType.ValueNotSupported The specified RouterType is not valid 该路由器类型不合法。
400 ForbiddenAction The user dose not supported this action. 您没有权限执行该操作。

访问错误中心查看更多错误码。