Deleting Tags in Batches
Function
This API is used to delete tags from multiple resources of a cloud service in batches. A maximum of 10 tags can be deleted from one resource. Tags of up to 50 resources can be deleted at a time.
Calling Method
For details, see Calling APIs.
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
POST /v1.0/resource-tags/batch-delete
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Specifies the user token. TMS is a global service. When calling the Identity and Access Management (IAM) API to obtain a user token, set the scope field to domain. The value of X-Subject-Token in the response header is the user token. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
No |
String |
Specifies the project ID. This parameter is mandatory when resource_type is a region-specific service. |
|
resources |
Yes |
Array of ResourceTagBody objects |
Specifies the resource list. |
|
tags |
Yes |
Array of DeleteTagRequest objects |
Specifies tags. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
resource_id |
Yes |
String |
Specifies the resource ID. |
|
resource_type |
Yes |
String |
Specifies the resource type. This parameter is case-sensitive. Examples include: ecs, scaling_group, images, disk,vpcs, security-groups, shared_bandwidth, eip, and cdn. For more details, see "Querying Service Supported by TMS". |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
key |
Yes |
String |
Specifies the tag key. The value can contain up to 36 characters including letters, digits, hyphens (-), and underscores (_). |
|
value |
No |
String |
Specifies a tag value. A tag value can contain a maximum of 43 characters and can contain letters (A-Z and a-z), digits (0-9), periods (.), hyphens (-), underscores (_), and Unicode characters (\u4E00-\u9FFF). |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
failed_resources |
Array of TagDeleteResponseItem objects |
Specifies resources whose tags failed to be deleted. |
|
Parameter |
Type |
Description |
|---|---|---|
|
resource_id |
String |
Specifies the resource ID. |
|
resource_type |
String |
Specifies the resource type. |
|
error_code |
String |
Specifies the error code. |
|
error_msg |
String |
Specifies the error message. |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error |
RespErrorMessage object |
Response error information. |
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Request error code |
|
error_msg |
String |
Error message |
Status code: 401
|
Parameter |
Type |
Description |
|---|---|---|
|
error |
RespErrorMessage object |
Response error information. |
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Request error code |
|
error_msg |
String |
Error message |
Status code: 403
|
Parameter |
Type |
Description |
|---|---|---|
|
error |
RespErrorMessage object |
Response error information. |
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Request error code |
|
error_msg |
String |
Error message |
Status code: 404
|
Parameter |
Type |
Description |
|---|---|---|
|
error |
RespErrorMessage object |
Response error information. |
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Request error code |
|
error_msg |
String |
Error message |
Status code: 405
|
Parameter |
Type |
Description |
|---|---|---|
|
error |
RespErrorMessage object |
Response error information. |
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Request error code |
|
error_msg |
String |
Error message |
Status code: 406
|
Parameter |
Type |
Description |
|---|---|---|
|
error |
RespErrorMessage object |
Response error information. |
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Request error code |
|
error_msg |
String |
Error message |
Status code: 409
|
Parameter |
Type |
Description |
|---|---|---|
|
error |
RespErrorMessage object |
Response error information. |
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Request error code |
|
error_msg |
String |
Error message |
Status code: 410
|
Parameter |
Type |
Description |
|---|---|---|
|
error |
RespErrorMessage object |
Response error information. |
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Request error code |
|
error_msg |
String |
Error message |
Status code: 412
|
Parameter |
Type |
Description |
|---|---|---|
|
error |
RespErrorMessage object |
Response error information. |
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Request error code |
|
error_msg |
String |
Error message |
Status code: 429
|
Parameter |
Type |
Description |
|---|---|---|
|
error |
RespErrorMessage object |
Response error information. |
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Request error code |
|
error_msg |
String |
Error message |
Status code: 500
|
Parameter |
Type |
Description |
|---|---|---|
|
error |
RespErrorMessage object |
Response error information. |
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Request error code |
|
error_msg |
String |
Error message |
Status code: 501
|
Parameter |
Type |
Description |
|---|---|---|
|
error |
RespErrorMessage object |
Response error information. |
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Request error code |
|
error_msg |
String |
Error message |
Status code: 503
|
Parameter |
Type |
Description |
|---|---|---|
|
error |
RespErrorMessage object |
Response error information. |
Example Requests
Deleting tags in batches
POST https://{Endpoint}/v1.0/resource-tags/batch-delete
{
"project_id" : "xxxdcffffffff",
"resources" : [ {
"resource_id" : "a28531fa-a8d5-468e-8417-86a80962ee5e",
"resource_type" : "disk"
}, {
"resource_id" : "vpc-dc7d19b7",
"resource_type" : "vpc"
} ],
"tags" : [ {
"key" : "ENV"
} ]
}
Example Responses
Status code: 200
Success
{
"failed_resources" : [ {
"resource_id" : "e1eb7c40cbea4c8389cde527594a306d",
"resource_type" : "disk",
"error_code" : "TMS.0002",
"error_msg" : "Bad request"
} ]
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Success |
|
400 |
Bad Request |
|
401 |
Unauthorized |
|
403 |
Forbidden |
|
404 |
Not Found |
|
405 |
Method Not Allowed |
|
406 |
Not Acceptable |
|
409 |
Conflict |
|
410 |
Gone |
|
412 |
Precondition Failed |
|
429 |
Too Many Requests |
|
500 |
Internal Server Error |
|
501 |
Not Implemented |
|
503 |
Service Unavailable |
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.