全部產品
Search
文件中心

Virtual Private Cloud:AssociateRouteTable - 將路由表和交換器綁定

更新時間:Apr 27, 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.

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情