All Products
Search
Document Center

Virtual Private Cloud:CreateRouterInterface

Last Updated:Nov 13, 2024

Creates a router interface.

Operation description

When you call this operation, take note of the following limits:

  • You can create only one pair of interfaces to be connected between two routers.
  • You can create a maximum of five router interfaces for a router.
  • If your Alibaba Cloud account has a router interface with overdue payments, you cannot create new router interfaces.
  • Each destination CIDR block of route entries in the same route table must be unique.
  • A virtual border router (VBR) can serve only as a requester. The VBR must be in the Activated state.
  • You can call this operation to create subscription and pay-as-you-go router interfaces.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
vpc:CreateRouterInterfacecreate
  • VirtualBorderRouter
    acs:vpc:{#regionId}:{#accountId}:virtualborderrouter/{#VbrId}
  • RouterInterface
    acs:vpc:{#regionId}:{#accountId}:routerinterface/*
  • vpc:TargetAccountRDId
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The ID of the region to which the router interface belongs.

You can call the DescribeRegions operation to obtain the region ID.

cn-hangzhou
RolestringYes

The role of the router interface. Valid values:

  • InitiatingSide: requester
  • AcceptingSide: acceptor
InitiatingSide
OppositeRegionIdstringYes

The ID of the region in which the acceptor is deployed.

cn-shanghai
SpecstringYes

The specification of the router interface and the corresponding bandwidth. Valid values:

  • Mini.2: 2 Mbit/s
  • Mini.5: 5 Mbit/s
  • Small.1: 10 Mbit/s
  • Small.2: 20 Mbit/s
  • Small.5: 50 Mbit/s
  • Middle.1: 100 Mbit/s
  • Middle.2: 200 Mbit/s
  • Middle.5: 500 Mbit/s
  • Large.1: 1,000 Mbit/s
  • Large.2: 2,000 Mbit/s
  • Large.5: 5,000 Mbit/s
  • Xlarge.1: 10,000 Mbit/s
Note If Role is set to AcceptingSide, set Spec to Negative. This indicates that you do not need to specify the specification when you create an acceptor router interface.
Mini.2
RouterTypestringYes

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

  • VRouter
  • VBR
VRouter
RouterIdstringYes

The ID of the router that is associated with the router interface.

vbr-m5ebm6g9ptc9mly1c****
OppositeInterfaceIdstringNo

The ID of the peer router interface.

ri-2zeo3xzyf38r4urzd****
OppositeRouterIdstringNo

The ID of the peer router.

vrt-bp1lhl0taikrteen8****
OppositeRouterTypestringNo

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

  • VRouter
  • VBR
VRouter
OppositeInterfaceOwnerIdstringNo

The ID of the Alibaba Cloud account to which the peer router interface belongs.

253460731706911258
HealthCheckSourceIpstringNo

The source IP address that is used to perform health checks. The source IP address must be an idle IP address of the local virtual private cloud (VPC).

Note You can set this parameter when an Express Connect circuit is used.
192.168.0.6
HealthCheckTargetIpstringNo

The destination IP address that is used to perform health checks.

Note This parameter is required if you specify HealthCheckSourceIp
192.168.0.8
AccessPointIdstringNo

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

You can call the DescribeAccessPoints operation to obtain the IDs of access points.

Note This parameter is required if the VBR is connected to an Express Connect circuit.
ap-cn-hangzhou-yh-ts-A
OppositeAccessPointIdstringNo

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

Note This parameter is required if the peer router interface is associated with a VBR. The specified value cannot be changed after the router interface is created.
ap-cn-shanghai-nt-aligroup-C
DescriptionstringNo

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://.

abcabc
NamestringNo

The name of the router interface.

The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-).

abc
PeriodintegerNo

The subscription duration. Valid values:

  • Valid values when PricingCycle is set to Month: 1 to 9.
  • Valid values when PricingCycle is set to Year: 1 to 3.
Note This parameter is required if InstanceChargeType is set to PrePaid.
3
InstanceChargeTypestringNo

The billing method of the router interface. Valid values:

  • PrePaid: subscription
  • PostPaid: pay-as-you-go
PrePaid
AutoPaybooleanNo

Specifies whether to enable automatic payment. Valid values:

  • false (default): The automatic payment is disabled. If you select this option, you must go to the Order Center to complete the payment after an order is generated.
  • true: The automatic payment is enabled. Payments are automatically complete after an order is generated.
Note This parameter is required if InstanceChargeType is set to PrePaid.
false
PricingCyclestringNo

The billing cycle of the subscription. Valid values:

  • Month (default)
  • Year
Note This parameter is required if InstanceChargeType is set to PrePaid.
Month
ClientTokenstringNo

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests.

Note If you do not specify this parameter, the system automatically uses the request ID as the client token. The request ID may be different for each request.
123e4567-e89b-12d3-a456-426655440000
FastLinkModebooleanNo

Specifies whether the VBR that is created in the Fast Link mode is uplinked to the router interface. The Fast Link mode helps automatically connect router interfaces that are created for the VBR and its peer VPC. Valid values:

  • true
  • false
Note
  • This parameter takes effect only if RouterType is set to VBR and OppositeRouterType is set to VRouter.

  • If FastLinkMode is set to true, Role must be set to InitiatingSide. In this case, AccessPointId, OppositeRouterType, OpppsiteRouterId, and OppositeInterfaceOwnerId are required.

false
AutoRenewbooleanNo

Specifies whether to enable auto-renewal. Valid values:

  • false (default)
  • true
false
ResourceGroupIdstringNo

The ID of the resource group.

For more information about resource group, see What is Resource Management?

rg-acfmxazb4ph6aiy****
Tagsarray<object>No

The tag to add to the resource.

objectNo
KeystringNo

The tag key to add to the resource. You must enter at least one tag key. You can specify up to 20 tag keys. The tag key cannot be an empty string.

A tag key can be at most 128 characters in length. It cannot start with aliyun or acs:, and cannot contain http:// or https://.

FinanceDept
ValuestringNo

The tag value to add to the resource. You can specify up to 20 tag values. The tag value can be an empty string.

The tag value can be up to 128 characters in length and cannot start with acs: or aliyun. It cannot contain http:// or https://.

FinanceJoshua

Response parameters

ParameterTypeDescriptionExample
object

The request ID.

RequestIdstring

The request ID.

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

The order number. This parameter is returned if InstanceChargeType is set to PrePaid.

202008594930117
RouterInterfaceIdstring

The ID of the router interface.

ri-2ze7fbuohm****

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError messageDescription
400InvalidPrice.NotFoundPricing plan result not found.The Price parameter is set to an invalid value.
400InvalidAliuidInvalid Aliuid.The Aliuid parameter is set to an invalid value.
400InvalidRole.ValueNotSupportedThe specified Role is not valid.The specified role is invalid.
400InvalidSpec.ValudNotSupportedThe specified Spec is not supported.The specification does not support this operation. Change the specification and try again.
400InvalidRouterType.ValueNotSupportedThe specified RouterType is not valid.The router type is invalid.
400InvalidName.MalformedThe specified "Name" is not valid.The name format is invalid.
400Forbidden.BillsOutstandingYou cannot create more RouterInterface because you have bills outstanding.You cannot create router interfaces. You have overdue payments.
400LimitationExceed.InterfaceNumberOnRouterTotal number of RouterInterfaces on a Router exceeded.The number of router interfaces reaches the quota.
400Forbidden.NotInRouterInterfaceCreateWhitelistNot in router interface create whitelist.You are not included in the whitelist to create router interfaces.
400RI_CREATE_ONE_LIMIT_BY_SYNCCreate ri only one limit by sync.You can create only one router interface at a time.
400InvalidAccessPoint.ValueNotAllowedThe non-vbr router interface cannot have access point configured.You cannot configure access points for the router interface of a vRouter.
400InvalidAccessPoint.ValueNotAllowedThe non-vbr opposite router interface cannot have opposite access point configured.You cannot configure access points for the router interface of a non-VBR router.
400InvalidParam.NotFoundParameter must not be null,uid, bid,regionNo, remoteRegionNo, routerId or accessPointIdThe parameter value cannot be null.
400InvalidAccessPoint.NotMatchThe accessPoint id is not matchedThe specified ID of the access point is invalid.
400InvalidAccessPoint.NotExistThe accessPoint not exitThe access point does not exist.
400InvalidRouterType.ValueNotSupportedThe specified RouterType is not validThe router type is invalid.
400INVAID_VBR_STATUSVBR status must be active-
400IncorrectStatus.CenStatusCen status must not be middle status.Check the status of the CEN instance.
400Forbidden.AcceptRoleNotSupportPrePayAcception side ri not support chargetype for prepaid.The subscription billing method is not supported.
400InvalidRouterInterfaceSpec.MalformedSpecified RouterInterface spec is not valid.The RouterInterface Spec parameter is set to an invalid value.
400VpcSubnet.NotFoundVpc subnet not exist.The VPC subnet does not exist.
400IllegalParam.HealthcheckIpHealthcheck ip cannot equal with instance ip.The IP address configured for health checks cannot be the same as the IP address of the instance.
400OperationFailed.HcForInvalidRiTypeHealthchecksourceip and healthchecktargetip is only valid for vr ri that is connected to vbr.The IP address configured for health checks is invalid.
400OperationFailed.SyncOrderToSubSyncOrderToSub error.The operation failed.
400IllegalParam.CrossBorderBandwidthCrossBorder bandwidth error.The inter-region bandwidth plan is invalid.
400IllegalParam.VRouterTypeThe VRouterType is not supported.The VRouterType parameter is set to an invalid value.
400IllegalParam.SpecThe spec is illegal.The spec parameter is set to an invalid value.
400Forbidden.CrossBorderUser not authorized to create cross border routerInterface.You do not have the permissions to create a cross-border router interface.
400InvalidRouterId.NotFoundParam is not valid,this user does not have this router or aliuid bid regionNo and routerId must have something wrong.The RouterId parameter is set to an invalid value.
400InvalidCommodity.NotFoundCommodity is not exist.The Commodity parameter is set to an invalid value.
400InvalidRouterInterfaceChargeType.MalformedSpecified RouterInterface ChargeType is not valid.The RouterInterface ChargeType parameter is set to an invalid value.
400IllegalParam.RegionIdThe specified regionId is illegal.The regionId parameter is set to an invalid value.
400PAY.MAYI_WITHHOLDING_AGREEMENT_ILLEGALUser withhoding argeement is illegal.-
400QuotaExceededRiPerUser quota exceeded-
400OperationFailed.PconnTrafficNotEnableThe operation is failed because of PconnTrafficNotEnable.Billing for outbound data transfer is disabled.
400InvalidRegionId.NotFoundThe regionId provided does not exist in ec region list.-
400ResourceNotInResourceGroupThe specified resource is not in the specified ResourceGroup.The specified resource does not belong to the resource group.
400HaveConnectionBetweenRoutersHave connection between routersA connection is established between the two routers.
400InvalidDescription.MalformedThe specified "Description" is not valid.The description can be 2 to 256 characters in length and cannot start with http:// and https.
400InvalidBandwidth.NotEnoughBandwidth not enough.The bandwidth plan has insufficient bandwidth.
400ForbiddenActionThe user does not support this action.You do not have the required permissions.
404InvalidRegionId.NotFoundThe regionId provided does not exist in our records.The RegionId parameter is set to an invalid value. Specify a valid value and try again.
404InvalidRouterId.NotFoundThe specified RouterId does not exist in our recored.The specified router ID does not exist.
404InvalidRegionId.NotFoundThe parameter wrong, pageNum or pageSize.The parameter is set to an invalid value.
404InvalidRouterId.AttacedToCENCan not create ri when attaced to CEN.You cannot attach the router interface to the CEN instance.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-06-28The Error code has changedView Change Details
2024-05-08The Error code has changedView Change Details
2024-04-17The Error code has changedView Change Details
2023-12-22The Error code has changedView Change Details
2023-12-21The Error code has changedView Change Details
2023-09-11API Description Update. The Error code has changedView Change Details
2023-07-20The Error code has changed. The request parameters of the API has changedView Change Details
2023-05-18The Error code has changed. The request parameters of the API has changedView Change Details