Creates a custom route table.

Supported regions

Custom route tables apply to all regions except China (Beijing), China (Shenzhen), and China (Hangzhou).

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 CreateRouteTable

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

RegionId String Yes cn-zhangjiakou

The region ID of the virtual private cloud (VPC) to which the custom route table belongs.

You can call the DescribeRegions operation to query region IDs.

VpcId String Yes vpc-bp1qpo0kug3a20qqe****

The ID of the VPC to which the custom route table belongs.

If a VPC contains an Elastic Compute Service (ECS) instance that belongs to the following instance families, you cannot create a custom route table for the VPC:

ecs.c1, ecs.c2, ecs.c4, ecs.c5, ecs.ce4, ecs.cm4, ecs.d1, ecs.e3, ecs.e4, ecs.ga1, ecs.gn4, ecs.gn5, ecs.i1, ecs.m1, ecs.m2, ecs.mn4, ecs.n1, ecs.n2, ecs.n4, ecs.s1, ecs.s2, ecs.s3, ecs.se1, ecs.sn1, ecs.sn2, ecs.t1, and ecs.xn4.

In this case, you must upgrade or release the ECS instance before you can create a custom route table for the VPC.

Note If a custom route table is created for a VPC that contains an ECS instance in the preceding instance families, you must upgrade or release the ECS instance. Otherwise, the custom route table cannot work as expected.
RouteTableName String No myRouteTable

The name of the route table.

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

Description String No abc

The description of the route table.

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

ClientToken String No 02fb3da4-130e-11e9-8e44-0016e04****

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 ensure that it is unique among different requests. ClientToken can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence.

Response parameters

Parameter Type Example Description
RequestId String 62172DD5-6BAC-45DF-8D44-E11ED28DCAC0

The ID of the request.

RouteTableId String vtb-bp145q7glnuzdvzu2****

The ID of the route table.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateRouteTable
&RegionId=cn-zhangjiakou
&VpcId=vpc-bp1qpo0kug3a20qqe****
&<Common request parameters>

Sample success responses

XML format

<CreateRouteTableResponse>
  <RouteTableId>vtb-bp145q7glnuzdvzu2****</RouteTableId>
  <RequestId>62172DD5-6BAC-45DF-8D44-E11ED28DCAC0</RequestId>
</CreateRouteTableResponse>

JSON format

{
    "RouteTableId": "vtb-bp145q7glnuzdvzu2****",
    "RequestId": "62172DD5-6BAC-45DF-8D44-E11ED28DCAC0"
}

Error codes

HttpCode Error code Error message Description
400 InvalidParameter.Description.Malformed The specified Description is not valid. The error message returned because the specified description is invalid.
404 InvalidVpcId.NotFound Specified VPC does not exist. The error message returned because the specified VPC does not exist.

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