全部產品
Search
文件中心

Virtual Private Cloud:AssociateRouteTablesWithVpcGatewayEndpoint

更新時間:Jun 19, 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對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

vpc:AssociateRouteTablesWithVpcGatewayEndpoint

create

*GatewayEndpoint

acs:vpc:{#regionId}:{#accountId}:gatewayendpoint/{#GatewayEndpointId}

請求參數

名稱

類型

必填

描述

樣本值

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.
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.
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.

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

變更歷史

更多資訊,參考變更詳情