Updated on 2025-05-06 GMT+08:00

Deleting Image Tags in a Batch

Function

This API is used to batch delete tags from a specified image.

Constraints

  • This API is idempotent. If any tag does not exist, it is considered as deleted by default.
  • The system does not check characters of keys and values. A key cannot be left blank or be an empty string. Values are optional for keys. If a tag to be deleted does not exist, the system considers that it has been deleted. No error will be reported. The system will check key and value lengths. A key can contain a maximum of 127 characters, and a value can contain a maximum of 255 characters.

URI

DELETE /v1/{project_id}/cloudimages/{image_id}/tags/delete

Table 1 lists the parameters in the URI.
Table 1 Parameter description

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the project ID.

image_id

Yes

String

Specifies the image ID.

Request

  • Request parameters

    Parameter

    Mandatory

    Type

    Description

    tags

    Yes

    Array of objects

    Lists the tags to be deleted. For details, see Table 2.

    Table 2 Data structure description of the tags field

    Parameter

    Mandatory

    Type

    Description

    key

    Yes

    String

    Specifies the tag key. The tag key cannot be left blank.

    value

    Yes

    String

    Specifies the tag value.

Example Request

Deleting image tags (key1:value1, key2:value2)
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
DELETE https://{Endpoint}/v1/fd73a4a14a4a4dfb9771a8475e5198ea/cloudimages/67e17426-359e-49fb-aa12-0bd1756ec240/tags/delete
{
   "tags": [
{
      "value": "value1",
      "key": "key1"
   },
   {
      "value": "value2",
      "key": "key2"
   },
   {
      "key": "key3",
      "value": ""
   }
]
}

Response

  • Response parameters

    None

  • Example response
    STATUS CODE 204

Returned Values

  • Normal

    204

  • Abnormal

    Returned Value

    Description

    400 Bad Request

    Request error.

    401 Unauthorized

    Authentication failed.

    403 Forbidden

    No operation permissions.

    404 Not Found

    Resource not found.

    500 Internal Server Error

    Internal service error.

    503 Service Unavailable

    Service unavailable.