• Data Ingestion Service

dis
  1. Help Center
  2. Data Ingestion Service
  3. API Reference
  4. API Description
  5. Tag Management APIs
  6. Adding a Tag to a Specified Stream

Adding a Tag to a Specified Stream

Function

This API is used to add a tag to a specified stream.

A stream has a maximum of 10 tags. This API is idempotent. If a tag to be created has the same key as an existing tag, the tag will overwrite the existing one.

URI

POST /v2/{project_id}/stream/{stream_id}/tags

The following table describes URI parameters.

Table 1 URI parameter description

Parameter

Mandatory

Description

project_id

Yes

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

stream_id

Yes

Stream ID.

Request

Request parameters

Table 2 Request parameters

Parameter

Mandatory

Type

Description

key

Yes

String

Key.

A tag key consists of a maximum of 36 characters, including A-Z, a-z, 0-9, hyphens (-), and underscores (_).

value

Yes

String

Value.

The value consists of a maximum of 43 characters, including A-Z, a-z, 0-9, periods (.), hyphens (-), and underscores (_), and can be an empty string.

Response

Response parameter

None

Example

  • Request example
{ 
    "tag": 
        { 
            "key":"DEV", 
            "value":"DEV1" 
        } 
} 
  • Response example

    None

Status Code

Table 3 lists the status code of this API.

Table 3 Status code

Status Code

Description

204

No Content