• Data Ingestion Service

dis
  1. Help Center
  2. Data Ingestion Service
  3. API Reference
  4. API Description
  5. Tag Management APIs
  6. Adding or Deleting Stream Tags in Batches

Adding or Deleting Stream Tags in Batches

Function

This API is used to add or delete tags to or from a specified stream in batches.

You can add a maximum of 10 tags to a stream.

This API is idempotent.

If a tag to be created has the same key as an existing tag in a stream, the tag will overwrite the existing one.

When tags are being deleted and some tags do not exist, the operation is considered successful by default. The character set of the tags will not be checked. A key and a value can respectively contain up to 36 and 43 Unicode characters. When you delete tags, the tag structure cannot be missing, and the key cannot be left blank or be an empty string.

URI

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

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.

tags

Yes

List<resource_tag>

List of tags.

action

Yes

String

Operation to be performed. The value can be set to create or delete only.

Request

Request parameters

The following table describes the request parameters.

Table 2 Request parameter description

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
{ 
    "action": "create", 
    "tags": [ 
        { 
            "key": "key1", 
            "value": "value1" 
        }, 
        { 
            "key": "key", 
            "value": "value3" 
        } 
    ] 
} 
  • Response example

    None

Status Code

Table 3 lists the status code of this API.

Table 3 Status code

Status Code

Description

204

No Content