Help Center/ Elastic Volume Service/ API Reference (Paris Region)/ APIs/ Tag Management/ Updating Tags of an EVS Resource by Key (Deprecated)
Updated on 2024-03-26 GMT+08:00

Updating Tags of an EVS Resource by Key (Deprecated)

Function

This API is used to update tags of an EVS resource by key.

This API has been deprecated. Use another API. For details, see Batch Adding Tags for the Specified EVS Disk.

Constraints

  • Tag key: This parameter is mandatory if tags are to be added to an EVS resource.

    A tag key can contain a maximum of 36 characters and can contain letters (A-Z and a-z), digits (0-9), hyphens (-), underscores (_), and Unicode characters (\u4E00-\u9FFF).

  • Tag value: This parameter is optional if tags are to be added to an EVS resource.

    A tag value can contain a maximum of 43 characters and can contain letters (A-Z and a-z), digits (0-9), periods (.), hyphens (-), underscores (_), and Unicode characters (\u4E00-\u9FFF). It can be an empty string.

  • A maximum of 10 tags can be created for an EVS resource.

URI

  • URI format

    PUT /v2/{project_id}/os-vendor-tags/{resource_type}/{resource_id}/{key}

  • 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.

    resource_type

    Yes

    Specifies the resource type. The value can be volumes, snapshots, or backups.

    resource_id

    Yes

    Specifies the resource ID.

    key

    Yes

    Specifies the key of the tag.

Request

  • Parameter description

    Parameter

    Type

    Mandatory

    Description

    tag

    Object

    Yes

    Specifies the key-value pair of the tag.

  • Description of the request header parameter

    Parameter

    Type

    Mandatory

    Description

    Content-Type

    Object

    Yes

    Specifies the type. The value can be application/json.

  • Example request
    {
        "tag": {
            "key_0": "value_0"
        }
    }

Response

  • Parameter description

    Parameter

    Type

    Description

    tag

    Object

    Specifies the key-value pair of the tag.

  • Example response
    {
        "tag": {
            "key_0": "value_0"
        }
    }

    or

    {
        "error": {
          ta  "message": "XXXX", 
            "code": "XXX"
        }
    }

    In the preceding example, error indicates a general error, for example, badRequest or itemNotFound. An example is provided as follows:

    {
        "badRequest": {
            "message": "Request body and URI mismatch", 
            "code": 400
        }
    }

Status Codes

  • Normal

    200

Error Codes

For details, see Error Codes.