Creates a custom route table.

Description

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 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 of the following instance types, 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.

To create a custom route table, you must upgrade the instance specification. For more information, see Upgrade the instance types of subscription instances and Change the instance type of a pay-as-you-go instance.

Note If your VPC contains one or more ECS instances of the specified instance types and uses a custom route table, you must upgrade the ECS instances. 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 start with a letter. The name can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name 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 and start with a letter. The description cannot start with http:// or https://.

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

The client token that is used to ensure the idempotence of the request. You can use the client to generate the value. Make sure that the client token is unique. The ClientToken value must 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

https://vpc.aliyuncs.com/?Action=CreateRouteTable
&RegionId=cn-zhangjiakou
&VpcId=vpc-bp1qpo0kug3a20qqe****
&<Common request parameters>

Sample success responses

XML format

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

JSON format

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

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.