Creates an inter-region connection on an Enterprise Edition transit router.
Background information
By default, 1 Kbit/s of bandwidth is provided for inter-region communication between transit routers. This allows you to test the connectivity of inter-region IPv4 networks. To allow services that are deployed in different regions to communicate with each other, you must create an inter-region connection and allocate bandwidth resources to the connection.
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, 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 Cross-region data transfers.
Usage notes
CreateTransitRouterPeerAttachment is an asynchronous operation. After you send a request, the system returns the inter-region connection ID but the operation is still being performed in the system background. You can call ListTransitRouterPeerAttachments to query the status of an inter-region connection.
- If an inter-region connection is in the Attaching state, the inter-region connection is being created. You can query the inter-region connection but cannot perform other regions.
- If an inter-region connection is in the Attached state, the inter-region connection is created.
Debugging
Request parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| Action | String | Yes | CreateTransitRouterPeerAttachment |
The operation that you want to perform. Set the value to CreateTransitRouterPeerAttachment. |
| ClientToken | String | No | 02fb3da4-130e-11e9-8e44-001**** |
The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must make sure that it is unique among different requests. ClientToken can contain only ASCII characters. Note If you do not set this parameter, the system automatically uses RequestId as ClientToken. The value of RequestId of each API request may be different.
|
| CenId | String | No | cen-j3jzhw1zpau2km**** |
The ID of the Cloud Enterprise Network (CEN) instance. |
| TransitRouterId | String | No | tr-bp1su1ytdxtataupl**** |
The ID of the local Enterprise Edition transit router. |
| RegionId | String | No | cn-hangzhou |
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. |
| TransitRouterAttachmentName | String | No | testname |
The name of the inter-region connection. The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter. |
| TransitRouterAttachmentDescription | String | No | testdesc |
The description of the inter-region connection. The description must be 2 to 256 characters in length. The description must start
with a letter but cannot start with |
| PeerTransitRouterId | String | Yes | tr-m5eq27g6bndum7e88**** |
The ID of the peer transit router. |
| PeerTransitRouterRegionId | String | No | cn-qingdao |
The ID of the region where the peer transit router is deployed. |
| AutoPublishRouteEnabled | Boolean | No | false |
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:
|
| Bandwidth | Integer | No | 2 |
The bandwidth value of the inter-region connection. Unit: Mbit/s.
|
| CenBandwidthPackageId | String | No | cenbwp-3xrxupouolw5ou**** |
The ID of the bandwidth plan that is used to allocate bandwidth to the inter-region connection. Note If you set BandwidthType to DataTransfer, you do not need to set this parameter.
|
| DryRun | Boolean | No | false |
Specifies whether to check the request but not perform the operation. The system checks the permissions and the status of the specified instances. Valid values:
|
| BandwidthType | String | No | BandwidthPackage |
The method that is used to allocate bandwidth to the inter-region connection. Valid values: BandwidthPackage: allocates bandwidth from a bandwidth plan. DataTransfer: uses pay-by-data-transfer bandwidth. |
Response parameters
| Parameter | Type | Example | Description |
|---|---|---|---|
| TransitRouterAttachmentId | String | tr-attach-nwkiqfvw22qesz**** |
The ID of the inter-region connection. |
| RequestId | String | 59422BF5-BAAD-4CFD-9019-9557BD3ACFA3 |
The ID of the request. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=CreateTransitRouterPeerAttachment
&ClientToken=02fb3da4-130e-11e9-8e44-001****
&CenId=cen-j3jzhw1zpau2km****
&TransitRouterId=tr-bp1su1ytdxtataupl****
&RegionId=cn-hangzhou
&TransitRouterAttachmentName=testname
&TransitRouterAttachmentDescription=testdesc
&PeerTransitRouterId=tr-m5eq27g6bndum7e88****
&PeerTransitRouterRegionId=cn-qingdao
&AutoPublishRouteEnabled=false
&Bandwidth=2
&CenBandwidthPackageId=cenbwp-3xrxupouolw5ou****
&DryRun=false
&BandwidthType=BandwidthPackage
&Common request parametersSample success responses
XML format
HTTP/1.1 200 OK
Content-Type:application/xml
<CreateTransitRouterPeerAttachmentResponse>
<TransitRouterAttachmentId>tr-attach-nwkiqfvw22qesz****</TransitRouterAttachmentId>
<RequestId>59422BF5-BAAD-4CFD-9019-9557BD3ACFA3</RequestId>
</CreateTransitRouterPeerAttachmentResponse>JSON format
HTTP/1.1 200 OK
Content-Type:application/json
{
"TransitRouterAttachmentId" : "tr-attach-nwkiqfvw22qesz****",
"RequestId" : "59422BF5-BAAD-4CFD-9019-9557BD3ACFA3"
}Error codes
| HttpCode | Error code | Error message | Description |
|---|---|---|---|
| 400 | OperationUnsupported.TransitRouterRegionId | The specified TransitRouterRegion does not support the operation. | The error message returned because the specified region does not support the operation. |
| 400 | NoPermission.AliyunServiceRolePolicyForCEN | You 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 are not authorized to create the service-linked role AliyunServiceRolePolicyForCEN for the service cen.aliyuncs.com. You must acquire the ram:CreateServiceLinkedRole permission before you can perform the operation. |
| 400 | InvalidTransitRouterId.NotFound | TransitRouterId is not found. | The error message returned because the ID of the transit router is invalid. |
| 400 | IllegalParam.PeerTransitRouterId | PeerTransitRouterId is illegal. | The error message returned because the ID of the peer transit router is invalid. |
| 400 | OperationUnsupported.TransitRouterId | TransitRouterId is unsupported. | The error message returned because Basic Edition transit routers do not support the operation. |
| 400 | MissingParam.Bandwidth | The parameter Bandwidth is mandatory. | The error message returned because no bandwidth value is specified. |
For a list of error codes, visit the API Error Center.