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

Modifying a VPN User

Function

This API is used to modify a VPN user with a specified ID.

Calling Method

For details, see Calling APIs.

URI

PUT /v5/{project_id}/p2c-vpn-gateways/vpn-servers/{vpn_server_id}/users/{user_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.

vpn_server_id

String

Yes

Specifies the ID of a VPN server.

user_id

String

Yes

Specifies a user ID.

Request

  • Request parameters
    Table 2 Request parameters

    Parameter

    Type

    Mandatory

    Description

    user

    UpdateVpnUserRequestBodyContent object

    Yes

    Specifies the to-be-modified VPN user object.

    Table 3 UpdateVpnUserRequestBodyContent

    Parameter

    Type

    Mandatory

    Description

    description

    String

    No

    • Specifies user description.
    • The value is a string of 0 to 64 characters, which can contain letters, digits, and underscores (_).

    user_group_id

    String

    No

    • Specifies the ID of the user group to which the user belongs.
    • The value is a UUID containing 36 characters.
  • Example request
    PUT https://{Endpoint}/v5/{project_id}/p2c-vpn-gateways/vpn-servers/{vpn_server_id}/users/{user_id}
    
    {
      "user": {
        "description": "UserDescription-update",
        "user_group_id": "PTnsQAbZ-KOgW-mCzt-C9Sk-rMM3TcNjQ8wY"
      }
    }

Response

  • Response parameters

    Returned status code 200: successful operation

    Table 4 Parameters in the response body

    Parameter

    Type

    Description

    user

    VpnUser object

    Specifies the VPN user object.

    request_id

    String

    Specifies a request ID.

    Table 5 VpnUser

    Parameter

    Type

    Description

    id

    String

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

    name

    String

    Specifies a username.

    description

    String

    Specifies user description.

    user_group_id

    String

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

    user_group_name

    String

    Specifies the name of the user group to which the user belongs.

    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.
    • Example response
      {
          "user": {
              "id": "41ad472e-d3e4-482b-8f00-7b2c1bfc4b7d",
              "name": "1111",
              "description": "UserDescription-update",
              "user_group_id": "PTnsQAbZ-KOgW-mCzt-C9Sk-rMM3TcNjQ8wY",
              "user_group_name": "user-group2",
              "created_at": "2024-06-17T06:53:46.302Z",
              "updated_at": "2024-06-17T08:45:20.973Z"
          },
          "request_id": "380562b4bda6dfe116c42e707d8e9110"
      }

Status Codes

For details, see Status Codes.