全部產品
Search
文件中心

Virtual Private Cloud:CreateVpcGatewayEndpoint - 建立網關終端節點

更新時間:Apr 27, 2026

調用CreateVpcGatewayEndpoint介面建立網關終端節點。

介面說明

  • CreateVpcGatewayEndpoint 介面屬於非同步介面,即系統返回一個 EndpointId,但該網關終端節點尚未建立成功,系統背景建立任務仍在進行。您可以調用 ListVpcGatewayEndpoints 查詢網關終端節點的建立狀態:
    • 當網關終端節點處於 Creating 狀態時,表示網關終端節點正在建立中。

    • 當網關終端節點處於 Created 狀態時,表示網關終端節點建立成功。

  • CreateVpcGatewayEndpoint 介面不支援針對同一個終端節點服務並發建立網關終端節點。

調試

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

調試

授權資訊

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

請求參數

名稱

類型

必填

描述

樣本值

VpcId

string

要建立網關終端節點的 VPC ID。

該 VPC 必須與網關終端節點在同一個地區。

vpc-bp1gsk7h12ew7oegk****

ServiceName

string

終端節點服務名稱。

com.aliyun.cn-hangzhou.oss

PolicyDocument

string

雲端服務的存取原則。

關於存取原則的文法和結構,請參見權限原則文法和結構

說明
  • 當選擇的終端節點服務支援設定存取原則時,該欄位必填;

  • 當選擇的終端節點服務不支援設定存取原則時,該欄位必須為空白。

  • 終端節點服務是否支援設定存取原則,可通過 ListVpcEndpointServicesByEndUser 介面擷取,SupportPolicy 為 true 表明支援,否則不支援。

{ "Version" : "1", "Statement" : [ { "Effect" : "Allow", "Resource" : [ "*" ], "Action" : [ "*" ], "Principal" : [ "*" ] } ] }

EndpointName

string

網關終端節點的名稱。

名稱的長度在 1~128 個字元之間。

test

EndpointDescription

string

網關終端節點的描述資訊。

描述資訊的長度在 1~255 個字元之間。

test

ClientToken

string

用戶端 Token,用於保證請求的等冪性。

從您的用戶端產生一個參數值,確保不同請求間該參數值唯一。ClientToken 只支援 ASCII 字元。

說明

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

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

DryRun

boolean

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

  • true:發送檢查請求,不會建立網關終端節點。檢查項包括 AccessKey 是否有效、RAM 使用者的授權情況和是否填寫了必需參數。如果檢查不通過,則返回對應錯誤。如果檢查通過,會返回錯誤碼DryRunOperation

  • false(預設值):發送正常請求,通過檢查後返回 2xx HTTP 狀態代碼並建立網關終端節點。

false

ResourceGroupId

string

網關終端節點所屬的資源群組 ID。

rg-acfmxazb4ph****

Tag

array<object>

資源的標籤。

object

標籤。

Key

string

資源的標籤鍵。最多支援輸入 20 個標籤鍵。如需傳入該值,則不能輸入Null 字元串。

一個標籤鍵最多支援 128 個字元,不能以aliyunacs:開頭,不能包含http://或者https://

FinanceDept

Value

string

資源的標籤值。最多支援輸入 20 個標籤值。如需傳入該值,可以輸入Null 字元串。

最多支援 128 個字元,不能以aliyunacs:開頭,不能包含http://或者https://

FinanceJoshua

RegionId

string

要建立的網關終端節點的地區 ID。

您可以通過調用 DescribeRegions 介面擷取地區 ID。

cn-hangzhou

返回參數

名稱

類型

描述

樣本值

object

請求 ID。

RequestId

string

請求 ID。

62CFC815-E08A-5CF4-92D1-54273EC9E406

EndpointId

string

網關終端節點執行個體 ID。

vpce-bp1w1dmdqjpwul0v3****

ServiceName

string

終端節點服務名稱。

com.aliyun.cn-hangzhou.oss

EndpointName

string

網關終端節點的名稱。

test

CreationTime

string

網關終端節點的建立時間。按照 ISO8601 標準表示,並需要使用 UTC 時間。格式為:YYYY-MM-DDThh:mm:ssZ。

2021-08-27T01:58:37Z

ResourceGroupId

string

網關終端節點所屬的資源群組 ID。

rg-acfmxazb4ph****

樣本

正常返回樣本

JSON格式

{
  "RequestId": "62CFC815-E08A-5CF4-92D1-54273EC9E406",
  "EndpointId": "vpce-bp1w1dmdqjpwul0v3****",
  "ServiceName": "com.aliyun.cn-hangzhou.oss",
  "EndpointName": "test",
  "CreationTime": "2021-08-27T01:58:37Z",
  "ResourceGroupId": "rg-acfmxazb4ph****"
}

錯誤碼

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 IllegalParam.PolicyDocument The param of PolicyDocument is illegal.
400 IllegalParam.GatewayEndpointName The param of GatewayEndpointName is illegal.
400 IllegalParam.GatewayEndpointDescription The param of GatewayEndpointDescription is illegal.
400 ResourceAlreadyExist.GatewayEndpoint The specified resource gateway endpoint is already exist.
400 ResourceNotFound.ServiceName The specified resource service name is not found.
400 ResourceNotFound.VpcId The specified resource vpc is not found.
400 Forbidden.OperateShareResource The operation is failed because of shared vpc.
400 IncorrectStatus.Vpc The status of vpc [%s] is incorrect.
400 IncorrectStatus.CenStatus The status of vpc cenStatus [%s] is incorrect.
400 OperationFailed.VpcIpv6Disabled The operation is failed because of VpcIpv6Disabled.
400 UnsupportedFeature.GatewayEndpoint The feature of gatewayEndpoint is not supported for %s.
400 SystemBusy System is busy, please try again later.
400 Forbbiden User not authorized to operate on the specified resource.
400 OperationDenied.PolicyDocument The gatewayEndpoint does not support policy.
400 MissingParam.PolicyDocument The param of PolicyDocument is missing.
400 OperationDenied.NotAuthorized User not authorized to operate on the specified resource.
400 InvalidPolicy.WrongFormat Invalid input policy format. 輸入策略資訊格式錯誤。

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

變更歷史

更多資訊,參考變更詳情