Modify Bound Routing Tables of a Subnet

Last updated: 2017-12-05 15:58:30

1. API Description

This API (AssociateRouteTable) is used to modify the routing table associated with the subnet.
Domain for API request: vpc.api.qcloud.com

A subnet can only be associated with one routing table.

2. Input Parameters

The following request parameter list only provides API request parameters. Common request parameters need to be added when the API is called. For more information, refer to Common Request Parameters. The Action field for this API is AssociateRouteTable.

Parameter Name Required Type Description
vpcId Yes String ID of VPC to which the subnet belongs. It can be vpcId or unVpcId. unVpcId is recommended. For example: vpc-amhnnao5. It can be queried through API DescribeVpcEx.
subnetId Yes String ID of the subnet to be deleted. Either subnetId or unSubnetId can be used. unSubnetId is recommended. For example, subnet-3x5lf5q0. It can be queried through API DescribeSubnetEx.
routeTableId Yes String The routing table ID assigned by the system, which can be routeTableId or unRouteTableId. unRouteTableId is recommended. For example, rtb-rqndayhs. It can be queried through API DescribeRouteTable.

3. Output Parameters

Parameter Name Type Description
code Int Common error code; 0: Succeeded; other values: Failed. For more information, please refer to Common Error Codes on the Error Code page.
message String Module error message description depending on API.

4. Error Codes

The following error code list only provides the business logic error codes for this API. For additional common error codes, refer to VPC Error Codes.

Error Code Description
InvalidVpc.NotFound VPC not exist. Please check the information you entered. You can query VPC through API DescribeVpcEx.
InvalidSubnet.NotFound Subnet not exist. Please check the information you entered. It can be queried through API DescribeSubnetEx.
InvalidRouteTableId.NotFound Routing table ID not exist. Please check the information you entered. It can be queried through API DescribeRouteTable.

5. Example

Input

  https://vpc.api.qcloud.com/v2/index.php?Action=AssociateRouteTable
  &<Common request parameters>
  &vpcId=vpc-amhnnao5
  &routeTableId=rtb-rqndayhs
  &subnetId=subnet-3x5lf5q0

Output


{
    "code": 0,
    "message": ""
}