全部产品
Search
文档中心

专有网络 VPC:CreateRouterInterface - 创建路由器接口

更新时间:Mar 04, 2024

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

接口说明

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

  • 任意两个路由器之间,最多只能存在一对互连的路由器接口。

  • 一个路由器上可以最多创建 5 个路由器接口。

  • 如果账户下存在欠费状态的路由器接口,则无法再创建路由器接口。

  • 同一路由表下的路由条目的目标网段(DestinationCidrBlock)不允许相同。

  • 边界路由器 VBR(Virtual Border Router)只能是连接发起端,并且是已激活状态。

  • 通过本接口可以创建预付费和后付费的路由器接口。

调试

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

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用背景高亮的方式表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
vpc:CreateRouterInterfaceWrite
  • VirtualBorderRouter
    acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/{#VbrId}
  • RouterInterface
    acs:vpc:{#regionId}:{#accountId}:routerinterface/*
  • vpc:TargetAccountRDId

请求参数

名称类型必填描述示例值
RegionIdstring

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

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

cn-hangzhou
Rolestring

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

  • InitiatingSide:连接发起端。

  • AcceptingSide:连接接收端。

InitiatingSide
OppositeRegionIdstring

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

cn-shanghai
Specstring

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

  • 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 即创建接收端路由器接口时不涉及规格。
Mini.2
RouterTypestring

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

  • VRouter:VPC 路由器。

  • VBR:边界路由器。

VRouter
RouterIdstring

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

vbr-m5ebm6g9ptc9mly1c****
OppositeInterfaceIdstring

对端路由器接口 ID。

ri-2zeo3xzyf38r4urzd****
OppositeRouterIdstring

对端路由器的 ID。

vrt-bp1lhl0taikrteen8****
OppositeRouterTypestring

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

  • VRouter:VPC 路由器。

  • VBR:边界路由器。

VRouter
OppositeInterfaceOwnerIdstring

对端路由器接口的所有者的阿里云账号 ID。

253460731706911258
HealthCheckSourceIpstring

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

说明 物理专线接入场景下可指定该参数。
192.168.0.6
HealthCheckTargetIpstring

健康检查目的 IP 地址。

说明 当指定了 HealthCheckSourceIp 后,该参数必填。
192.168.0.8
AccessPointIdstring

VBR 所属的接入点 ID。

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

说明 物理专线接入场景下需指定该参数。
ap-cn-hangzhou-yh-ts-A
OppositeAccessPointIdstring

对端所属的接入点 ID。

说明 对端路由器接口位于 VBR 上时需指定该参数,创建路由器接口后无法修改。
ap-cn-shanghai-nt-aligroup-C
Descriptionstring

路由器接口的描述信息。

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

abcabc
Namestring

路由器接口的名称。

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

abc
Periodinteger

购买时长,取值:

  • 当选择按月付费时,取值范围为1~9

  • 当选择按年付费时,取值范围为1~3

说明 InstanceChargeType 参数的值为 PrePaid 时,该参数必填。
3
InstanceChargeTypestring

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

  • PrePaid:预付费。

  • PostPaid:后付费。

PrePaid
AutoPayboolean

是否自动付费,取值:

  • false(默认值):不开启自动付费,生成订单后需要到订单中心完成支付。

  • true:开启自动付费,自动支付订单。

说明 InstanceChargeType 参数的值为 PrePaid 时,该参数必填。
false
PricingCyclestring

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

  • Month(默认值):按月付费。

  • Year:按年付费。

说明 InstanceChargeType 参数的值为 PrePaid 时,该参数必填。
Month
ClientTokenstring

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

由客户端生成该参数值,要保证在不同请求间唯一。

说明 若您未指定,则系统自动使用 API 请求的 RequestId 作为 ClientToken 标识。每次 API 请求的 RequestId 可能不一样。
123e4567-e89b-12d3-a456-426655440000
FastLinkModeboolean

是否为使用快速连接模式创建的 VBR 上联路由器接口,快速连接模式可实现 VBR 和 VPC 两端路由器接口创建完毕后自动完成连接。取值:

  • true:是。
  • false(默认值):否。
说明
  • 该参数只在 RouterType 取值为 VBROppositeRouterType 参数取值为 VRouter 时生效。
    • FastLinkMode 参数取值为 true 时,Role 参数必须取值为 InitiatingSideAccessPointIdOppositeRouterTypeOppsiteRouterIdOppositeInterfaceOwnerId 参数为必选。
    false
    AutoRenewboolean

    是否开通自动续费。取值:

    • false(默认值):不开通。
    • true:开通。
    false
    ResourceGroupIdstring

    资源组 ID。

    关于资源组的更多信息,请参见什么是资源组

    rg-acfmxazb4ph6aiy****
    Tagsobject []

    资源的标签。

    Keystring

    资源的标签键。至少输入 1 个标签键,最多支持输入 20 个标签键。如需传入该值,则不能输入空字符串。

    一个标签键最多支持 128 个字符,不能以aliyunacs:开头,不能包含http://或者https://

    FinanceDept
    Valuestring

    资源的标签值。最多支持输入 20 个标签值。如果传入该值,可以输入空字符串。

    最多支持 128 个字符,不能以aliyunacs:开头,不能包含http://或者https://

    FinanceJoshua

    返回参数

    名称类型描述示例值
    object

    请求 ID。

    RequestIdstring

    请求 ID。

    079874CD-AEC1-43E6-AC03-ADD96B6E4907
    OrderIdlong

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

    20210101123456
    RouterInterfaceIdstring

    路由器接口的 ID。

    ri-2ze7fbuohm****

    示例

    正常返回示例

    JSON格式

    {
      "RequestId": "079874CD-AEC1-43E6-AC03-ADD96B6E4907",
      "OrderId": 20210101123456,
      "RouterInterfaceId": "ri-2ze7fbuohm****"
    }

    错误码

    HTTP status code错误码错误信息描述
    400InvalidPrice.NotFoundPricing plan result not found.Price参数无效
    400InvalidAliuidInvalid Aliuid.Aliuid无效
    400InvalidRole.ValueNotSupportedThe specified Role is not valid.指定的 Role 不合法,请您检查该参数是否正确。
    400InvalidSpec.ValudNotSupportedThe specified Spec is not supported.该规格不支持该操作,请您更换规格后重试。
    400InvalidRouterType.ValueNotSupportedThe specified RouterType is not valid.该路由器类型不合法。
    400InvalidName.MalformedThe specified "Name" is not valid.该名称格式不合法。
    400Forbidden.BillsOutstandingYou cannot create more RouterInterface because you have bills outstanding.无法创建路由器接口,您有未结算的账单。
    400LimitationExceed.InterfaceNumberOnRouterTotal number of RouterInterfaces on a Router exceeded.路由器接口数量已达到配额上限。
    400Forbidden.NotInRouterInterfaceCreateWhitelistNot in router interface create whitelist.不在路由器接口的白名单中。
    400RI_CREATE_ONE_LIMIT_BY_SYNCCreate ri only one limit by sync.限制同步创建路由器接口。
    400InvalidAccessPoint.ValueNotAllowedThe non-vbr router interface cannot have access point configured.非边界路由器的路由器接口不能配置接入点。
    400InvalidAccessPoint.ValueNotAllowedThe non-vbr opposite router interface cannot have opposite access point configured.非边界路由器的路由器接口不能配置接入点。
    400InvalidParam.NotFoundParameter must not be null,uid, bid,regionNo, remoteRegionNo, routerId or accessPointId参数不能为null
    400InvalidAccessPoint.NotMatchThe accessPoint id is not matched该接入点ID不正确。
    400InvalidAccessPoint.NotExistThe accessPoint not exit该接入点不存在。
    400InvalidRouterType.ValueNotSupportedThe specified RouterType is not valid该路由器类型不合法。
    400INVAID_VBR_STATUSVBR status must be active-
    400IncorrectStatus.CenStatusCen status must not be middle status.请检查cen 状态
    400Forbidden.AcceptRoleNotSupportPrePayAcception side ri not support chargetype for prepaid.不支持预付费的费用类型。
    400InvalidRouterInterfaceSpec.MalformedSpecified RouterInterface spec is not valid.指定的RouterInterface Spec无效。
    400VpcSubnet.NotFoundVpc subnet not exist.Vpc子网不存在。
    400IllegalParam.HealthcheckIpHealthcheck ip cannot equal with instance ip.Healthcheck ip不能与实例ip相等。
    400OperationFailed.HcForInvalidRiTypeHealthchecksourceip and healthchecktargetip is only valid for vr ri that is connected to vbr.健康检查IP无效
    400OperationFailed.SyncOrderToSubSyncOrderToSub error.操作失败
    400IllegalParam.CrossBorderBandwidthCrossBorder bandwidth error.跨域带宽包不合法
    400IllegalParam.VRouterTypeThe VRouterType is not supported.VRouterType不合法
    400IllegalParam.SpecThe spec is illegal.spec不合法
    400Forbidden.CrossBorderUser not authorized to create cross border routerInterface.用户无权创建跨境routerInterface
    400InvalidRouterId.NotFoundParam is not valid,this user does not have this router or aliuid bid regionNo and routerId must have something wrong.RouterId参数无效
    400InvalidCommodity.NotFoundCommodity is not exist.Commodity不存在
    400InvalidRouterInterfaceChargeType.MalformedSpecified RouterInterface ChargeType is not valid.指定的RouterInterface ChargeType无效。
    400IllegalParam.RegionIdThe specified regionId is illegal.regionId不合法
    400PAY.MAYI_WITHHOLDING_AGREEMENT_ILLEGALUser withhoding argeement is illegal.-
    400QuotaExceededRiPerUser quota exceeded当前用户建立的对等连接路由器接口数量已达上限
    400OperationFailed.PconnTrafficNotEnableThe operation is failed because of PconnTrafficNotEnable.操作失败,因为出方向流量未开通。
    400InvalidRegionId.NotFoundThe regionId provided does not exist in ec region list.提供的regionId无效,请检查。
    400ResourceNotInResourceGroupThe specified resource is not in the specified ResourceGroup.输入的资源不在输入的资源组内
    400HaveConnectionBetweenRoutersHave connection between routers两个路由器之间已经创建了连接
    400InvalidDescription.MalformedThe specified "Description" is not valid.描述的长度可以是2到256个字符,不能以http://和https://开头。
    400InvalidBandwidth.NotEnoughBandwidth not enough.带宽计划的带宽不足。
    400ForbiddenActionThe user does not support this action.您没有所需的权限。
    404InvalidRegionId.NotFoundThe regionId provided does not exist in our records.指定的RegionId不存在。请检查该参数是否正确。
    404InvalidRouterId.NotFoundThe specified RouterId does not exist in our recored.该 RouterId 不存在。
    404InvalidRegionId.NotFoundThe parameter wrong, pageNum or pageSize.参数错误
    404InvalidRouterId.AttacedToCENCan not create ri when attaced to CEN.ri不能附加cen

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

    变更历史

    变更时间变更内容概要操作
    2023-12-22OpenAPI 错误码发生变更看变更集
    变更项变更内容
    错误码OpenAPI 错误码发生变更
      错误码 400 变更
      删除错误码:404
    2023-12-21OpenAPI 错误码发生变更看变更集
    变更项变更内容
    错误码OpenAPI 错误码发生变更
      错误码 400 变更
      删除错误码:404
    2023-09-11OpenAPI 描述信息更新、OpenAPI 错误码发生变更看变更集
    变更项变更内容
    API 描述OpenAPI 描述信息更新
    错误码OpenAPI 错误码发生变更
      错误码 400 变更
      删除错误码:404
    2023-07-20OpenAPI 错误码发生变更、OpenAPI 入参发生变更看变更集
    变更项变更内容
    错误码OpenAPI 错误码发生变更
      错误码 400 变更
      删除错误码:404
    入参OpenAPI 入参发生变更
      新增入参:ResourceGroupId
      新增入参:Tags
    2023-05-18OpenAPI 错误码发生变更、OpenAPI 入参发生变更看变更集
    变更项变更内容
    错误码OpenAPI 错误码发生变更
      删除错误码:400
      删除错误码:404
    入参OpenAPI 入参发生变更
      新增入参:AutoRenew