Help Center/ Virtual Private Cloud/ API Reference/ APIs/ Security Group Tag Management/ Batch Deleting Tags from a Security Group
Updated on 2024-10-14 GMT+08:00

Batch Deleting Tags from a Security Group

Function

This API is used to delete multiple tags from a security group at a time.

This API is idempotent. During tag deletion, if some tags do not exist, the deletion is considered to be successful by default. The character set of the tags will not be checked. When you delete tags, the tag structure cannot be missing, and the key cannot be left blank or be an empty string.

URI

POST /v2.0/{project_id}/security-groups/{security_group_id}/tags/action

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID

security_group_id

Yes

String

Security Group ID

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

action

Yes

String

Operation

tags

Yes

Array of ResourceTag objects

Tag list

Table 3 ResourceTag

Parameter

Mandatory

Type

Description

key

Yes

String

Tag key.

The key must be unique for each resource.

Minimum: 0

Maximum: 36

value

Yes

String

Tag value

Minimum: 0

Maximum: 43

Response Parameters

Status code: 400

Table 4 Response body parameters

Parameter

Type

Description

code

String

Error code returned for a request.

message

String

Error message returned for a request.

Status code: 401

Table 5 Response body parameters

Parameter

Type

Description

code

String

Error code returned for a request.

message

String

Error message returned for a request.

Status code: 403

Table 6 Response body parameters

Parameter

Type

Description

code

String

Error code returned for a request.

message

String

Error message returned for a request.

Status code: 404

Table 7 Response body parameters

Parameter

Type

Description

code

String

Error code returned for a request.

message

String

Error message returned for a request.

Status code: 409

Table 8 Response body parameters

Parameter

Type

Description

code

String

Error code returned for a request.

message

String

Error message returned for a request.

Status code: 500

Table 9 Response body parameters

Parameter

Type

Description

code

String

Error code returned for a request.

message

String

Error message returned for a request.

Example Requests

  • example-1: Creating a tag

    POST https://{Endpoint}/v2.0/{project_id}/security-groups/{security_group_id}/tags/action
    
    {
      "action" : "create",
      "tags" : [ {
        "key" : "key1",
        "value" : "value1"
      }, {
        "key" : "key2",
        "value" : "value3"
      } ]
    }
  • example-2: Deleting a tag

    POST https://{Endpoint}/v2.0/{project_id}/security-groups/{security_group_id}/tags/action
    
    {
      "action" : "delete",
      "tags" : [ {
        "key" : "key1",
        "value" : "value1"
      }, {
        "key" : "key2",
        "value" : "value3"
      } ]
    }

Example Responses

None

Status Codes

Status Code

Description

204

Normal response.

400

The server failed to process the request.

401

Username and password are required to access the page requested.

403

You are forbidden to access the requested page.

404

The server could not find the requested page.

409

The request could not be processed due to a conflict.

500

Failed to complete the request because of an internal service error.

Error Codes

See Error Codes.