Deleting Resource Pool Tags in Batches
Function
This API is used to delete multiple tags from a specified resource. It is used when administrators need to delete redundant tags (such as expired categories and invalid metadata), adjust resource classification policies, or remove tags in batches due to permission changes. Before calling this API, ensure that the target resource exists and can be managed, you have the required permissions to manage resource tags, the tags to be deleted have been associated with the resource, and TMS is running properly. After this API is called, the specified tags will be completely deleted from the resource, and other configuration attributes of the resource will not be affected. If the resource does not exist, you do not have the required permissions, the tags have not been associated with the resource, or the system service is abnormal, an error message (such as "404 Not Found", "403 Forbidden", "400 Bad Request", or "503 Service Unavailable") is returned.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, no identity policy-based permission required for calling this API.
URI
DELETE /v1/{project_id}/pools/{pool_name}/tags/delete
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition: Project ID. For details, see Obtaining a Project ID and Name. Constraints: The value can contain 1 to 64 characters. Only letters, digits, and hyphens (-) are allowed. Range: N/A Default Value: N/A |
| pool_name | Yes | String | Definition: Resource pool name. The value is obtained from name in the metadata field of the resource pool details. Constraints: N/A Range: N/A Default Value: N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| tags | Yes | Array of DeleteTagItem objects | Definition: Tags to be deleted. Constraints: N/A |
Response Parameters
Status code: 204
| Parameter | Type | Description |
|---|---|---|
| tags | Array of PoolTag objects | Definition: Resource tag list. |
| Parameter | Type | Description |
|---|---|---|
| key | String | Definition: Tag of the resource type. Range: N/A |
| values | Array of strings | Definition: Tag value of the resource type. |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Range: N/A |
| error_msg | String | Definition: Error message. Range: N/A |
Status code: 401
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Range: N/A |
| error_msg | String | Definition: Error message. Range: N/A |
Status code: 403
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Range: N/A |
| error_msg | String | Definition: Error message. Range: N/A |
Status code: 404
Example Requests
https://{endpoint}/v1/{project_id}/pools/a55eba18-1ebf-4e9a-8229-d2d3b593a3dc/tags/delete
{
"tags" : [ {
"key" : "dev",
"value" : "dev1"
} ]
} Example Responses
Status code: 204
Deleted.
{
"tags" : [ {
"key" : "dev",
"value" : "dev1"
} ]
} Status Codes
| Status Code | Description |
|---|---|
| 204 | Deleted. |
| 400 | Invalid parameter. |
| 401 | Authentication failed. |
| 403 | Insufficient permissions. |
| 404 | Resource not found. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot