Creates a custom route table.

API description

Currently, custom route tables are available in all regions except China (Beijing), China (Shenzhen), and China (Hangzhou).

Make the API call

You can use OpenAPI Explorer to make API calls, search for API calls, perform debugging, and generate SDK example code.

Request parameters

Parameter Type Required? Example value Description
Action String  Yes CreateRouteTable

The name of this action. Value: CreateRouteTable

RegionId String Yes cn-zhangjiakou

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

To query the region ID, call DescribeRegions.

VpcId String  Yes vpc-bp1qpo0kug3a20qqe****

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

RouteTableName String No myRouteTable

The name of the route table.

The name must be 2 to 128 characters in length. It must start with a letter and can contain numbers, periods (.), underscores (_), or hyphens (-). It 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 and cannot start with http:// or https://.

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

The client token that guarantees the idempotence of the request. The value of this parameter is generated by the client and is unique among different requests. The ClientToken parameter 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 value Description
RequestId String 62172DD5-6BAC-45DF-8D44-E11ED28DCAC0

The ID of the request.

RouteTableId String vtb-bp145q7glnuzdvzu2****

The ID of the route table.

Examples

Request example

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

Response example

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****"
}

Errors

HTTP status code Error code Error message Description
400 InvalidParameter.Description.Malformed The specified Description is not valid. The description is invalid.
404 InvalidVpcId.NotFound Specified VPC does not exist. The specified VPC does not exist.

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