• Dedicated Host

deh
  1. Help Center
  2. Dedicated Host
  3. API Reference
  4. APIs
  5. DeH Tag Management
  6. Adding Tags to a DeH in Batches

Adding Tags to a DeH in Batches

Function

  • This interface is used to add tags to a specified DeH in batches.
  • The Tag Management Service (TMS) uses this interface to batch manage the tags of a DeH.

Constraints

  • A DeH allows a maximum of 10 tags.
  • The API is idempotent.

    During tag creation, if a tag exists (both the key and value are the same as those of an existing tag), the tag is successfully processed by default.

  • A new tag will overwrite the original one if their keys are the same and values are different.

URI

POST /v1.0/{project_id}/dedicated-host-tags/{dedicated_host_id}/tags/action

Table 1 lists the parameters.

Table 1 Parameter description

Parameter

Type

Mandatory

Description

project_id

String

Yes

Specifies the project ID.

dedicated_host_id

String

Yes

Specifies the DeH ID.

Request Message

  • Request parameters

    Parameter

    Type

    Mandatory

    Description

    tags

    List <resource_tag>

    Yes

    Specifies the tag list.

    action

    String

    Yes

    Specifies the operation. (Only lowercase letters are supported.) For example, create indicates the creation operation.

    Table 2 resource_tag field data structure description

    Parameter

    Type

    Mandatory

    Description

    key

    String

    Yes

    Specifies the tag key.

    • Cannot be left blank.
    • It contains a maximum of 36 Unicode characters.
    • It cannot contain the following ASCII characters: =*<>\|/,
    • It can contain letters, digits, hyphens (-), and underscores (_).

    value

    String

    Yes

    Specifies the tag value.

    • It contains a maximum of 43 Unicode characters.
    • It cannot contain the following ASCII characters: =*<>\|/,
    • It can contain letters, digits, hyphens (-), and underscores (_).
  • Example request
    POST /v1.0/9c53a566cb3443ab910cf0daebca90c4/dedicated-host-tags/74259164-e63a-4ad9-9c77-a1bd2c9aa187/tags/action
    {
        "action": "create",
        "tags": [
            {
                "key": "key1",
                "value": "value1"
            },
            {
                "key": "key2",
                "value": "value2"
            }
        ]
    }

Response Message

N/A

Returned Values

See section HTTP Status Codes.