• Image Management Service

ims
  1. Help Center
  2. Image Management Service
  3. API Reference
  4. APIs
  5. Image Tagging (Extension APIs)
  6. Adding or Modifying a Tag

Adding or Modifying a Tag

Function

This API is used to add a tag to an image or modify a tag of an image. With tags, you can manage easily the images.

URI

  • URI format

    PUT /v1/cloudimages/tags

Request

Table 1 Parameter description

Parameter

Mandatory

Type

Description

image_id

Yes

String

Specifies the image ID.

tag

Yes

String

Specifies the tag.

Use either tag or image_tag.

image_tag

Yes

Map

Lists the image tags. For detailed description, see Image Tag Data Formats. This parameter is left blank by default.

Use either tag or image_tag.

  • Example request containing parameter tag
    PUT /v1/cloudimages/tags
    {
     "image_id" : "62a15f6c-9197-44d2-89c7-708981c1bec1",
     "tag" : "aaaa.1111"
    }
  • Example request containing parameter image_tag
    PUT /v1/cloudimages/tags
    {
     "image_id":"67437ebd-2563-46e0-887e-ad1923977fa1",
     "image_tag":{"key":"key1","value":"value1"}
    }

Response

STATUS CODE 204

Returned Values

  • Normal

    204

  • Abnormal

Return Value

Description

400 Bad Request

Request error.

401 Unauthorized

Authentication failed.

403 Forbidden

You do not have the rights to perform the operation.

404 Not Found

The requested resource was not found.

500 Internal Server Error

Internal service error.

503 Service Unavailable

The service is unavailable.