全部產品
Search
文件中心

VPN Gateway:DescribeCustomerGateways

更新時間:Aug 07, 2026

呼叫 DescribeCustomerGateways 介面查詢使用者閘道器的資訊。

調試

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

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

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

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

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

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

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

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

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

操作

存取層級

資源類型

條件關鍵字

關聯操作

vpc:DescribeCustomerGateways

list

CustomerGateway

acs:vpc:{#regionId}:{#accountId}:customergateway/*

CustomerGateway

acs:vpc:{#regionId}:{#accountId}:customergateway/{#CustomerGatewayId}

請求參數

名稱

類型

必填

描述

樣本值

RegionId

string

使用者閘道器所屬的地域 ID。

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

cn-shanghai

CustomerGatewayId

string

使用者閘道器的執行個體 ID。

說明

如果您未指定使用者閘道器的執行個體 ID,則系統預設查詢目前地域下所有使用者閘道器的資訊。

cgw-bp1pvpl9r9adju6l5****

PageNumber

integer

清單的頁碼。預設值:1

1

PageSize

integer

分頁查詢時每頁的項目數。最大值:50。預設值:10

10

Tag

array<object>

使用者閘道器綁定的標籤清單。

object

標籤資訊。

Key

string

標籤鍵。一旦輸入該值,則不允許為空字串。

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

一次最多支援輸入 20 個標籤鍵。

TagKey

Value

string

標籤值。

標籤值最多支援 128 個字元,可以為空字串,不能以 aliyunacs: 開頭,不能包含 http:// 或者 https://

一個標籤鍵對應一個標籤值。一次最多支援輸入 20 個標籤值。

TagValue

ResourceGroupId

string

使用者閘道器所屬的資源群組 ID。

您可以呼叫 ListResourceGroups 介面查詢資源群組 ID。

rg-acfmzs372yg****

返回參數

名稱

類型

描述

樣本值

object

返回結果。

PageSize

integer

分頁查詢時每頁的項目數。

10

RequestId

string

請求 ID。

E82612A9-CB90-4D7E-B394-1DB7F6509B29

PageNumber

integer

清單的頁碼。

1

TotalCount

integer

清單項目數。

1

CustomerGateways

object

CustomerGateway

array<object>

使用者閘道器資訊清單。

array<object>

使用者閘道器的資訊。

IpAddress

string

本機資料中心閘道器裝置的 IP 位址。

139.32.XX.XX

Asn

integer

本機資料中心閘道器裝置的自治系統號。

65530

Description

string

使用者閘道器的描述資訊。

desctest

CustomerGatewayId

string

使用者閘道器的執行個體 ID。

cgw-bp1pvpl9r9adju6l5****

CreateTime

integer

建立使用者閘道器的時間戳記。單位:毫秒。

時間戳記的格式採用 Unix 時間戳記,表示從格林威治時間 1970 年 01 月 01 日 00 時 00 分 00 秒至建立使用者閘道器時的總時長。

1492747187000

Name

string

使用者閘道器的名稱。

nametest

AuthKey

string

本機資料中心閘道器裝置 BGP 路由協定的驗證金鑰。

AuthKey****

Tags

object

Tag

array<object>

使用者閘道器綁定的標籤清單。

object

標籤資訊。

Key

string

標籤鍵。

TagKey

Value

string

標籤值。

TagValue

ResourceGroupId

string

使用者閘道器所屬的資源群組 ID。

您可以呼叫 ListResourceGroups 介面查詢資源群組資訊。

rg-acfmzs372yg****

樣本

正常返回樣本

JSON格式

{
  "PageSize": 10,
  "RequestId": "E82612A9-CB90-4D7E-B394-1DB7F6509B29",
  "PageNumber": 1,
  "TotalCount": 1,
  "CustomerGateways": {
    "CustomerGateway": [
      {
        "IpAddress": "139.32.XX.XX",
        "Asn": 65530,
        "Description": "desctest",
        "CustomerGatewayId": "cgw-bp1pvpl9r9adju6l5****",
        "CreateTime": 1492747187000,
        "Name": "nametest",
        "AuthKey": "AuthKey****",
        "Tags": {
          "Tag": [
            {
              "Key": "TagKey",
              "Value": "TagValue"
            }
          ]
        },
        "ResourceGroupId": "rg-acfmzs372yg****"
      }
    ]
  }
}

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

400 Forbidden.TagKey.Duplicated The specified tag key already exists. 標籤資源重複。
400 SizeLimitExceeded.TagNum The maximum number of tags is exceeded. 標籤數量超限。
400 InvalidParameter.TagValue The specified parameter TagValue is invalid. 指定的參數 TagValue 不合規範。
400 InvalidParameter.TagKey The specified parameter TagKey is invalid. 指定的參數 TagKey 不合規範。
400 Duplicated.TagKey The specified parameter TagKey is duplicated. 指定的參數 TagKey 重複。
403 Forbbiden.SubUser User not authorized to operate on the specified resource as your account is created by another user.
403 Forbidden User not authorized to operate on the specified resource. EIP 不屬於目前呼叫者,請您檢查該 EIP 是否可被您呼叫。

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

變更歷史

更多資訊,參考變更詳情