• Distributed Message Service

dms
  1. Help Center
  2. Distributed Message Service
  3. API Reference
  4. APIs for Managing Queue Tags
  5. Adding a Queue Tag

Adding a Queue Tag

Function

This API is used to add a queue tag. A maximum of 10 tags can be added to a queue.

This API is idempotent.

If the tag key to be created already exists, the previous tag is overwritten.

URI

URI format: POST /v1.0/{project_id}/queue/{queue_id}/tags
Table 1 Request header

Parameter

Description

Mandatory or Not

Example

Content-type

Indicates the MIME types of a request body.

Yes

application/json

X-Auth-Token

Indicates the user token.

Yes

-

Table 2 Parameter description

Parameter

Mandatory or Not

Type

Description

project_id

Yes

String

Indicates the ID of a project.

queue_id

Yes

String

Indicates the queue ID.

Example

 /v1.0/67c01b92944144a19d2da968ef34a912/queue/dd713484-e0b6-4e70-9942-4250e773d17c/tags

Request

Table 3 and Table 4 describe the parameters.
Table 3 Parameter description

Parameter

Mandatory or Not

Type

Description

tag

Yes

JSON

Indicates a list of tags.

Table 4 tag parameter description

Parameter

Mandatory or Not

Type

Description

key

Yes

String

Indicates the tag key, which can contain a maximum of 36 Unicode characters. It cannot be left unspecified, and cannot contain nonprintable ASCII (0–31) characters and the following special characters: =*<>\,|/

value

Yes

String

Indicates a tag value, which can contain a maximum of 43 Unicode characters. It can be empty, but cannot contain nonprintable ASCII (0–31) characters and the following special characters: =*<>\,|/

Example request

{
     "tag":
{
        "key":"DEV",
        "value":"DEV1"
}
}

Response

Response parameters

None.

Example response

None.

Status Code

Status Code

Description

204

No content.

400

Invalid parameters, such as tag.

401

Authentication failed.

403

Insufficient permission.

404

No queue found.

500

System error.