Attaches a custom route table to a VSwitch in the same VPC.

Debug

By using API Explorer, you can easily debug APIs, automatically generate SDK code examples, and quickly search for APIs.

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-bp145q7glnuzdvzu21pom The ID of the route table.
VSwitchId string  Yes vsw-25naue4gz The ID of the VSwitch.
ClientToken String No 02fb3da4-130e-11e9-8e44-0016e04115b

A client token used to guarantee the idempotence of requests.

This parameter value is generated by the client and must be unique. It must be 1 to 64 ASCII characters in length.

Response parameters

Parameter Type Example value Description
RequestId String DC668356-BCB4-42FD-9BC3-FA2B2E04B634 The ID of the request.

Examples

Request example


http(s)://vpc.aliyuncs.com/?Action=AssociateRouteTable
&RegionId=cn-hangzhou
&RouteTableId=vtb-bp145q7glnuzdvzu21pom
&VSwitchId=vsw-25naue4gz
&<CommonParameters>
Response example
  • XML format

    <AssociateRouteTableResponse>
      <RequestId>62172DD5-6BAC-45DF-8D44-xxxxxxx</RequestId>
    </AssociateRouteTableResponse>
    
  • JSON format

    {
    	"RequestId":"62172DD5-6BAC-45DF-8D44-xxxxxxxx"
    }

Error codes

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

See common error codes