Add or delete tags for a specified resource in batches.
You can add up to 20 tags to a resource.
The API is idempotent.
If a to-be-created tag has the same key as an existing tag, the tag will be created and overwrite the existing one.
POST /v2/{project_id}/{resource_type}/{resource_id}/tags/action
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
project_id |
Yes |
String |
Project ID. You can obtain it in Obtaining a Project ID. |
resource_type |
Yes |
String |
Resource type.
|
resource_id |
Yes |
String |
Resource ID |
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
tags |
Yes |
Array of object |
Tag list. The tag list structure cannot be empty when you delete tags. For details, see Table 3. |
action |
Yes |
String |
Operation, which can be create or delete (case sensitive) |
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
key |
Yes |
String |
Tag key
|
value |
No |
String |
Tag value
|
POST https://{DNS_Endpoint}/v2/{project_id}/DNS-private_zone/ff8080825b8fc86c015b94bc6f8712c3/tags/action
{
"action": "create",
"tags": [
{
"key": "key1",
"value": "value1"
},
{
"key": "key2",
"value": "value2"
}
]
}
or
{
"action": "delete",
"tags": [
{
"key": "key1",
"value": "value1"
},
{
"key": "key2",
"value": "value2"
}
]
}
None
If a 2xx status code is returned, for example, 200, 202, or 204, the request is successful.
For details, see Status Code.