All Products
Search
Document Center

Cloud Enterprise Network:CreateTransitRouter

Last Updated:Apr 11, 2023

Creates an Enterprise Edition transit router.

Operation Description

  • You can call the CreateTransitRouter operation 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 system returns a request ID and runs the task in the background. You can call the ListTransitRouters operation 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.

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 keyAssociation operation
cen:CreateTransitRouterWrite
  • CEN
    acs:cen:*:{#accountId}:ceninstance/*
  • CEN
    acs:cen:*:{#accountId}:ceninstance/{#ceninstanceId}
  • CEN
    acs:cen:*:{#accountId}:transitrouter/*
    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 value, but you must make sure that it is unique among different requests. The token can contain only ASCII characters.

NoteIf you do not set this parameter, ClientToken is set to the value of RequestId. The value of RequestId for each API request may be different.
02fb3da4-130e-11e9-8e44-001****
CenIdstringYes

The ID of the CEN instance.

cen-j3jzhw1zpau2km****
RegionIdstringYes

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.

cn-zhangjiakou
TransitRouterNamestringNo

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

testname
TransitRouterDescriptionstringNo

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

testdesc
DryRunbooleanNo

Specifies whether to perform a dry run. Valid values:

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

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

  • false (default): disables multicast
  • true: enables multicast

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

false
TransitRouterCidrListarrayNo

The CIDR blocks of the transit router.

You can add up to five CIDR blocks in each call. For more information about CIDR blocks of transit routers, see CIDR blocks of transit routers.

NoteOnly Enterprise Edition transit routers support CIDR blocks.
objectNo

The CIDR blocks to be added to the transit router.

You can specify up to five CIDR blocks in each call. For more information about CIDR blocks of transit routers, see CIDR blocks of transit routers.

NoteOnly Enterprise Edition transit routers support CIDR blocks.
CidrstringNo

The CIDR block of the transit router.

192.168.10.0/24
NamestringNo

The name of the CIDR block.

The name must be 1 to 128 characters in length.

nametest
DescriptionstringNo

The description of the CIDR block.

The description must be 1 to 256 characters in length.

desctest
PublishCidrRoutebooleanNo

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 add a route learning correlation for the private VPN connection, the system automatically adds the following route to the route table of the transit router that is in route learning correlation with the private VPN connection:
    
      A blackhole route whose destination CIDR block 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 advertised only to the route tables of the virtual border routers (VBRs) that are connected to the transit router. 
  • false: no

true
TagarrayNo

The information about the tags.

You can specify at most 20 tags in each call.

objectNo

The information about the tags.

You can specify at most 20 tags in each call.

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.

tagtest
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.

TagValue

Response parameters

ParameterTypeDescriptionExample
object

The response.

TransitRouterIdstring

The ID of the Enterprise Edition transit router.

tr-uf6llz2286805i44g****
RequestIdstring

The ID of the request.

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

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError messageDescription
400OperationUnsupported.RegionIdThe specified Region is not supported.The error message returned because this operation is not supported in the specified region.
400InstanceExist.TransitRouterInstanceThe instance already exists.The error message returned because a transit router with the same ID already exists in the current region. Transit router IDs in the same region must be unique.
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.SupportMulticastThe multicast is not supported in the specified region.The error message returned because multicast is not supported in the specified region.
400OperationUnsupported.CenFullLevelCEN full level does not support TransitRouter.-
400IllegalParam.CidrCidr is illegal.The error message returned because the specified CIDR block is invalid.
400Illegal.TrTypeThe TransitRouter type is illegal.The error message returned because the specified type of transit router does not support this operation.
400OperationUnsupported.TransitRouterCidrListThe TransitRouterCidrList is not support in the specified Region.The error message returned because this operation is not supported in the specified region.
400OperationFailed.CidrConflictOperation is invalid because the cidr conflict.The error message returned because the specified CIDR block conflicts with another one.
400IllegalParam.RegionThe specified region is invalid.The error message returned because the specified region is invalid.
400OverLappingExist.CidrThe cidr overlapping exist.The error message returned because CIDR overlapping is already enabled.
400IllegalParam.ServiceModeThe specified ServiceMode is invalid.The error message returned because the specified service mode is invalid.
400ParamExclusive.ServiceModeAndSupportMulticastServiceMode and SupportMulticast is mutually exclusive.The error message returned because transit routers in the current mode do not support multicast.
400ParamExclusive.ServiceModeAndTransitRouterCidrListServiceMode and TransitRouterCidrList is mutually exclusive.The error message returned because transit routers in the current mode do not support CIDR blocks.
400OperationUnsupported.TagThe Tag is not supported in the specified region.The error message returned because transit routers in the current region do not support tags.
400IllegalParam.SupportMulticastBasic Transit router is not support multicast.The error message returned because Basic Edition transit routers do not support multicast.
400ParamExclusive.BasicAndPrimaryStandbyBasic and PrimaryStandby is mutually exclusive.The error message returned because Basic Edition transit routers do not support the PrimaryStandby mode.
400ParamExclusive.BasicAndMultiPrimaryBasic and MultiPrimary is mutually exclusive.The error message returned because Basic Edition transit routers do not support the MultiPrimary mode.

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

Change history

Change timeSummary of changesOperation
2023-01-03The error codes of the API operation change.
Change itemChange content
Error CodesThe error codes of the API operation change.
    delete Error Codes: 400
2022-12-22The error codes of the API operation change.
Change itemChange content
Error CodesThe error codes of the API operation change.
    Error Codes 400 change