Associates a custom route table with a VSwitch in the same VPC.

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 AssociateRouteTable

The name of this action. Value: AssociateRouteTable

RegionId String  Yes cn-hangzhou

The region ID of the VPC to which the route table belongs. To query the region ID, call DescribeRegions.

RouteTableId String  Yes vtb-bp145q7glnuzdvzu2****

The ID of the route table to be associated with the VSwitch.

VSwitchId String  Yes vsw-25ncdvfaue4****

The ID of the VSwitch to be associated with the route table.

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 value is 1 to 64 ASCII characters in length. For more information, see How to ensure idempotence.

Response parameters

Parameter Type Example value Description
RequestId String  DC668356-BCB4-42FD-9BC3-FA2B2E04B634

The ID of the request.


Request example

http(s):// Action=AssociateRouteTable

Response example

XML format


JSON format



HTTP status code Error code Error message Description
404 InvalidRouteTableId.NotFound Specified route table does not exist. The specified route table does not exist.

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