Creates a router interface.

Note the following before you call this action:
  • Up to one pair of interconnected router interfaces can be created between two VRouters.

  • Up to five router interfaces can be created on a VRouter.

  • If a delinquent router interface is under your account, you can no longer create router interfaces.

  • Route entries in the same route table cannot have the same destination CIDR blocks.

  • The VBR must be the connection initiator and must be in the Activated status.

Note Router interfaces created by calling this action only support the Pay-As-You-Go billing method.

Debug

By using API Explorer, you can easily debug APIs, automatically generate SDK code examples, and quickly search for APIs.

Request parameters

Parameter Type Required? Example value Description
Action String Yes CreateRouterInterface

The name of this action. Value:

CreateRouterInterface

OppositeRegionId String Yes cn-shanghai

The region of the connection acceptor.

RegionId String Yes cn-hangzhou

The region to which the router interface belongs.

To query the region ID, call DescribeRegions.

Role String Yes InitiatingSide|AcceptingSide

The role of the router interface. Valid values:

  • InitiatingSide: Connection initiator.

  • AcceptingSide: Connection acceptor.

RouterId String Yes cn-hangzhou

The ID of the router associated with the router interface.

RouterType String Yes VRouter

The type of the router associated with the router interface. Valid values:

  • VRouter: VRouter

  • VBR: VBR

Spec String Yes Large

The specification of the router interface. The following are available specifications and the corresponding bandwidths:

  • 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

    Note The value of Specis Negative when the role is AcceptingSide.
AccessPointId String No ap-cn-shanghaiSZ-pd-A

The ID of the access point to which the VBR belongs.

To query the region ID, call DescribeAccessPoints.

Note You must specify this parameter in the scenario of physical access.
AutoPay String No false

Whether the order is paid automatically. Valid values:

  • falseAutomatic payment is not enabled. You need to go to the Order center to complete the payment after the order is generated.

  • true: Automatic payment is enabled and the order is paid automatically.

Note This parameter is required if the value of InstanceChargeType is PrePaid.
ClientToken String No sjffha123334

A client token used to guarantee the idempotence of requests.

This parameter value is generated by the client and is guaranteed to be unique among different requests. It must be 1 to 64 ASCII characters in length.

Description String No This is my description.

The description of the router interface.

The description must be 2 to 256 characters in length. It must start with a letter but cannot start with http:// or https://.

HealthCheckSourceIp String No 116.62.222.28

The source IP address used to perform health check. It must be an unused IP address of the local VPC.

Note You can specify this parameter in the scenario of physical access.
HealthCheckTargetIp String No 116.62.222.28

The destination IP address of health check.

Note This parameter is required if the HealthCheckSourceIp parameter is specified.
InstanceChargeType String No PrePaid

The billing method of the router interface. Valid values:

  • PostPaid (default): Pay-As-You-Go

Name String No Router interface 1

The name of the router interface.

The name must be 2 to 128 characters in length. It can contain letters, numbers, periods (.), underscores (_), and hyphens (-). It must start with a letter but cannot start with http:// or https://.

OppositeAccessPointId String No ap-cn-shanghaiSZ-pd-A The ID of the access point of the peer router interface.
Note This parameter is required when the peer router interface is on a VBR. It cannot be modified after the router interface is created.
OppositeInterfaceId String No ri-2zeo3xzyf38r4urzdpvfs

The ID of the peer router interface.

OppositeInterfaceOwnerId String No fffsf

The ID of the owner of the peer router interface.

OppositeRouterId String No vrt-bp1lhl0taikrteen80oxx

The ID of the peer router.

OppositeRouterType String No VRouter

The type of the router associated with the peer router interface. Valid values:

  • VRouter: VRouter

  • VBR: VBR

Period String No 3

The validity period of the purchase. Value ranges:

  • Payments on a monthly basis: 1 to 9.

  • Payments on a yearly basis: 1 to 3.

Note When the value of the InstanceChargeType parameter is PrePaid, this parameter is required.
PricingCycle String No Month

The billing cycle of the Subscription billing method. Valid values:

  • Month(default): billing on a monthly basis

  • Year: billing on a yearly basis

Note This parameter is required if the value of the InstanceChargeType parameter is PrePaid5.

Response parameters

Parameter Type Example value Description
OrderId String 202008594930117 The order number. This parameter is returned if you select the Subscription billing method.
RequestId String 079874CD-AEC1-43E6-AC03-ADD96B6E4907 The ID of the request.
RouterInterfaceId String ri-2ze7fbuohmxxxxxx The ID of the router interface.

Examples

Request example


http(s)://vpc.aliyuncs.com/?Action=CreateRouterInterface
&OppositeRegionId=cn-shanghai
&RegionId=cn-hangzhou
&Role=InitiatingSide|AcceptingSide
&RouterId=cn-hangzhou
&RouterType=VRouter
&Spec=Large
&<CommonParameters>
Response example
  • XML format

    <CreateRouterInterfaceResponse>
      <RequestId>980960B0-2969-40BF-8542-EBB34FD358AB</RequestId>
      <RouterInterfaceId>ri-2ze7fbuohmxxxxxx</RouterInterfaceId>
    </CreateRouterInterfaceResponse>
    
  • JSON format

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

Error codes

HTTP status code Error code Error message Description
404 InvalidRegionId.NotFound The regionId provided does not exist in our records. The specified region ID does not exist.
400 InvalidRole.ValueNotSupported The specified Role is not valid. The specified role is invalid.
400 InvalidSpec.ValudNotSupported The specified Spec is not supported. The specified specification is not supported.
400 InvalidRouterType.ValueNotSupported The specified RouterType is not valid. The specified router type is invalid.
404 InvalidRouterId.NotFound The specified RouterId does not exist in our recored. The specified router ID does not exist.
400 InvalidDescription.Malformed The specifid "Description" is not valid. The specified description is invalid. The description must be 2 to 256 characters in length. It cannot start with http:// or https://.
400 Forbidden.BillsOutstanding You cannot create more RouterInterface because you have bills outstanding. You cannot create router interfaces because you have overdue payments.
400 LimitationExceed.InterfaceNumberOnRouter Total number of RouterInterfaces on a Router exceeded. The quota for router interfaces has been reached.
400 Forbidden.NotInRouterInterfaceCreateWhitelist Not in router interface create whitelist. It does not exist in the whitelist of the router interface.
400 RI_CREATE_ONE_LIMIT_BY_SYNC Create ri only one limit by sync. Only one router interface can be created at a time.
400 InvalidAccessPoint.ValueNotAllowed The non-vbr router interface cannot have access point configured. You cannot configure an access point for a router interface not on a VBR.
400 InvalidAccessPoint.ValueNotAllowed The non-vbr opposite router interface cannot have opposite access point configured. You cannot configure an access point for a router interface not on a VBR.
400 InvalidAccessPoint.NotMatch The accessPoint id is not matched The ID of the access point is invalid.
400 InvalidAccessPoint.NotExist The accessPoint not exit The specified access point does not exist.
400 InvalidRouterType.ValueNotSupported The specified RouterType is not valid The specified router type is invalid.
400 ForbiddenAction The user dose not supported this action. You are not authorized to do this operation.

See common error codes