调用CreateRouterInterface接口创建路由器接口。
使用说明
调用本接口创建路由器接口时,请注意:
- 任意两个路由器之间,最多只能存在一对互连的路由器接口。
- 一个路由器上可以最多创建5个路由器接口。
- 如果账户下存在欠费状态的路由器接口,则无法再创建路由器接口。
- 同一路由表下的路由条目的目标网段(DestinationCidrBlock)不允许相同。
- 边界路由器VBR(Virtual Border Router)只能是连接发起端,并且是已激活状态。
- 通过本接口可以创建预付费和后付费的路由器接口。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
RegionId | String | 是 | cn-hangzhou |
路由器接口所在的地域ID。 您可以通过调用DescribeRegions接口获取地域ID。 |
Role | String | 是 | InitiatingSide |
路由器接口的角色,取值:
|
OppositeRegionId | String | 是 | cn-shanghai |
连接接收端所在的地域ID。 |
Spec | String | 是 | Mini.2 |
路由器接口的规格。可用的规格和对应的带宽取值如下:
说明 当Role为AcceptingSide(连接接收端)时,Spec取值为Negative即创建接收端路由器接口时不涉及规格。
|
RouterType | String | 是 | VRouter |
路由器接口关联的路由器类型,取值:
|
RouterId | String | 是 | vbr-m5ebm6g9ptc9mly1c**** |
路由器接口关联的路由器ID。 |
OppositeInterfaceId | String | 否 | ri-2zeo3xzyf38r4urzd**** |
对端路由器接口ID。 |
OppositeRouterId | String | 否 | vrt-bp1lhl0taikrteen8**** |
对端路由器的ID。 |
OppositeRouterType | String | 否 | VRouter |
对端路由器接口关联的路由器类型,取值:
|
OppositeInterfaceOwnerId | String | 否 | 253460731706911258 |
对端路由器接口的所有者的阿里云账号ID。 |
HealthCheckSourceIp | String | 否 | 192.168.0.6 |
健康检查源IP地址,必须是本端VPC内的一个未被使用的IP。 说明 物理专线接入场景下可指定该参数。
|
HealthCheckTargetIp | String | 否 | 192.168.0.8 |
健康检查目的IP地址。 说明 当指定了HealthCheckSourceIp后,该参数必填。
|
AccessPointId | String | 否 | ap-cn-hangzhou-yh-ts-A |
VBR所属的接入点ID。 您可以通过调用DescribeAccessPoints接口获取物理专线接入点ID。 说明 物理专线接入场景下需指定该参数。
|
OppositeAccessPointId | String | 否 | ap-cn-shanghai-nt-aligroup-C |
对端所属的接入点ID。 说明 对端路由器接口位于VBR上时需指定该参数,创建路由器接口后无法修改。
|
Description | String | 否 | abcabc |
路由器接口的描述信息。 长度为2~256个字符,必须以字母或中文开头,但不能以 |
Name | String | 否 | abc |
路由器接口的名称。 长度为2~128个字符,必须以字母或中文开头,可包含数字、半角句号(.)、下划线(_)和短划线(-)。 |
Period | Integer | 否 | 3 |
购买时长,取值:
说明 InstanceChargeType参数的值为PrePaid时,该参数必填。
|
InstanceChargeType | String | 否 | PrePaid |
路由器接口的付费方式,取值:
|
AutoPay | Boolean | 否 | false |
是否自动付费,取值:
说明 InstanceChargeType参数的值为PrePaid时,该参数必填。
|
PricingCycle | String | 否 | Month |
预付费的计费周期,取值:
说明 InstanceChargeType参数的值为PrePaid时,该参数必填。
|
ClientToken | String | 否 | 123e4567-e89b-12d3-a456-426655440000 |
客户端Token,用于保证请求的幂等性。 由客户端生成该参数值,要保证在不同请求间唯一。 说明 若您未指定,则系统自动使用API请求的RequestId作为ClientToken标识。每次API请求的RequestId可能不一样。
|
Action | String | 是 | CreateRouterInterface |
系统规定参数。取值:CreateRouterInterface。 |
FastLinkMode | Boolean | 否 | false |
是否为使用快速连接模式创建的VBR上联路由器接口,快速连接模式可实现VBR和VPC两端路由器接口创建完毕后自动完成连接。取值:
说明
|
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | 079874CD-AEC1-43E6-AC03-ADD96B6E4907 |
请求ID。 |
OrderId | Long | 202008594930117 |
订单号,选择预付费时返回该参数。 |
RouterInterfaceId | String | ri-2ze7fbuohm**** |
路由器接口的ID。 |
示例
请求示例
http(s)://[Endpoint]/?RegionId=cn-hangzhou
&Role=InitiatingSide
&OppositeRegionId=cn-shanghai
&Spec=Mini.2
&RouterType=VRouter
&RouterId=vbr-m5ebm6g9ptc9mly1c****
&OppositeInterfaceId=ri-2zeo3xzyf38r4urzd****
&OppositeRouterId=vrt-bp1lhl0taikrteen8****
&OppositeRouterType=VRouter
&OppositeInterfaceOwnerId=253460731706911258
&HealthCheckSourceIp=192.168.0.6
&HealthCheckTargetIp=192.168.0.8
&AccessPointId=ap-cn-hangzhou-yh-ts-A
&OppositeAccessPointId=ap-cn-shanghai-nt-aligroup-C
&Description=abcabc
&Name=abc
&Period=3
&InstanceChargeType=PrePaid
&AutoPay=false
&PricingCycle=Month
&ClientToken=123e4567-e89b-12d3-a456-426655440000
&Action=CreateRouterInterface
&FastLinkMode=false
&公共请求参数
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<CreateRouterInterfaceResponse>
<RequestId>079874CD-AEC1-43E6-AC03-ADD96B6E4907</RequestId>
<OrderId>202008594930117</OrderId>
<RouterInterfaceId>ri-2ze7fbuohm****</RouterInterfaceId>
</CreateRouterInterfaceResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "079874CD-AEC1-43E6-AC03-ADD96B6E4907",
"OrderId" : 202008594930117,
"RouterInterfaceId" : "ri-2ze7fbuohm****"
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | InvalidPrice.NotFound | Pricing plan result not found. | Price参数无效 |
400 | InvalidAliuid | Invalid Aliuid. | Aliuid无效 |
400 | InvalidBandwidth.NotEnough | bandwdith not enough. | 带宽包不足 |
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. | 该路由器类型不合法。 |
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 | InvalidParam.NotFound | Parameter must not be null,uid, bid,regionNo, remoteRegionNo, routerId or accessPointId | 参数不能为null |
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 | IncorrectStatus.CenStatus | Cen status must not be middle status. | 请检查cen 状态 |
400 | ForbiddenAction | The user does not supported this action. | 用户权限不支持 |
400 | Forbidden.AcceptRoleNotSupportPrePay | Acception side ri not support chargetype for prepaid. | 不支持预付费的费用类型。 |
400 | InvalidRouterInterfaceSpec.Malformed | Specified RouterInterface spec is not valid. | 指定的RouterInterface Spec无效。 |
400 | VpcSubnet.NotFound | Vpc subnet not exist. | Vpc子网不存在。 |
400 | IllegalParam.HealthcheckIp | Healthcheck ip cannot equal with instance ip. | Healthcheck ip不能与实例ip相等。 |
400 | OperationFailed.HcForInvalidRiType | Healthchecksourceip and healthchecktargetip is only valid for vr ri that is connected to vbr. | 健康检查IP无效 |
400 | OperationFailed.SyncOrderToSub | SyncOrderToSub error. | 操作失败 |
400 | IllegalParam.CrossBorderBandwidth | CrossBorder bandwidth error. | 跨域带宽包不合法 |
400 | IllegalParam.VRouterType | The VRouterType is not supported. | VRouterType不合法 |
400 | IllegalParam.Spec | The spec is illegal. | spec不合法 |
400 | Forbidden.CrossBorder | User not authorized to create cross border routerInterface. | 用户无权创建跨境routerInterface |
400 | InvalidRouterId.NotFound | Param is not valid,this user does not have this router or aliuid bid regionNo and routerId must have something wrong. | RouterId参数无效 |
400 | InvalidCommodity.NotFound | Commodity is not exist. | Commodity不存在 |
400 | InvalidRouterInterfaceChargeType.Malformed | Specified RouterInterface ChargeType is not valid. | 指定的RouterInterface ChargeType无效。 |
400 | IllegalParam.RegionId | The specified regionId is illegal. | regionId不合法 |
400 | QuotaExceeded | RiPerUser quota exceeded | 超出配额 |
400 | OperationFailed.PconnTrafficNotEnable | The operation is failed because of PconnTrafficNotEnable. | 操作失败,因为出方向流量未开通。 |
400 | InvalidRegionId.NotFound | The regionId provided does not exist in ec region list. | 提供的regionId无效,请检查。 |
404 | InvalidRegionId.NotFound | The regionId provided does not exist in our records. | 指定的RegionId不存在。请检查该参数是否正确。 |
404 | InvalidRouterId.NotFound | The specified RouterId does not exist in our recored. | 该 RouterId 不存在。 |
404 | InvalidRegionId.NotFound | The parameter wrong, pageNum or pageSize. | 参数错误 |
404 | InvalidRouterId.AttacedToCEN | Can not create ri when attaced to CEN. | ri不能附加cen |
访问错误中心查看更多错误码。