• Workspace

workspace
  1. Help Center
  2. Workspace
  3. API Reference
  4. Desktop Tags
  5. Creating Desktop Tags

Creating Desktop Tags

Function

This interface is used to create tags for desktops with up to 10 tags on a single desktop. If a tag to be created has the same key as an existing tag, the newly created tag will overwrite the existing one.

URI

  • URI format

    POST /v1.0/{project_id}/workspace/{desktop_id}/tags

  • URI parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    string

    Specifies the user ID.

    desktop_id

    Yes

    string

    Specifies the desktop ID.

Request

  • Request body parameter description

    Parameter

    Mandatory

    Type

    Description

    tag

    Yes

    List data structure [1]

    Specifies the tag information.

[1] Data structure of the tag field

Parameter

Mandatory

Type

Description

key

Yes

string

Specifies the key of a tag that cannot be empty and can contain a maximum of 36 unicode characters. The characters of a tag value may contain uppercase letters, lowercase letters, digits, hyphens (-), and underscores (_).

value

No

string

Specifies the value of the tag that has a maximum length of 43 unicode characters, including uppercase and lowercase letters, digits, hyphens (-), and underscores (_).

  • Request example
    POST /v1.0/9c53a566cb3443ab910cf0daebca90c4/workspace/8e07d3e9-454e-4fc9-ba56-c631d05c4712/tags
    Request Body:
    {
    "tag":
    {
    "key": "ENV"
    "value":"DEV"
    }
    }

Response

No response body

Returned Values

  • Normal

    204

  • Abnormal

    Returned Value

    Description

    400 Bad Request

    The request syntax is incorrect and cannot be understood by the server.

    401 Unauthorized

    Authentication fails.

    403 Forbidden

    You are not authorized to perform the operation.

    404 Not Found

    The requested resource is not found.

    405 Method Not Allowed

    The method specified in the request is not allowed.

    500 Internal Server Error

    Internal service error. For details about error codes, see Error Code Description.

    503 Service Unavailable

    The service is unavailable.