Updated on 2026-10-22 GMT+08:00

Querying a P2C VPN Gateway

Function

This API is used to query a P2C VPN gateway with a specified gateway ID.

Calling Method

For details, see Calling APIs.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

Action

Access Level

Resource Type (*: required)

Condition Key

Alias

Dependencies

vpn:p2cVpnGateway:get

read

p2cVpnGateway

-

-

URI

GET /v5/{project_id}/p2c-vpn-gateways/{p2c_vgw_id}

Table 1 Parameter description

Parameter

Type

Mandatory

Description

project_id

String

Yes

Specifies a project ID. You can obtain the project ID by referring to Obtaining the Project ID.

p2c_vgw_id

String

Yes

Specifies the ID of a P2C VPN gateway instance.

Request

  • Request parameters

    None

  • Example request
    GET https://{Endpoint}/v5/{project_id}/p2c-vpn-gateways/{p2c_vgw_id}

Response

  • Response parameters

    Returned status code 200: successful query

    Table 2 Parameters in the response body

    Parameter

    Type

    Description

    p2c_vpn_gateway

    p2c_vpn_gateway

    object

    Specifies the VPN gateway object.

    request_id

    String

    Specifies a request ID.

    Table 3 p2c_vpn_gateway

    Parameter

    Type

    Description

    id

    String

    • Specifies the ID of a P2C VPN gateway.
    • The value is a UUID containing 36 characters.

    name

    String

    • Specifies the name of a P2C VPN gateway.
    • The value is a string of 1 to 64 characters, which can contain digits, letters, underscores (_), and hyphens (-).

    status

    String

    • Specifies the status of the P2C VPN gateway.
    • Value range:

      PENDING_CREATE: creating

      PENDING_UPDATE: updating

      PENDING_DELETE: deleting

      UPGRADING: upgrading

      ROLLING_BACK: rolling back

      PENDING_UPGRADE_CONFIRM: upgrade to be committed

      ACTIVE: normal

      FAULT: abnormal

      FROZEN: frozen

    vpc_id

    String

    Specifies the ID of the VPC to which the P2C VPN gateway connects.

    connect_subnet

    String

    Specifies the ID of the VPC subnet used by the P2C VPN gateway.

    flavor

    String

    • Specifies the specification of the P2C VPN gateway.
    • Value range:

      Professional1

    availability_zone_ids

    Array of strings

    Specifies the list of AZs.

    eip

    ResponseEipInfo

    object

    Indicates information about the EIP bound to the gateway.

    max_connection_number

    Integer

    • Specifies the maximum number of concurrent online client connections.
    • Value range: 1–500

    current_connection_number

    Integer

    Specifies the number of current client connections.

    enterprise_project_id

    string

    Specifies an enterprise project ID.

    tags

    Array of VpnResourceTag

    objects

    Specifies a tag list.

    order_id

    String

    Specifies an order ID.

    admin_state_up

    Boolean

    • Specifies the frozen status.
    • Value range:

      true: not frozen

      false: frozen

    frozen_effect

    Integer

    • Specifies whether a frozen resource can be deleted.
    • Value range:

      0: A resource is not frozen.

      1: A resource can be deleted after being frozen.

      2: A resource cannot be deleted after being frozen.

    version

    string

    • Specifies the gateway version.

    upgrade_info

    string

    • Specifies upgrade information.
    • Value range:
      • ready
      • expiring soon
      • unready

    created_at

    String

    • Specifies the creation time.
    • The UTC time format is yyyy-MM-ddTHH:mm:ss.SSSZ.

    applied_at

    String

    • Specifies the time when the VPN gateway takes effect.
    • The UTC time format is yyyy-MM-ddTHH:mm:ss.SSSZ.

    updated_at

    String

    • Specifies the last update time.
    • The UTC time format is yyyy-MM-ddTHH:mm:ss.SSSZ.
    Table 4 ResponseEipInfo

    Parameter

    Type

    Description

    id

    String

    • Specifies an EIP ID.
    • The value is a UUID containing 36 characters.

    ip_version

    Integer

    • Specifies the EIP version.
    • The value can only be 4, indicating IPv4 address.

    ip_billing_info

    String

    • Specifies the EIP order information. This parameter is available only for yearly/monthly EIPs, but not for pay-per-use EIPs.
    • The value is in the format of order_id:product_id:region_id:project_id, for example:

      CS22********LIBIV:00301-******-0--0:br-iaas-odin1:0605768a************c006c7e484aa

    type

    String

    • Specifies the EIP type.
    • The value can be 5_bgp (dynamic BGP), 5_sbgp (static BGP), or 5_youxuanbgp (premium BGP).

      For the value range, see the type field in Table 6 in Assigning an EIP.

    ip_address

    String

    • Specifies an EIP, that is, a public IPv4 address.
    • The value is an IPv4 address, for example, 88.***.***.11.

    charge_mode

    String

    • Specifies the EIP bandwidth billing mode.

    bandwidth_id

    String

    • Specifies an EIP bandwidth ID.
    • The value is a UUID containing 36 characters.

    bandwidth_size

    Integer

    • Specifies the bandwidth (Mbit/s) of an EIP. The maximum EIP bandwidth varies according to regions and depends on the EIP service. You can submit a service ticket to increase the maximum EIP bandwidth under your account.
    • The value ranges from 1 to 1000. For details, see the EIP documentation.

    bandwidth_name

    String

    • Specifies an EIP bandwidth name.
    • The value is a string of 1 to 64 characters, which can contain digits, letters, underscores (_), hyphens (-), and periods (.).

    bandwidth_billing_info

    String

    • Specifies the EIP bandwidth order information. This parameter is available only for yearly/monthly EIPs, but not for pay-per-use EIPs.
    • The value is in the format of order_id:product_id:region_id:project_id, for example:

      CS22********LIBIV:00301-******-0--0:br-iaas-odin1:0605768a************c006c7e484aa

    share_type

    String

    • Specifies the bandwidth type.
    • Value range:

      PER: dedicated bandwidth

    Table 5 VpnResourceTag

    Parameter

    Type

    Description

    key

    String

    • Specifies a tag key.
    • The value is a string of 1 to 128 characters, which can contain letters, digits, spaces, and the following special characters: _ . : = + - @. However, the value cannot start or end with a space or start with _sys_.

    value

    String

    • Specifies a tag value.
    • The value is a string of 0 to 255 characters, which can contain letters, digits, spaces, and the following special characters: _ . : / = + - @.
  • Example response
    {
        "p2c_vpn_gateway": {
            "id": "6d526e5f-a0c6-44b6-a785-000000000000",
            "name": "p2c-vpngw-0000",
            "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": "CS**********JWT1O",
            "admin_state_up": true,
            "frozen_effect": 0,
            "created_at": "2024-06-14T10:24:12.147Z",
            "updated_at": "2024-06-14T10:24:12.147Z"
        },
        "request_id": "2ddd2f6107a8164ce6f6268bd991e57c"
    }

Status Codes

For details, see Status Codes.