doc-exports/docs/css/api-ref/css_03_0083.html
Zheng, Xiu 99a2d77599 css api 23.5.1 20240520
Reviewed-by: Kacur, Michal <michal.kacur@t-systems.com>
Co-authored-by: Zheng, Xiu <zhengxiu@huawei.com>
Co-committed-by: Zheng, Xiu <zhengxiu@huawei.com>
2024-06-07 17:47:08 +00:00

10 KiB

Adding Tags to a Cluster

Function

This API is used to add tags to a cluster. A cluster can have a maximum of 10 tags.

URI

POST /v1.0/{project_id}/css-cluster/{cluster_id}/tags
Table 1 Parameter description

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID For details, see Obtaining a Project ID and Name.

cluster_id

Yes

String

ID of the cluster to which a tag is to be added

Request

Table 2 tag field description

Parameter

Mandatory

Type

Description

key

Yes

String

Tag key. The value can contain up to 36 characters.

value

Yes

String

Tag value. The value contains up to 43 characters.

If value is not empty, delete tags by key/value. If value is empty, delete tags by key.

Response

None

Example

  • Example request
    POST /v1.0/458d905f22da49c39f609e3347d65723/css-cluster/4f3deec3-efa8-4598-bf91-560aad1377a3/tags
    {
        "tag": {
            "key": "DEV",
            "value": "DEV1"
        }
    }

  • Example response

    None

Status Codes

Table 3 describes the status code.

Table 3 Status codes

Status Code

Message

Description

400

BadRequest

Invalid request.

Modify the request instead of retrying.

404

NotFound

The requested resource cannot be found.

Modify the request instead of retrying.

204

OK

The request is processed.