Help Center> Bare Metal Server> API Reference> BMS APIs> Tag Management> Deleting Tags from a BMS in Batches
Updated on 2023-10-18 GMT+08:00

Deleting Tags from a BMS in Batches

Function

  • This API is used to delete tags from a specified BMS in batches.
  • TMS uses this API to manage BMS tags.

This is an idempotent API. When you delete a tag but the tag does not exist, a successful result will be returned.

Restrictions and Limitations

A BMS can have a maximum of 20 tags.

URI

POST /v1/{project_id}/baremetalservers/{server_id}/tags/action

Table 1 lists the parameters.

Table 1 Parameter description

Parameter

Type

Mandatory

Description

project_id

String

Yes

Specifies the project ID.

server_id

String

Yes

Specifies the BMS ID.

Request Parameters

Parameter

Type

Mandatory

Description

tags

List <resource_tag>

Yes

Specifies the tag list. For details, see Table 2.

action

String

Yes

Specifies the operation (only lowercase letters are supported). For example, delete indicates the deletion operation.

Table 2 tags field data structure description

Parameter

Type

Mandatory

Description

key

String

Yes

Specifies the tag key.

  • It contains a maximum of 127 Unicode characters and cannot be empty.

value

String

No

Specifies the tag value.

  • Each value contains a maximum of 255 Unicode characters and can be an empty string.
  • It cannot contain ASCII characters (0–31) or special characters =*<>\,|/

Example Request

Deleting two tags (key1: value1, key2:value3) from a BMS
{
    "action": "delete",
    "tags": [
        {
            "key": "key1",
            "value": "value1"
        },
        {
            "key": "key2",
            "value": "value3"
        }
    ]
}

Response Message

None

Returned Values

  • Normal

    Returned Values

    Description

    204

    No Content

  • Abnormal

    Returned Values

    Description

    400

    Invalid tag.

    401

    Authentication failed.

    403

    Insufficient permission.

    404

    The requested resource was not found.

    500

    A system exception occurred.