Updated on 2024-12-03 GMT+08:00

Creating a VPN User Group

Function

This API is used to create a VPN user group on a specified VPN server.

Calling Method

For details, see Calling APIs.

URI

POST /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 Parameters in the request header

Parameter

Type

Mandatory

Description

X-Client-Token

String

No

  • Specifies the ID of an idempotent request.
  • The value is a UUID containing 36 characters.

Request

  • Request parameters
    Table 3 Request parameters

    Parameter

    Type

    Mandatory

    Description

    user_group

    CreateVpnUserGroupRequestBodyContent object

    Yes

    Specifies the to-be-created VPN user group object.

    Table 4 CreateVpnUserGroupRequestBodyContent

    Parameter

    Type

    Mandatory

    Description

    name

    String

    Yes

    • Specifies a user group name.
    • The value is a string of 1 to 64 characters, which can contain letters, digits, underscores (_), and hyphens (-).
    • A user group name must be unique.

    description

    String

    No

    • Specifies user group description.
    • The value is a string of 0 to 64 characters, which can contain uppercase letters, lowercase letters, digits, and the following special characters: `~!@#$%^&*()-_=+\|[{}];:'",<.>/?
    • Example request
      POST https://{Endpoint}/v5/{project_id}/p2c-vpn-gateways/vpn-servers/{vpn_server_id}/groups 
      
      {
        "user_group": {
          "name": "user-group1",
          "description": "UserGroup1"
        }
      }

Response

  • Response parameters

    Returned status code 201: successful operation

    Table 5 Parameters in the response body

    Parameter

    Type

    Description

    user_group

    user_group object

    Specifies the user group object.

    request_id

    String

    Specifies a request ID.

    Table 6 user_group

    Parameter

    Type

    Description

    id

    String

    • Specifies the ID of a VPN user group.
    • The value is a UUID containing 36 characters.
  • Example response
    {
        "user_group": {
            "id": "7625fd92-2e20-4e4d-8c56-66f110fbfaa8"
        },
        "request_id": "94d271493e144135423e7377e40127cf"
    }

Status Codes

For details, see Status Codes.