全部產品
Search
文件中心

Virtual Private Cloud:AssociateRouteTablesWithVpcGatewayEndpoint

更新時間:Oct 26, 2026

呼叫AssociateRouteTablesWithVpcGatewayEndpoint介面關聯路由表與閘道終端節點。

介面說明

在呼叫本介面關聯路由表與閘道終端節點時,請了解以下內容:

  • 要關聯路由表的閘道終端節點執行個體不能處於 Creating(建立中)、Modifying(修改中)、Associating(綁定中)、Dissociating(解除綁定中)、Deleting(刪除中)等中間狀態。

  • 要關聯的路由表不能處於 Creating(建立中)、Modifying(修改中)、Associating(綁定中)、Dissociating(解除綁定中)、Deleting(刪除中)等中間狀態。

  • 要關聯的路由表和閘道終端節點必須屬於同一個 VPC。

  • 要關聯的路由表不能是被共享的。

  • 不支援關聯 VBR 路由表。

  • 一次最多關聯 20 張路由表。

  • AssociateRouteTablesWithVpcGatewayEndpoint 介面屬於非同步介面,即系統傳回一個執行個體 ID,但該路由表與閘道終端節點尚未綁定成功,系統後台的綁定任務仍在進行。您可以呼叫 GetVpcGatewayEndpointAttribute 查詢路由表與閘道終端節點的綁定狀態:
    • 當路由表與閘道終端節點處於 Associating 狀態時,表示路由表與閘道終端節點正在綁定中。

    • 當路由表與閘道終端節點處於 Created 狀態時,表示路由表與閘道終端節點綁定成功。

  • AssociateRouteTablesWithVpcGatewayEndpoint 介面不支援並行關聯同一個路由表與閘道終端節點。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

當前API暫無授權資訊透出。

請求參數

名稱

類型

必填

描述

樣本值

EndpointId

string

是

要關聯路由表的閘道終端節點執行個體 ID。

vpce-m5e371h5clm3uadih****

RouteTableIds

array

是

要關聯的路由表 ID。N 的取值範圍為 1~20,即一次最多綁定 20 張路由表。

vtb-m5elgtm3aj586iitr****

string

否

要關聯的路由表 ID。N 的取值範圍為 1~20,即一次最多綁定 20 張路由表。

vtb-m5elgtm3aj586iitr****

ClientToken

string

否

保證請求冪等性。從您的用戶端產生一個參數值,確保不同請求間該參數值唯一。ClientToken 只支援 ASCII 字元,且不能超過 64 個字元。

說明

若您未指定,則系統自動使用 API 請求的 RequestId 作為 ClientToken 識別碼。每次 API 請求的 RequestId 可能不一樣。

5A2CFF0E-5718-45B5-9D4D-70B3FF3898

DryRun

boolean

否

是否只預檢此次請求,取值:

  • true:傳送檢查請求,不會關聯路由表。檢查項目包括 AccessKey 是否有效、RAM 使用者的授權情況和是否填寫了必需參數。如果檢查不通過,則傳回對應錯誤。如果檢查通過,會傳回錯誤碼DryRunOperation。

  • false(預設值):傳送正常請求,通過檢查後傳回 2xx HTTP 狀態碼並關聯路由表。

false

RegionId

string

是

要關聯路由表的閘道終端節點的地域 ID。

您可以透過呼叫 DescribeRegions 介面取得地域 ID。

cn-hangzhou

返回參數

名稱

類型

描述

樣本值

object

Schema of Response

RequestId

string

請求 ID。

59BDDA2D-FB52-59F9-9DC5-5EA7D6808B8E

樣本

正常返回樣本

JSON格式

{
  "RequestId": "59BDDA2D-FB52-59F9-9DC5-5EA7D6808B8E"
}

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

400 OperationFailed.ConcurrentOperation The operation is failed because of concurrent operation.
400 IdempotentParameterMismatch The request uses the same client token as a previous, but non-identical request. Do not reuse a client token with different requests, unless the requests are identical.
400 ResourceNotFound.GatewayEndpoint The specified resource gateway endpoint is not found. 指定的 GatewayEndpoint 不存在。
400 IncorrectStatus.GatewayEndpoint The status of GatewayEndpoint [%s] is incorrect.
400 ResourceNotFound.ServiceName The specified resource service name is not found.
400 ResourceNotFound.PrefixList The specified resource prefixList is not found.
400 ResourceNotFound.RouteTable The specified resource routetable is not found.
400 Mismatch.VpcAndRouteTable The vpc and routetable are mismatched.
400 IncorrectStatus.RouteTable The status of route table [%s] is incorrect.
400 ResourceAlreadyExist.Association The specified resource of [%s] is already exist.
400 VPC_ROUTE_ENTRY_CIDR_BLOCK_DUPLICATE Specified CIDR block is already exists.
400 VPC_SWITCH_STATUS_ERROR vSwitch status error, %s
400 QuotaExceeded.VpcRouteEntryNum The quota of vpc route entry num is exceeded, usage %s/%s.
400 OperationUnsupported.DestinationCidrBlockOverlapWithVSwitch The operation is failed because of destination CIDR block is in the CIDR of the VSwitch.
400 SystemBusy System is busy, please try again later.
400 Forbbiden User not authorized to operate on the specified resource.
400 InvalidRegionId.NotFound The regionId provided does not exist in our records. 指定的 RegionId 不存在,請您檢查此產品在該地域是否可用。
400 IncorrectStatus.Vpc The status of vpc [%s] is incorrect.
400 IncorrectStatus.CenStatus The status of vpc cenStatus [%s] is incorrect.
400 UnsupportedFeature.RouterTableType The type of router table is not supported. 您指定的路由表類型不支援。

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

變更歷史

更多資訊,參考變更詳情。