调用AssociateRouteTable接口将创建的自定义路由表和同一VPC内的交换机绑定。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String AssociateRouteTable

要执行的操作,取值:AssociateRouteTable

RegionId String cn-hangzhou

要绑定交换机的路由表所属的VPC的地域ID。您可以通过调用DescribeRegions接口获取地域ID。

RouteTableId String vtb-bp145q7glnuzdvzu2****

要绑定到交换机的路由表的ID。

VSwitchId String vsw-25ncdvfaue4****

要绑定路由表的交换机的ID。

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

保证请求幂等性。从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken只支持ASCII字符,且不能超过64个字符。更多详情,请参见如何保证幂等性

返回数据

名称 类型 示例值 描述
RequestId String DC668356-BCB4-42FD-9BC3-FA2B2E04B634

请求ID。

示例

请求示例

http(s)://vpc.aliyuncs.com/?Action=AssociateRouteTable
&RegionId=cn-hangzhou
&RouteTableId=vtb-bp145q7glnuzdvzu2****
&VSwitchId=vsw-25naue4****
&<公共请求参数>

正常返回示例

XML格式

<AssociateRouteTableResponse>
  <RequestId>DC668356-BCB4-42FD-9BC3-FA2B2E04B634</RequestId>
</AssociateRouteTableResponse>

JSON格式

{
    "RequestId": "DC668356-BCB4-42FD-9BC3-FA2B2E04B634"
}

错误码

HttpCode 错误码 错误信息 描述
404 InvalidRouteTableId.NotFound Specified route table does not exist. 该路由表不存在。
400 OperationDenied.CloudBoxVbrEntryExist The operation is not allowed because the routing table has a route entry for the next hop to the cloud box VBR. 指定操作不允许,因为路由表存在下一跳指向云盒VBR的路由条目。
400 OperationDenied.OtherCloudBoxVbrEntryExist The operation is not allowed because the routing table has a route entry for the next hop that points to a VBR other than this cloud box. 指定操作不允许,因为路由表存在下一跳指向非本云盒VBR的路由条目。
400 ResourceAlreadyAssociated.RouteTable The specified route table is already associated. 指定的路由表已经被绑定。

访问错误中心查看更多错误码。