Help Center/ Virtual Private Network/ API Reference/ API/ P2C VPN APIs/ Server/ Querying All VPN Servers of a Tenant
Updated on 2024-07-29 GMT+08:00

Querying All VPN Servers of a Tenant

Function

This API is used to query all VPN servers of a tenant.

Calling Method

For details, see Calling APIs.

URI

GET /v5/{project_id}/vpn-servers

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.

Request

  • Request parameters

    None

  • Example request
    GET https://{Endpoint}/v5/{project_id}/vpn-servers

Response

  • Response parameters

    Returned status code 200: successful query

    Table 2 Parameters in the response body

    Parameter

    Type

    Description

    vpn_servers

    Array of ShowServerResponse objects

    Specifies VPN server information.

    request_id

    String

    Specifies a request ID.

    Table 3 ShowServerResponse

    Parameter

    Type

    Description

    id

    String

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

    p2c_vgw_id

    String

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

    client_cidr

    String

    • Specifies a client CIDR block. A virtual IP address on this CIDR block will be assigned to a client for establishing a connection.
    • The value is in the format of dotted decimal notation/mask, for example, 192.168.1.0/24.

    local_subnets

    Array of strings

    • Specifies the list of local CIDR blocks.
    • The value is in the format of dotted decimal notation/mask, for example, 10.10.1.0/24.

    client_auth_type

    String

    • Specifies the client authentication mode.
    • Value range:

      CERT: certificate authentication

      LOCAL_PASSWORD: password authentication (local)

    tunnel_protocol

    String

    • Specifies a tunnel protocol.
    • Value range:

      SSL

    server_certificate

    server_certificate object

    Specifies server certificate information.

    client_ca_certificates

    Array of QueryClientCaCertificateBody objects

    Specifies the list of client CA certificates, which are used to authenticate client certificates.

    ssl_options

    ssl_options object

    Specifies SSL options.

    status

    String

    • Specifies the server status.
    • Value range:

      PENDING_CREATE: creating

      PENDING_UPDATE: updating

      ACTIVE: normal

      FAULT: abnormal

      FROZEN: frozen

    created_at

    String

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

    updated_at

    String

    • Specifies the last update time.
    • The UTC time format is yyyy-MM-ddTHH:mm:ssZ.
    Table 4 server_certificate

    Parameter

    Type

    Description

    id

    String

    Specifies a certificate ID, which is the ID of a certificated uploaded in the CCM. This parameter is left empty if the certificate is deleted from the CCM.

    name

    String

    Specifies a certificate name, which is the name of a certificated uploaded in the CCM.

    issuer

    String

    • Specifies the issuer of a certificate.
    • The value is a string of 1 to 256 characters.

    subject

    String

    • Specifies the subject of a certificate.
    • The value is a string of 1 to 256 characters.

    serial_number

    String

    • Specifies the serial number of a certificate.
    • The value is a string of 1 to 64 characters.

    expiration_time

    String

    • Specifies the expiration time.
    • The UTC time format is yyyy-MM-ddTHH:mm:ssZ.

    signature_algorithm

    String

    • Specifies the signature algorithm of a certificate.
    • The value is a string of 1 to 64 characters.
    Table 5 QueryClientCaCertificateBody

    Parameter

    Type

    Description

    id

    String

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

    name

    String

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

    issuer

    String

    • Specifies the issuer of a certificate.
    • The value is a string of 1 to 256 characters.

    subject

    String

    • Specifies the subject of a certificate.
    • The value is a string of 1 to 256 characters.

    serial_number

    String

    • Specifies the serial number of a CA certificate.
    • The value is a string of 1 to 64 characters.

    expiration_time

    String

    • Specifies the expiration time of a certificate.
    • The UTC time format is yyyy-MM-ddTHH:mm:ssZ.

    signature_algorithm

    String

    • Specifies the signature algorithm of a certificate.
    • The value is a string of 1 to 64 characters.

    created_at

    String

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

    updated_at

    String

    • Specifies the last update time.
    • The UTC time format is yyyy-MM-ddTHH:mm:ssZ.
    Table 6 ssl_options

    Parameter

    Type

    Description

    protocol

    string

    • Specifies a protocol.
    • Value range:
      • TCP

    port

    integer

    • Specifies a port number.
    • Value range:
      • 443
      • 1194

    encryption_algorithm

    string

    • Specifies an encryption algorithm.
    • Value range:
      • AES-128-GCM
      • AES-256-GCM

    authentication_algorithm

    string

    • Specifies an authentication algorithm.
    • Value range:
      • SHA256
      • SHA384

    is_compressed

    boolean

    • Specifies whether to compress data. By default, data is not compressed.
    • Value range:
      • true
      • false
    • Example response
      {
          "vpn_servers": [
              {
                  "id": "3f7e48ca-cd3c-4ce2-a277-674382ce44ea",
                  "p2c_vgw_id": "10d176c7-aed8-4766-9180-a47e536c64d0",
                  "client_cidr": "173.16.1.0/24",
                  "local_subnets": [
                      "172.16.0.0/24",
                      "172.16.1.0/24"
                  ],
                  "client_auth_type": "CERT",
                  "tunnel_protocol": "SSL",
                  "server_certificate": {
                      "id": "scs1698803781642",
                      "name": "p2cvpn_test",
                      "issuer": "CN=p2cvpn.test",
                      "subject": "CN=p2cvpn.server",
                      "serial_number": "109258411809374886820602321558250159914",
                      "expiration_time": "2026-01-22T06:26:18Z",
                      "signature_algorithm": "SHA256WITHRSA"
                  },
                  "client_ca_certificates": [
                      {
                          "id": "2f291995-9582-4ce8-a7f4-e1b7742e6e0c",
                          "name": "client_ca_sdk_test_1",
                          "issuer": "CN=p2cvpn.test",
                          "subject": "CN=p2cvpn.test",
                          "serial_number": "218730615113252363388323617489459159151767515623",
                          "expiration_time": "2033-10-17T06:21:25Z",
                          "signature_algorithm": "SHA256WITHRSA",
                          "created_at": "2024-06-15T01:59:46.612Z",
                          "updated_at": "2024-06-15T01:59:46.612Z"
                      }
                  ],
                  "ssl_options": {
                      "protocol": "TCP",
                      "port": 443,
                      "encryption_algorithm": "AES-128-GCM",
                      "authentication_algorithm": "SHA256",
                      "is_compressed": false
                  },
                  "status": "ACTIVE",
                  "created_at": "2024-06-15T01:59:46.612Z",
                  "updated_at": "2024-06-15T02:01:16.606Z"
              },
              {
                  "id": "3840e9ea-84be-4ff9-ad26-817829ba16ed",
                  "p2c_vgw_id": "30dfb9cd-eeb0-4937-a7a5-4bc08184090b",
                  "client_cidr": "173.17.0.0/24",
                  "local_subnets": [
                      "172.16.0.0/24",
                      "172.16.1.0/24"
                  ],
                  "client_auth_type": "LOCAL_PASSWORD",
                  "tunnel_protocol": "SSL",
                  "server_certificate": {
                      "id": "scs1698803781642",
                      "name": "p2cvpn_test",
                      "issuer": "CN=p2cvpn.test",
                      "subject": "CN=p2cvpn.server",
                      "serial_number": "109258411809374886820602321558250159914",
                      "expiration_time": "2026-01-22T06:26:18Z",
                      "signature_algorithm": "SHA256WITHRSA"
                  },
                  "client_ca_certificates": [],
                  "ssl_options": {
                      "protocol": "TCP",
                      "port": 443,
                      "encryption_algorithm": "AES-128-GCM",
                      "authentication_algorithm": "SHA256",
                      "is_compressed": false
                  },
                  "status": "ACTIVE",
                  "created_at": "2024-06-15T02:01:19.87Z",
                  "updated_at": "2024-06-15T02:01:19.87Z"
              }
          ],
          "request_id": "2b16014544fff455b50ef3f1e62bbe35"
      }

Status Codes

For details, see Status Codes.