全部产品
Search
文档中心

专有网络 VPC:AssociateRouteTable - 将路由表和交换机绑定

更新时间:Aug 28, 2026

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

接口说明

AssociateRouteTable 接口属于异步接口,即系统返回一个请求 ID,但该路由表并未绑定完成,系统后台的绑定任务仍在进行。您可以调用 DescribeVSwitchAttributes 查询路由表的绑定状态:

  • 当交换机处于 Pending 状态时,表示路由表正在绑定中。

  • 当交换机处于 Available 状态时,表示路由表绑定成功。

调试

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

调试

授权信息

当前API暂无授权信息透出。

请求参数

名称

类型

必填

描述

示例值

RegionId

string

要绑定交换机的路由表所属的 VPC 的地域 ID。

您可以通过调用 DescribeRegions 接口获取地域 ID。

cn-hangzhou

RouteTableId

string

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

vtb-bp145q7glnuzdvzu2****

VSwitchId

string

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

vsw-25ncdvfaue4****

ClientToken

string

客户端 Token,用于保证请求的幂等性。

从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken 只支持 ASCII 字符。

说明

若您未指定,则系统自动使用 API 请求的 RequestId 作为 ClientToken 标识。每次 API 请求的 RequestId 可能不一样。

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

RegionId

string

要绑定交换机的路由表所属的 VPC 的地域 ID。

您可以通过调用 DescribeRegions 接口获取地域 ID。

cn-hangzhou

返回参数

名称

类型

描述

示例值

object

RequestId

string

请求 ID。

DC668356-BCB4-42FD-9BC3-FA2B2E04B634

示例

正常返回示例

JSON格式

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

错误码

HTTP status code

错误码

错误信息

描述

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 resource has already associated with a routetable.
400 OperationDenied.AssociateGatewayRouteTable The operation is not allowed because gateway route tables cannot be bound to a vSwitch. 交换机不允许绑定网关路由表。
400 OperationDenied.SwitchToSystemRouteTable The associated route tables cannot be directly changed to system route tables. 无法将绑定路由表直接切换为系统路由表。
400 ResourceNotFound.VSwitch The specified resource of VSwitch is not found. 指定的VSwitch实例不存在
400 InvalidRouteTableId.NotFound Specified route table does not exist.
400 OperationDenied.LocalRouteEntryModified The next hop of a local route is modified. 存在local类型的路由下一跳被修改了。
400 MissingParam.VSwitchId The parameter VSwitchId is missing. 参数VSwitchId缺失
400 InvalidRegionId.NotFound Specified value of RegionId is not supported.
400 InvalidParameter.Action This vpc feature is not supported in this region
400 IncorrectVSwitchStatus The current status of the virtual switch does not support this operation.
400 Forbidden.VSwitchAlreadyAssociatedRouteTable The specified virtual switch already associates route table.
400 Forbidden.NotInSameVpc The specified virtual switch and route table are not in the same VPC.
400 IncorrectStatus.RouteTable The status of the specified route table is incorrect.
404 InvalidRouteTableId.NotFound Specified route table does not exist.
404 InvalidVSwitchId.NotFound Specified VSwitch does not exist.

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

变更历史

更多信息,参考变更详情