Help Center/ Elastic Volume Service/ API Reference (Kuala Lumpur Region)/ APIs/ EVS Tag/ Batch Adding Tags for the Specified EVS Disk
Updated on 2022-08-09 GMT+08:00

Batch Adding Tags for the Specified EVS Disk

Function

This API is used to batch add tags for the specified EVS disk.

  • When adding tags, if a tag key is consistent with an existing one, the new tag will overwrite the existing tag.
  • A maximum of 10 tags can be created for a disk.

Constraints

None

URI

  • URI format

    POST /v2/{project_id}/cloudvolumes/{volume_id}/tags/action

  • Parameter description

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Specifies the project ID.

    For details about how to obtain the project ID, see Obtaining a Project ID.

    volume_id

    Yes

    Specifies the disk ID.

Request

  • Parameter description

    Parameter

    Type

    Mandatory

    Description

    tags

    List<resource_tag>

    Yes

    Specifies the tag list. For details, see Parameters in the resource_tag field.

    action

    String

    Yes

    Specifies the operation to perform. The value can be create or delete.

    create: specifies to add tags.

  • Parameters in the resource_tag field

    Parameter

    Type

    Mandatory

    Description

    key

    String

    Yes

    Specifies the tag key. Tag keys of a disk must be unique.
    • A tag key can contain a maximum of 36 characters.
    • Character set: A-Z, a-z, 0-9, hyphens (-), underscores (_), and Unicode characters (\u4E00-\u9FFF)

    value

    String

    Yes

    Specifies the tag value.
    • A tag value can contain a maximum of 43 characters and can be an empty string.
    • Character set: A-Z, a-z, 0-9, periods (.), hyphens (-), underscores (_), and Unicode characters (\u4E00-\u9FFF)
  • Example request
    {
        "action": "create", 
        "tags": [
            {
                "key": "key1", 
                "value": "value1"
            }, 
            {
                "key": "key2", 
                "value": "value3"
            }
        ]
    }

Response

None

Status Codes

  • Normal

    204

Error Codes

For details, see Error Codes.