This API is used to add a resource tag for a resource. A maximum of 10 tags can be added for one resource.
POST /v1.0/{project_id}/clusters/{resource_id}/tags
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details about how to obtain the project ID, see Obtaining a Project ID. |
resource_id |
Yes |
String |
Resource ID. Currently, you can only add tags to a cluster, so specify this parameter to the cluster ID. |
POST /v1.0/89cd04f168b84af6be287f71730fdb4b/clusters/7d85f602-a948-4a30-afd4-e84f47471c15/tags { "tag": { "key":"Flower", "value":"rose" } }
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
tag |
Yes |
tag object |
Tags. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
key |
Yes |
String |
Tag key. A tag key can contain a maximum of 36 Unicode characters, which cannot be null. The first and last characters cannot be spaces. It can contain uppercase letters (A to Z), lowercase letters (a to z), digits (0-9), hyphens (-), and underscores (_). |
value |
Yes |
String |
Key value. A tag value can contain a maximum of 43 Unicode characters, which can be null. The first and last characters cannot be spaces. It can contain uppercase letters (A to Z), lowercase letters (a to z), digits (0-9), hyphens (-), and underscores (_). |
Example response
status CODE 204
Returned Value |
Description |
---|---|
204 |
No Content |
Returned Value |
Description |
---|---|
400 |
Invalid tag. |
401 |
Authentication failed. |
403 |
You do not have the permission to perform the operation. |
404 |
The requested resource was not found. |
500 |
Internal service error. |