华为云计算 云知识 查询VPN网关列表ListVgws
查询VPN网关列表ListVgws

 

功能介绍

查询VPN网关列表

URI

GET /v5/{project_id}/vpn-gateways

表1 参数说明

名称

类型

是否必选

说明

project_id

String

项目ID,可以通过获取项目ID获取项目ID

表2 请求Query参数列表

名称

类型

是否必选

描述

enterprise_project_id

Array

企业项目ID

请求消息

  • 请求参数

  • 请求样例
    1. 查询所有VPN网关
    GET https://{Endpoint}/v5/{project_id}/vpn-gateways

    2. 根据enterprise_project_id查询VPN网关

    GET https://{Endpoint}/v5/{project_id}/vpn-gateways?enterprise_project_id={enterprise_project_id}

响应消息

  • 响应参数

    返回状态码为 200: 查询成功

    表3 响应Body参数列表

    名称

    类型

    描述

    vpn_gateways

    Array of ResponseVpnGateway objects

    网关信息

    request_id

    String

    请求ID

    表4 ResponseVpnGateway

    名称

    类型

    描述

    id

    String

    • 功能说明:VPN网关ID
    • 格式:36位UUID

    name

    String

    • 功能说明:VPN网关名称,不填时会自动生成。
    • 取值范围:1-64个字符,包括数字、英文字母、中文(\u4e00 - \u9fa5)、_(下划线)、-(中划线)。

    network_type

    String

    • 功能说明:VPN网关网络类型
    • 取值范围:public,private。
    • 默认值:public

    status

    String

    • 功能说明:VPN网关状态
    • 取值范围:

      PENDING_CREATE:创建中

      PENDING_UPDATE:更新中

      PENDING_DELETE:删除中

      ACTIVE:正常

      FAULT:异常

      FREEZED:冻结

    attachment_type

    String

    • 功能说明:关联模式
    • 取值范围:vpc,er

    er_id

    String

    VPN网关所连接的ER实例的ID。仅当attachment_type为er时返回。

    vpc_id

    String

    当attachment_type为vpc时,vpc_id是VPN网关关联的业务VPC的ID。

    当attachment_type为er时,vpc_id是VPN网关的接入VPC的ID。

    local_subnets

    Array of String

    本端子网。本端子网是云上子网,该网段需要通过VPN与用户侧网络进行互通。单个网段格式示例:192.168.52.0/24。仅当attachment_type为vpc时返回。

    connect_subnet

    String

    VPN网关所使用的VPC中的一个子网ID

    bgp_asn

    Long

    VPN网关的BGP自治域编号

    flavor

    String

    • 功能说明:VPN网关的规格类型:
    • 取值范围:

      Basic:最大转发带宽100Mbps

      Professional1:最大转发带宽300Mbps

      Professional2:最大转发带宽1Gbps

      GM:最大转发带宽500Mbps

    availability_zone_ids

    Array of String

    部署VPN网关的可用区。当指定了可用区时则返回;当未指定可用区时,在VPN网关的状态为ACTIVE时返回。

    connection_number

    Integer

    VPN网关下的最大VPN连接数

    used_connection_number

    Integer

    VPN网关下当前已经使用的VPN连接数

    used_connection_group

    Integer

    VPN网关下当前已经使用的VPN连接组个数。同一用户网关入云的两条连接组成一个连接组。VPN网关默认支持10个免费的VPN连接组。

    enterprise_project_id

    String

    • 功能说明:企业项目ID
    • 格式:36位UUID。创建时不传则返回"0",表示资源属于default企业项目。

      注:"0"并不是真实存在的企业项目ID。

    master_eip

    ResponseEip object

    • 功能说明:VPN网关使用的第一个EIP
    • 约束:network_type为public时必选,为private时不需要填写
      说明:

      不推荐使用该字段,推荐使用eip1

    eip1

    ResponseEip object

    VPN网关使用的第一个EIP。在VPN网关的状态为ACTIVE时返回。

    slave_eip

    ResponseEipobject

    • 功能说明:VPN网关使用的第二个EIP
    • 约束:network_type为public时必选,为private时不需要填写
      说明:

      不推荐使用该字段,推荐使用eip2

    eip2

    ResponseEip object

    VPN网关使用的第二个EIP。在VPN网关的状态为ACTIVE时返回。

    created_at

    String

    创建时间。在VPN网关的状态为ACTIVE时返回。

    updated_at

    String

    最后一次更新时间。在VPN网关的状态为ACTIVE时返回。

    access_vpc_id

    String

    • 功能说明:VPN网关使用的接入VPC ID
    • 格式:36位UUID

    access_subnet_id

    String

    • 功能说明:VPN网关使用的接入VPC中的子网ID
    • 格式:36位UUID

    access_private_ips

    Array of String

    私网类型VPN网关的接入私网IP列表,VPN网关使用该私网IP与对端网关建连。固定返回两个ip地址。

    示例:192.168.52.9。仅当network_type为private时返回。

    说明:

    不推荐使用,推荐使用access_private_ip_1和access_private_ip_2

    access_private_ip_1

    String

    私网类型VPN网关的接入私网IP,VPN网关使用该私网IP与对端网关建连。双活网关表示使用的第一个私网地址,主备表示主私网地址。

    示例:192.168.52.9。仅当network_type为private时返回。

    access_private_ip_2

    String

    私网类型VPN网关的接入私网IP,VPN网关使用该私网IP与对端网关建连。双活网关表示使用的第二个私网地址,主备表示备私网地址。

    示例:192.168.52.9。仅当network_type为private时返回。

    ha_mode

    String

    • 功能说明:网关的HA模式,"active-active"表示双活,"active-standby"表示主备
    • 取值范围:active-active,active-standby
    • 默认值:active-active
    表5 ResponseEip

    名称

    类型

    描述

    id

    String

    • 功能说明:EIP的ID
    • 格式:36位UUID。当使用默认企业项目时返回"0"

    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的类型
    • 取值范围:可查看申请EIP表6中type字段的取值范围。

    ip_address

    String

    • 功能说明:EIP的 公网IP v4地址
    • 格式:ipv4类型地址。例如:88.***.***.11。

    charge_mode

    String

    • 功能说明:EIP的带宽计费模式。按流量计费或按带宽计费。
    • 取值范围:

      bandwidth:按带宽计费

      traffic:按流量计费

    bandwidth_id

    String

    • 功能说明:EIP的带宽ID
    • 格式:36位UUID

    bandwidth_size

    Integer

    • 功能说明:EIP的带宽大小,单位:Mbit/s。每个region能够提供的EIP最大带宽不同,EIP的最大带宽受限于EIP服务,可以使用工单来提高账户下的EIP的最大带宽。
    • 取值范围:1-1000

    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

  • 响应样例
    1. 查询所有VPN网关的响应
    {
        "vpn_gateways": [{
            "id": "8e1d0686-****-****-****-91f32fa1dfc8",
            "name": "vpngw-1af3",
            "network_type": "public",
            "status": "ACTIVE",
            "attachment_type": "vpc",
            "vpc_id": "91a74241-****-****-****-9b5f98c66c8c",
            "local_subnets": ["192.168.15.0/24"],
            "connect_subnet": "f5741286-****-****-****-2c82bd9ee114",
            "bgp_asn": 64512,
            "flavor": "Professional1",
            "availability_zone_ids": ["cn-south-1f", "cn-south-1e"],
            "connection_number": 200,
            "used_connection_number": 0,
            "used_connection_group": 0,
            "enterprise_project_id": "0",
            "eip1": {
                "id": "8ff5d6b5-****-****-****-b9d598033153",
                "ip_version": 4,
                "type": "5_bgp",
                "ip_address": "88.***.***.111",
                "charge_mode": "bandwidth",
                "bandwidth_id": "aa62f8f2-****-****-****-b05b2b999715",
                "bandwidth_size": 300,
                "bandwidth_name": "vpngw-bandwidth-13a3"
            },
            "eip2": {
                "id": "08e7e927-****-****-****-26a6394021eb",
                "ip_version": 4,
                "type": "5_bgp",
                "ip_address": "88.***.***.199",
                "charge_mode": "bandwidth",
                "bandwidth_id": "887d61f7-****-****-****-38ee8232e27c",
                "bandwidth_size": 300,
                "bandwidth_name": "vpngw-bandwidth-1afb"
            },
            "created_at": "2022-11-28T02:36:16.834Z",
            "updated_at": "2022-11-28T02:36:16.834Z",
            "access_vpc_id": "91a74241-****-****-****-9b5f98c66c8c",
            "access_subnet_id": "f5741286-****-****-****-2c82bd9ee114",
            "ha_mode": "active-active"
        }, {
            "id": "66ddeacb-****-****-****-9a414b5bd7d5",
            "name": "vpngw-2be4",
            "network_type": "public",
            "status": "ACTIVE",
            "attachment_type": "er",
            "er_id": "c62fad0d-****-****-****-e06c4c351b9f",
            "bgp_asn": 64512,
            "flavor": "Professional1",
            "availability_zone_ids": ["cn-south-1f", "cn-south-1e"],
            "connection_number": 200,
            "used_connection_number": 0,
            "used_connection_group": 0,
            "enterprise_project_id": "0",
            "eip1": {
                "id": "0f6d1415-****-****-****-edb2ee97c9cc",
                "ip_version": 4,
                "type": "5_bgp",
                "ip_address": "88.***.***.251",
                "charge_mode": "bandwidth",
                "bandwidth_id": "e93767cc-****-****-****-bac2987f90a4",
                "bandwidth_size": 300,
                "bandwidth_name": "vpngw-bandwidth-10c3"
            },
            "eip2": {
                "id": "7b46b62f-****-****-****-6b8e44312416",
                "ip_version": 4,
                "type": "5_bgp",
                "ip_address": "88.***.***.102",
                "charge_mode": "bandwidth",
                "bandwidth_id": "bde3557e-****-****-****-629a3754ae07",
                "bandwidth_size": 300,
                "bandwidth_name": "vpngw-bandwidth-18bd",
            },
            "created_at": "2022-11-28T02:22:27.24Z",
            "updated_at": "2022-11-28T02:22:27.24Z",
            "access_vpc_id": "0cf79a3f-****-****-****-d7ace626b0fa",
            "access_subnet_id": "f5741286-****-****-****-2c82bd9ee114",
            "ha_mode": "active-active"
        }],
        "request_id": "de1b6caf-d024-4dac-850e-645af40c84f3"
    }
    2. 根据enterprise_project_id查询VPN网关的响应
    {
        "vpn_gateways": [{
            "id": "8e1d0686-****-****-****-91f32fa1dfc8",
            "name": "vpngw-1af3",
            "network_type": "public",
            "status": "ACTIVE",
            "attachment_type": "vpc",
            "vpc_id": "91a74241-****-****-****-9b5f98c66c8c",
            "local_subnets": ["192.168.15.0/24"],
            "connect_subnet": "f5741286-****-****-****-2c82bd9ee114",
            "bgp_asn": 64512,
            "flavor": "Professional1",
            "availability_zone_ids": ["cn-south-1f", "cn-south-1e"],
            "connection_number": 200,
            "used_connection_number": 0,
            "used_connection_group": 0,
            "enterprise_project_id": "7354dda9-****-****-****-a6b08fb92043",
            "eip1": {
                "id": "8ff5d6b5-****-****-****-b9d598033153",
                "ip_version": 4,
                "type": "5_bgp",
                "ip_address": "88.***.***.111",
                "charge_mode": "bandwidth",
                "bandwidth_id": "aa62f8f2-****-****-****-b05b2b999715",
                "bandwidth_size": 300,
                "bandwidth_name": "vpngw-bandwidth-13a3"
            },
            "eip2": {
                "id": "08e7e927-****-****-****-26a6394021eb",
                "ip_version": 4,
                "type": "5_bgp",
                "ip_address": "88.***.***.199",
                "charge_mode": "bandwidth",
                "bandwidth_id": "887d61f7-****-****-****-38ee8232e27c",
                "bandwidth_size": 300,
                "bandwidth_name": "vpngw-bandwidth-1afb"
            },
            "created_at": "2022-11-28T02:36:16.834Z",
            "updated_at": "2022-11-28T02:36:16.834Z",
            "access_vpc_id": "91a74241-****-****-****-9b5f98c66c8c",
            "access_subnet_id": "f5741286-****-****-****-2c82bd9ee114",
            "ha_mode": "active-active"
        }, {
            "id": "66ddeacb-****-****-****-9a414b5bd7d5",
            "name": "vpngw-2be4",
            "network_type": "private",
            "status": "ACTIVE",
            "attachment_type": "er",
            "er_id": "c62fad0d-****-****-****-e06c4c351b9f",
            "bgp_asn": 64512,
            "flavor": "Professional1",
            "availability_zone_ids": ["cn-south-1f", "cn-south-1e"],
            "connection_number": 200,
            "used_connection_number": 0,
            "used_connection_group": 0,
            "enterprise_project_id": "7354dda9-****-****-****-a6b08fb92043",
            "access_private_ips": [ "192.168.4.7", "192.168.4.99" ],
            "created_at": "2022-11-28T02:22:27.24Z",
            "updated_at": "2022-11-28T02:22:27.24Z",
            "access_vpc_id": "0cf79a3f-****-****-****-d7ace626b0fa",
            "access_subnet_id": "f5741286-****-****-****-2c82bd9ee114",
            "ha_mode": "active-active"
        }],
        "request_id": "bfa819a1-e824-4799-8e72-21a35dad97c9"
    }

状态码

请参见状态码

 

上一篇:扩容文件系统ExpandShare 下一篇:华为IdeaHub办公宝助巴西里约中国国际学校开启智慧教学

虚拟专用网络 VPN  

虚拟专用网络(Virtual Private Network)用于搭建用户本地数据中心与华为云VPC之间便捷、灵活,即开即用的IPsec加密连接通道,实现灵活一体,可伸缩的混合云计算环境。