All Products
Search
Document Center

Cloud Enterprise Network:CreateTransitRouterPeerAttachment

Last Updated:Nov 18, 2024

To connect network instances across regions, such as virtual private clouds (VPCs), virtual border routers (VBRs), and IPsec-VPN connections that are connected to transit routers, you must create an inter-region connection between the network instances that you want to connect. You can call the CreateTransitRouterPeerAttachment operation to create an inter-region connection on an Enterprise Edition transit router.

Operation description

  • Enterprise Edition transit routers allow you to allocate bandwidth resources to inter-region connections by using the following methods:

    • Allocate bandwidth resources from a bandwidth plan:

      You must purchase a bandwidth plan, and then allocate bandwidth resources from the bandwidth plan to inter-region connections. For more information about how to purchase a bandwidth plan, see CreateCenBandwidthPackage .

    • Use pay-by-data-transfer bandwidth resources:

      You can set a maximum bandwidth value for an inter-region connection. Then, you are charged for the amount of data transfer over the connection. For more information, see Inter-region data transfer.

  • CreateTransitRouterPeerAttachment is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the ListTransitRouterPeerAttachments operation to query the status of an inter-region connection.

    • If the inter-region connection is in the Attaching state, the inter-region connection is being created. In this case, you can query the connection but cannot perform other operations on the connection.
    • If the inter-region connection is in the Attached state, the inter-region connection is created.

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
cen:CreateTransitRouterPeerAttachmentcreate
*CenInstance
acs:cen:*:{#accountId}:ceninstance/{#ceninstanceId}
*TransitRouter
acs:cen:*:{#accountId}:centransitrouter/{#TransitRouterId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
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. The client token can contain only ASCII characters.

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.
02fb3da4-130e-11e9-8e44-001****
CenIdstringNo

The ID of the Cloud Enterprise Network (CEN) instance.

cen-j3jzhw1zpau2km****
TransitRouterIdstringNo

The ID of the local Enterprise Edition transit router.

tr-bp1su1ytdxtataupl****
RegionIdstringNo

The ID of the region where the local Enterprise Edition transit router is deployed.

You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou
TransitRouterAttachmentNamestringNo

The name of the inter-region connection.

The name can be empty or 1 to 128 characters in length, and cannot start with http:// or https://.

testname
TransitRouterAttachmentDescriptionstringNo

The description of the inter-region connection.

This parameter is optional. If you enter a description, it must be 1 to 256 characters in length, and cannot start with http:// or https://.

testdesc
PeerTransitRouterIdstringYes

The ID of the peer transit router.

tr-m5eq27g6bndum7e88****
PeerTransitRouterRegionIdstringNo

The ID of the region where the peer transit router is deployed.

cn-qingdao
AutoPublishRouteEnabledbooleanNo

Specifies whether to enable the local Enterprise Edition transit router to automatically advertise the routes of the inter-region connection to the peer transit router. Valid values:

  • false (default): no
  • true: yes
false
BandwidthintegerNo

The bandwidth value of the inter-region connection. Unit: Mbit/s.

  • This parameter specifies the maximum bandwidth value for the inter-region connection if you set BandwidthType to BandwidthPackage.
  • This parameter specifies the bandwidth throttling threshold for the inter-region connection if you set BandwidthType to DataTransfer.
2
CenBandwidthPackageIdstringNo

The ID of the bandwidth plan that you want to associate with the inter-region connection.

Note If you set BandwidthType to DataTransfer, you can skip this parameter.
cenbwp-3xrxupouolw5ou****
DryRunbooleanNo

Specifies whether to perform a dry run. Default values:

  • false (default): performs a dry run and sends the request.
  • true: performs a dry run. The system checks the required parameters and request syntax. If the request fails the dry run, an error message is returned. If the request passes the dry run, the system returns the ID of the request.
false
BandwidthTypestringNo

The method that is used to allocate bandwidth to the inter-region connection. Valid values:

  • BandwidthPackage: allocates bandwidth from a bandwidth plan.
  • DataTransfer: bandwidth is billed based on the pay-by-data-transfer metering method.
BandwidthPackage
Tagarray<object>No

The information about the tags.

You can specify at most 20 tags in each call.

objectNo

The tags.

KeystringNo

The tag key.

The tag key cannot be an empty string. The tag key can be up to 64 characters in length and cannot start with acs: or aliyun. It cannot contain http:// or https://.

You can specify at most 20 tag keys.

tag_A1
ValuestringNo

The tag value.

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

Each tag key must have a unique tag value. You can specify at most 20 tag values in each call.

value_A1
DefaultLinkTypestringNo

The default line type.

Valid values: Platinum and Gold.

Platinum is supported only when BandwidthType is set to DataTransfer.

Gold

Response parameters

ParameterTypeDescriptionExample
object

The response.

TransitRouterAttachmentIdstring

The ID of the inter-region connection.

tr-attach-nwkiqfvw22qesz****
RequestIdstring

The ID of the request.

59422BF5-BAAD-4CFD-9019-9557BD3ACFA3

Examples

Sample success responses

JSONformat

{
  "TransitRouterAttachmentId": "tr-attach-nwkiqfvw22qesz****",
  "RequestId": "59422BF5-BAAD-4CFD-9019-9557BD3ACFA3"
}

Error codes

HTTP status codeError codeError messageDescription
400OperationUnsupported.TransitRouterRegionIdThe specified TransitRouterRegion does not support the operation.-
400NoPermission.AliyunServiceRolePolicyForCENYou are not authorized to create the service linked role. Role Name: AliyunServiceRolePolicyForCEN. Service Name: cen.aliyuncs.com. Make sure that the user has been granted the ram:CreateServiceLinkedRole permission.The error message returned because you do not have the permissions to create the service-linked role whose role name is AliyunServiceRolePolicyForCEN and service name is cen.aliyuncs.com. You must acquire the ram:CreateServiceLinkedRole permission before you can create the service-linked role.
400InvalidTransitRouterId.NotFoundTransitRouterId is not found.The error message returned because the ID of the transit router does not exist.
400IllegalParam.PeerTransitRouterIdPeerTransitRouterId is illegal.The error message returned because the ID of the peer transit router is invalid.
400OperationUnsupported.TransitRouterIdTransitRouterId is unsupported.The error message returned because Basic Edition transit routers do not support the operation.
400MissingParam.BandwidthThe parameter Bandwidth is mandatory.The error message returned because no bandwidth value is specified. You must specify a bandwidth value.
400IllegalParam.BandwidthBandwidth is illegal.The error message returned because the specified bandwidth plan ID is invalid.
400Forbbiden.TransitRouterServiceNotOpenThe user has not open transit router service.The error message returned because the transit router is disabled. Enable the transit router and try again.
400OperationUnsupported.TransitRouterTypeThe specified TransitRouterType does not support the operation.The error message returned because this operation is not supported by the specified type of transit router.
400OperationUnsupported.BandwidthTypeThe specified BandwidthType does not support the operation.The error message returned because this operation is not supported by the specified bandwidth type.
400InvalidCenId.NotFoundCenId is not found.The error message returned because the specified CEN instance does not exist.
400IllegalParam.BandwidthTypeBandwidthType is illegal.The error message returned because the specified bandwidth plan type is invalid.
400MissingParam.CenIdOrRegionIdEither CenId or RegionId must be specified.The error message returned because the CenId or RegionId parameter is not set.
400OperationUnsupported.BandwidthHSThis bandwidth limit can only be set in China-AsiaPacific-HS-
400OperationUnsupported.CenFullLevelCEN full level does not support TransitRouterThe error message returned because CEN instances of the Full type do not support Enterprise Edition transit routers.
400OperationUnsupported.CloudDataTransferServiceCCN region not support cloud data transfer service.The error message returned because the Cloud Data Transfer (CDT) service is not supported in the region of the CCN instance.
400InvalidPeerTransitRouterId.NotFoundThe specified PeerTransitRouterId is not found.The error message returned because the specified peer transit router ID (PeerTransitRouterId) does not exist.
400IllegalParam.RegionIdRegionId is illegal.The error message returned because the specified region is invalid.
400IllegalParam.PeerRegionIdPeerRegionId is illegal.The error message returned because the specified peer region ID (PeerRegionId) is invalid.
400IllegalParam.TransitRouterRegionIdTransitRouterRegionId is illegal.The error message returned because the specified transit router region ID (TransitRouterRegionId) is invalid.
400InvalidOperation.CenInstanceStatusThe CEN instance is not in a valid state for the operation. -
400IncorrectStatus.TransitRouterThe status of TransitRouter is incorrect.The error message returned because the status of the transit router does not support this operation. Try again later.
400InvalidOperation.BwpNotAssociatedOperation is invalid because a bandwidth package corresponding to the geographic span is not associated.The error message returned because this operation is not supported when no bandwidth plan is applied to the specified region.
400InvalidOperation.BwpBusinessStatusThe CBN bandwidth package is not in a valid business state for the operation.The error message returned because this operation is not supported when the specified bandwidth plan is in an unstable state.
400IllegalParam.CenBandwidthPackageIdParameter CenBandwidthPackageId is illegal.The error message returned because the specified bandwidth plan ID (CenBandwidthPackageId) is invalid.
400InvalidOperation.BwpBandwidthExceededOperation is invalid because the total bandwidth limit has exceeded that of the bandwidth package.The error message returned because the specified bandwidth value exceeds the maximum bandwidth value of the bandwidth plan.
400ParameterIllegal.CdtDefaultLinkTypeOnlySupportPlatinumOrGoldDataTransfer only support Platinum and Gold.DataTransfer only support Platinum and Gold.
400ParameterIllegal.BandwidthPackageDefaultLinkTypeOnlySupportGoldCen bandwidthPackage only support Gold.Cen bandwidthPackage only support Gold.
400ParameterIllegal.CdtDefaultLinkTypeOnlySupportGoldCDT only support Gold when both transitrouters for cross regional connections are not all enterprise version.CDT only support Gold when both transitrouters for cross regional connections are not all enterprise version.
400OperationNotAllowed.DefaultLinkTypeOnlySupportGoldOperation is not allowed because this user can only set default link type to Gold.This user can only set the default link type to Gold.
400OperationInvalid.UserCanNotBuyCrossBorderBwpAccording to the laws and regulations of the operator and mainland China, you are currently not eligible to purchase or renew a cross-border bandwidth package. Please contact online customer service or your business manager for consultation.According to the laws and regulations of the operator and mainland China, you are currently not eligible to purchase or renew a cross-border bandwidth package. Please contact online customer service or your business manager for consultation.
400OperationInvalid.IdentityRegistrationStatusNotSupportReal name registration of enterprises required.Since you have selected a certain region of "Mainland China" in the "Region" or "Opposite Region" , you must complete the enterprise real name registration before subscription. Please refer to the documentation on enterprise real name registration for details.
400InvalidOperation.OnlyOneRegionSupportIpv6Peer Attachment is only allowed when both regions support IPv6 or do not support IPv6 at all.Peer Attachment is only allowed when both regions support IPv6 or do not support IPv6 at all.
400InvalidOperationOperation is invalid.The error message returned because the operation is invalid.
400Forbidden.ResourceOwnerTransitRouterServiceExpiredThe transit router service of the account to which the resource belongs has been suspended due to arrears. Please notify the other party to renew the service and try again.The transit router service of the account to which the resource belongs has been suspended. Please notify the other party to renew the service and try again.
400Forbidden.TransitRouterServiceExpiredThe transit router service is out of service.The transit router service has been suspended due for payment. Please renew the service and try again.
400InvalidParameterInvalid parameter.The error message returned because the parameter is set to an invalid value.
400UnauthorizedThe AccessKeyId is unauthorized.The error message returned because you do not have the permissions to perform this operation.

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

Change history

Change timeSummary of changesOperation
2024-10-28The Error code has changedView Change Details
2024-06-11The Error code has changedView Change Details
2024-05-17The Error code has changedView Change Details
2023-12-20The Error code has changedView Change Details
2023-12-13The Error code has changedView Change Details
2023-12-06The Error code has changed. The request parameters of the API has changedView Change Details
2023-11-03The Error code has changedView Change Details
2023-10-18The Error code has changed. The request parameters of the API has changedView Change Details
2023-10-18The Error code has changed. The request parameters of the API has changedView Change Details
2023-01-04The Error code has changedView Change Details
2022-12-22The Error code has changedView Change Details