Creates an Enterprise Edition transit router.

Usage notes

  • You can call CreateTransitRouter to create an Enterprise Edition transit router. For more information about the regions that support Enterprise Edition transit routers, see What is CEN?
  • CreateTransitRouter is an asynchronous operation. After you send a request, the transit router ID is returned but the operation is still being performed in the system background. You can call ListTransitRouters to query the status of an Enterprise Edition transit router.
    • If an Enterprise Edition transit router is in the Creating state, the Enterprise Edition transit router is being created. In this case, you can query the Enterprise Edition transit router but cannot perform other operations.
    • If an Enterprise Edition transit router is in the Active state, the Enterprise Edition transit router is created.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateTransitRouter

The operation that you want to perform. Set the value to CreateTransitRouter.

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 a value, but you must make sure that the value is unique among all requests. The token 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 Yes cen-j3jzhw1zpau2km****

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

RegionId String Yes cn-zhangjiakou

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

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

TransitRouterName String No testname

The name of the Enterprise Edition transit router.

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

TransitRouterDescription String No testdesc

The description of the Enterprise Edition transit router.

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

DryRun Boolean No false

Specifies whether to check the request without performing the operation. Check items include permissions and the status of the specified cloud resources. Valid values:

  • false (default): sends the request. If the request passes the check, an Enterprise Edition transit router is created.
  • true: checks the request but does not create the Enterprise Edition transit router. If you use this value, the system checks whether the required parameters are set, and whether the request syntax is valid. If the request fails the check, an error message is returned. If the request passes the check, the DryRunOperation error code is returned.
SupportMulticast Boolean No false

Specifies whether to enable the multicast feature for the Enterprise Edition transit router. Valid values:

  • false (default): no
  • true: yes

The multicast feature is supported only in specific regions. You can call ListTransitRouterAvailableResource to query the regions that support multicast.

TransitRouterCidrList Array No

The CIDR blocks of the transit router.

You can add up to five CIDR blocks at a time. For more information about CIDR blocks of transit routers, see CIDR blocks of transit routers.

Note Only Enterprise Edition transit routers support CIDR blocks.
Cidr String No 192.168.10.0/24

The CIDR block of the transit router.

Name String No nametest

The name of the CIDR block.

The name must be 1 to 128 characters in length.

Description String No desctest

The description of the CIDR block.

The description must be 1 to 256 characters in length.

PublishCidrRoute Boolean No true

Specifies whether to allow the system to automatically add a route that points to the CIDR block to the route table of the transit router.

  • true (default): yes.

    A value of true specifies that after you create a private VPN connection and enable route learning for the connection, the system automatically adds a blackhole route to the route table of the transit router to which the VPN connection is attached.

    The destination CIDR block of the blackhole route is the CIDR block of the transit router. The CIDR block of the transit router refers to the CIDR block from which gateway IP addresses are allocated to IPsec-VPN connections.

    The blackhole route is only advertised to the route table of the virtual border router (VBR) that is connected to the transit router.

  • false: no.
Tag.N.Key String No tagtest

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.N.Value String No TagValue

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 has a unique tag value. You can specify at most 20 tag values in each call.

Response parameters

Parameter Type Example Description
TransitRouterId String tr-uf6llz2286805i44g****

The ID of the Enterprise Edition transit router.

RequestId String 404DA7EC-F495-44B5-B543-6EDCDF90F3D1

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateTransitRouter
&ClientToken=02fb3da4-130e-11e9-8e44-001****
&CenId=cen-j3jzhw1zpau2km****
&RegionId=cn-zhangjiakou
&TransitRouterName=testname
&TransitRouterDescription=testdesc
&DryRun=false
&SupportMulticast=false
&TransitRouterCidrList=[{"Cidr":"192.168.10.0/24","Name":"nametest","Description":"desctest","PublishCidrRoute":true}]
&Tag=[{"Key":"tagtest","Value":"TagValue"}]
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateTransitRouterResponse>
    <TransitRouterId>tr-uf6llz2286805i44g****</TransitRouterId>
    <RequestId>404DA7EC-F495-44B5-B543-6EDCDF90F3D1</RequestId>
</CreateTransitRouterResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "TransitRouterId" : "tr-uf6llz2286805i44g****",
  "RequestId" : "404DA7EC-F495-44B5-B543-6EDCDF90F3D1"
}

Error codes

HttpCode Error codes Error message Description
400 InstanceExist.TransitRouterInstance The instance already exists. The error message returned because a transit router with the same ID already exists in the current region. Transit router IDs must be unique in the same region.
400 Forbbiden.TransitRouterServiceNotOpen The user has not open transit router service. The error message returned because the transit router service is not activated. Activate the service and try again.
400 IllegalParam.Region The specified region is invalid. The error message returned because the specified region is invalid.

For a list of error codes, visit the API Error Center.