Updated on 2024-07-29 GMT+08:00

Querying the VPN User Group List

Function

This API is used to query the list of user groups on a specified server.

Calling Method

For details, see Calling APIs.

URI

GET /v5/{project_id}/p2c-vpn-gateways/vpn-servers/{vpn_server_id}/groups

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.

vpn_server_id

String

Yes

Specifies the ID of a VPN server.

Table 2 Parameter in a query request

Parameter

Type

Mandatory

Description

limit

Integer

No

Specifies the number of records returned on each page during pagination query.

marker

String

No

  • Specifies the start flag for querying the current page. If this parameter is left blank, the first page is queried. The marker for querying the next page is the next_marker in the page_info object returned on the current page.
  • This parameter must be used together with limit.

Request

  • Request parameters

    None

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

Response

  • Response parameters

    Returned status code 200: successful query

    Table 3 Parameters in the response body

    Parameter

    Type

    Description

    user_groups

    Array of VpnUserGroup objects

    Specifies the user group list object.

    total_count

    Integer

    Specifies the total number of user groups.

    page_info

    PageInfo object

    Specifies pagination query information.

    request_id

    String

    Specifies a request ID.

    Table 4 VpnUserGroup

    Parameter

    Type

    Description

    id

    String

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

    name

    String

    Specifies the name of a user group.

    description

    String

    Specifies user group description.

    type

    String

    • Specifies the type of a user group.
    • Value range:

      Default: default user group

      Custom: custom user group

    user_number

    Integer

    Specifies the number of users.

    created_at

    String

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

    updated_at

    String

    • Specifies the update time.
    • The UTC time format is yyyy-MM-ddTHH:mm:ssZ.
    Table 5 PageInfo

    Parameter

    Type

    Description

    next_marker

    String

    Specifies the marker of the next page. The value is the time when the last resource in the last query response was created.

    current_count

    Integer

    Specifies the number of resources in the list.

    • Example response
      {
          "user_groups": [
              {
                  "id": "7625fd92-2e20-4e4d-8c56-66f110fbfaa8",
                  "name": "user-group1",
                  "description": "UserGroup1",
                  "type": "Custom",
                  "user_number": 0,
                  "created_at": "2024-06-17T09:48:27.548Z",
                  "updated_at": "2024-06-17T09:48:27.548Z"
              },
              {
                  "id": "0748b24e-cbd3-474e-9546-8586e8f2b5c6",
                  "name": "default",
                  "description": "Default user group",
                  "type": "Default",
                  "user_number": 0,
                  "created_at": "2024-06-17T03:45:25.879Z",
                  "updated_at": "2024-06-17T03:45:25.879Z"
              }
          ],
          "total_count": 2,
          "page_info": {
              "next_marker": null,
              "current_count": 2
          },
          "request_id": "1ae5c7648497d3d90824985367da954a"
      }

Status Codes

For details, see Status Codes.