
# 查询P2C VPN网关列表 - QueryP2CVPNGateways
#### 功能介绍
查询P2C VPN网关列表。
#### 调用方法
请参见[如何调用API](https://support.huaweicloud.com/api-vpn/vpn_api_0008.html)。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-vpn/vpn_api_0044.html)。
- 如果使用身份策略授权，需具备如下身份策略权限。
| 授权项                    | 访问级别 | 资源类型（\*为必须）   | 条件键 | 别名 | 依赖的授权项 |
|:---|:---|:---|:---|:---|:---|
| vpn:p2cVpnGateway:list | list | p2cVpnGateway | -   | -  | -      |
   
#### URI
GET /v5/{project_id}/p2c-vpn-gateways
表1参数说明 
| 名称         | 类型     | 是否必选 | 描述                                                                                  |
|:---|:---|:---|:---|
| project_id | String | 是    | 项目ID，可以通过[获取项目ID](https://support.huaweicloud.com/api-vpn/vpn_api_0051.html)获取项目ID。 |
   
表2请求Query参数列表 
| 名称                    | 类型      | 是否必选 | 描述                                                                                                                                                                                                                                                                                                                                               |
|:---|:---|:---|:---|
| limit                 | Integer | 否    | 分页查询时每页返回的记录数量。                                                                                                                                                                                                                                                                                                                                  |
| marker                | String  | 否    | - 功能说明：查询本页的起始标记位，为空时为查询第一页。查询下一页的marker可以根据上一页响应的page_info对象中的next_marker填写。  - 约束：必须与limit一起使用。   |
| enterprise_project_id | Array   | 否    | 企业项目ID。                                                                                                                                                                                                                                                                                                                                          |
   
#### 请求消息
- 请求参数 无。
  
- 请求样例
  ```
  GET https://{Endpoint}/v5/{project_id}/p2c-vpn-gateways
  ```
  
 
#### 响应消息
- 响应参数
  返回状态码为 200: 查询成功。
  表3响应Body参数列表 
  | 名称               | 类型                                                                                   | 描述        |
  |:---|:---|:---|
  | p2c_vpn_gateways | Array of [p2c_vpn_gateway] objects | 网关信息列表。   |
  | total_count      | Integer                                                                              | 网关总数。     |
  | page_info        | [PageInfo] object                | 分页查询页的信息。 |
  | request_id       | string                                                                               | 请求ID。     |
     
   表4p2c_vpn_gateway 
  | 名称                        | 类型                                                                                                                                                                              | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
  |:---|:---|:---|
  | id                        | String                                                                                                                                                                          | - 功能说明：P2C VPN网关ID。  - 格式：36位UUID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
  | name                      | String                                                                                                                                                                          | - 功能说明：P2C VPN网关名称。  - 取值范围：1-64个字符，支持数字、英文字母、中文（\\u4e00 - \\u9fa5）、_（下划线）、-（中划线）。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
  | status                    | String                                                                                                                                                                          | - 功能说明：P2C VPN网关状态。  - 取值范围： PENDING_CREATE：创建中。 PENDING_UPDATE：更新中。 PENDING_DELETE：删除中。 UPGRADING：升级中。 ROLLING_BACK：回退中。 PENDING_UPGRADE_CONFIRM：确认升级。 ACTIVE：正常。 FAULT：异常。 FROZEN：冻结。    |
  | vpc_id                    | String                                                                                                                                                                          | P2C VPN网关所连接的VPC的ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
  | connect_subnet            | String                                                                                                                                                                          | P2C VPN网关所使用的VPC子网ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
  | flavor                    | String                                                                                                                                                                          | - 功能说明：P2C VPN网关的规格类型。  - 取值范围: Professional1：专业型1。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
  | availability_zone_ids     | Array of strings                                                                                                                                                                | 可用区列表。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
  | eip                       | [ResponseEipInfo] object                                                        | 网关绑定的EIP信息。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
  | max_connection_number     | Integer                                                                                                                                                                         | - 功能说明：最多支持同时在线的客户端连接数。  - 取值范围：1\~500。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
  | current_connection_number | Integer                                                                                                                                                                         | 当前建连的客户端连接数。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
  | enterprise_project_id     | string                                                                                                                                                                          | 企业项目ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
  | tags                      | Array of [VpnResourceTag] objects | 标签列表。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
  | order_id                  | String                                                                                                                                                                          | 订单ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
  | admin_state_up            | Boolean                                                                                                                                                                         | - 功能说明：冻结状态。  - 取值范围： true：未冻结。 false：冻结。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
  | frozen_effect             | Integer                                                                                                                                                                         | - 功能说明：冻结影响，标识该资源冻结后是否可以删除。  - 取值范围： 0：未冻结。 1：冻结可删除。 2：冻结不可删除。                                                                                                                                                                                                                                                                                                                                                                                                                  |
  | version                   | string                                                                                                                                                                          | - 功能说明：网关版本                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
  | upgrade_info              | string                                                                                                                                                                          | - 功能说明：升级信息。  - 取值范围： - ready：可以升级。  - expiring soon：即将过期。  - unready：无法升级。                                                                                                                                                                                                               |
  | created_at                | String                                                                                                                                                                          | - 功能说明：创建时间。  - UTC时间格式：*yyyy-MM-ddTHH:mm:ss.SSSZ*。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
  | applied_at                | String                                                                                                                                                                          | - 功能说明：生效时间  - UTC时间格式：*yyyy-MM-ddTHH:mm:ss.SSSZ*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
  | updated_at                | String                                                                                                                                                                          | - 功能说明：最后一次更新时间。  - UTC时间格式：*yyyy-MM-ddTHH:mm:ss.SSSZ*。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
     
   表5ResponseEipInfo 
  | 名称                     | 类型      | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
  |:---|:---|:---|
  | id                     | String  | - 功能说明：EIP的ID。  - 格式：36位UUID。                                                                                                                                                                                                                                                                                                            |
  | ip_version             | Integer | - 功能说明：EIP版本。  - 取值范围：4。                                                                                                                                                                                                                                                                                                             |
  | ip_billing_info        | String  | - 功能说明：EIP的订单信息。包年/包月EIP才会返回订单信息，按需计费的EIP不返回。  - 格式：order_id:product_id:region_id:project_id，如： CS22\*\*\*\*\*\*\*\*LIBIV:00301-\*\*\*\*\*\*-0--0:br-iaas-odin1:0605768a\*\*\*\*\*\*\*\*\*\*\*\*c006c7e484aa。                                                   |
  | type                   | String  | - 功能说明：EIP的类型。  - 取值范围：5_bgp（全动态BGP），5_sbgp（静态BGP），5_youxuanbgp（优选BGP） 可查看[申请EIP](https://support.huaweicloud.com/api-eip/eip_api_0001.html)[表6](https://support.huaweicloud.com/api-vpn/vpn_api_0014.html#ZH-CN_TOPIC_0000001594352981__table65353)中type字段的取值范围。    |
  | ip_address             | String  | - 功能说明：EIP的公网IPv4地址。  - 格式：ipv4类型地址。例如：88.\*\*\*.\*\*\*.11。                                                                                                                                                                                                                                                                       |
  | charge_mode            | String  | - 功能说明：EIP的带宽计费模式。                                                                                                                                                                                                                                                                                                                                                                                                                 |
  | bandwidth_id           | String  | - 功能说明：EIP的带宽ID。  - 格式：36位UUID。                                                                                                                                                                                                                                                                                                    |
  | bandwidth_size         | Integer | - 功能说明：EIP的带宽大小，单位：Mbit/s。每个region能够提供的EIP最大带宽不同，EIP的最大带宽受限于EIP服务，可以使用工单来提高账户下的EIP的最大带宽。  - 取值范围：1-1000，具体取值请参考弹性公网服务创建EIP资料。                                                                                                                                                                                                      |
  | bandwidth_name         | String  | - 功能说明：EIP的带宽名称。  - 取值范围：1-64个字符，支持数字、英文字母、中文(\\u4e00 - \\u9fa5)、_(下划线)、-(中划线)、.(点)。                                                                                                                                                                                                                                             |
  | bandwidth_billing_info | String  | - 功能说明：EIP的带宽订单信息。包年/包月EIP带宽才会返回带宽订单信息，按需计费的EIP带宽不返回。  - 格式：order_id:product_id:region_id:project_id，如： CS22\*\*\*\*\*\*\*\*LIBIV:00301-\*\*\*\*\*\*-0--0:br-iaas-odin1:0605768a\*\*\*\*\*\*\*\*\*\*\*\*c006c7e484aa。                                           |
  | share_type             | String  | - 功能说明: 带宽共享类型。  - 取值范围： PER：独享带宽。                                                                                                                                                                                                                              |
     
   表6VpnResourceTag 
  | 名称    | 类型     | 描述                                                                                                                                                                                                                                                                                                                            |
  |:---|:---|:---|
  | key   | String | - 功能说明：标签的键。  - 取值范围：1-128个字符，支持任意语种字母、数字、空格和_.:=+-@，但首尾不能含有空格，不能以_sys_开头。   |
  | value | String | - 功能说明：标签的值。  - 取值范围：0-255个字符，支持任意语种字母、数字、空格和_.:/=+-@。                           |
     
   表7PageInfo 
  | 名称            | 类型      | 描述                                |
  |:---|:---|:---|
  | next_marker   | String  | 下一页的marker,值为上一次查询响应中最后一个资源的创建时间。 |
  | current_count | Integer | 当前列表中资源数量。                        |
     
  
 
- 响应样例
  ```
  {
      "p2c_vpn_gateways": [
          {
              "id": "6d526e5f-a0c6-44b6-a785-7e0ef7c9eb76",
              "name": "p2c-vpngw-0001",
              "status": "ACTIVE",
              "vpc_id": "05b9d7de-9acd-4a05-b497-1a3c75afaa0a",
              "connect_subnet": "1948ce22-ddc5-4fb6-87b8-dfcc9b176b51",
              "flavor": "Professional1",
              "availability_zone_ids": [
                  "cn-south-1f",            
  "cn-south-1e"
              ],
              "eip": {
                  "id": "f0bac06a-88a7-4d37-8e2e-c37691ee4ba2",
                  "ip_version": 4,
                  "ip_billing_info": "CS*********JWT1O:OFFI*************5078:cn-south-1:47190474************98781092d16c",
                  "type": "5_youxuanbgp",
                  "ip_address": "215.***.***.120",
                  "charge_mode": "bandwidth",
                  "bandwidth_id": "3456471c-9dac-40f6-8344-daca14fbd81e",
                  "bandwidth_size": 20,
                  "bandwidth_name": "p2c-vpngw-bandwidth-bd61",
                  "bandwidth_billing_info": "CS*********JWT1O:OFFI*************5078:cn-south-1:47190474************98781092d16c",
                  "share_type": "PER"
              },
              "max_connection_number": 10,
              "current_connection_number": 0,
              "tags": [],
              "order_id": "CS2406141822JWT1O",
              "admin_state_up": true,
              "frozen_effect": 0,
              "created_at": "2024-06-14T10:24:12.147Z",
              "updated_at": "2024-06-14T10:24:12.147Z"
          },
          {
              "id": "10d176c7-aed8-4766-9180-a47e536c64d0",
              "name": "p2c-vpngw-0002",
              "status": "ACTIVE",
              "vpc_id": "01ffa178-9be5-4457-ba5b-874c01cfc872",
              "connect_subnet": "be0d53dd-55a1-4e73-9002-54297e1a4c43",
              "flavor": "Professional1",
              "availability_zone_ids": [
                  "cn-south-1f",            
  "cn-south-1e"
              ],
              "eip": {
                  "id": "106a269c-c8c1-425e-9f92-f6abcb4dc7b1",
                  "ip_version": 4,
                  "ip_billing_info": "CS*********JWT1O:OFFI*************5078:cn-south-1:47190474************98781092d16c",
                  "type": "5_bgp",
                  "ip_address": "10.83.51.162",
                  "charge_mode": "bandwidth",
                  "bandwidth_id": "beeababf-57aa-469e-8fc8-e6f01554711c",
                  "bandwidth_size": 20,
                  "bandwidth_name": "p2c-vpngw-bandwidth-4455",
                  "bandwidth_billing_info": "CS*********JWT1O:OFFI*************5078:cn-south-1:47190474************98781092d16c",
                  "share_type": "PER"
              },
              "max_connection_number": 10,
              "current_connection_number": 0,
              "tags": [],
              "order_id": "CS**********JWT1O",
              "admin_state_up": true,
              "frozen_effect": 0,
              "created_at": "2024-06-14T10:01:39.654Z",
              "updated_at": "2024-06-15T01:59:40.39Z"
          }
      ],
      "total_count": 2,
      "page_info": {
          "current_count": 2
      },
      "request_id": "6a88ffb594cdb382ac2c321bc6cbbe13"
  }
  ```
  
#### 状态码
请参见[状态码](https://support.huaweicloud.com/api-vpn/vpn_api_0052.html)。
