- API Reference
- API Description
- Tag Management
- Adding Resource Tags
Adding Resource Tags¶
Function¶
This API is used to add resource tags (such as stream tags) in batches. This API is idempotent. When you are creating tags, if there are duplicate keys in the request body, an error is reported. During tag creation, duplicate keys are not allowed. If a key already exists in the database, its value will be overwritten by the new duplicate key.
Calling Method¶
For details, see Calling APIs.
URI¶
POST /v2/{project_id}/stream/{stream_id}/tags/action
Parameter | Mandatory | Type | Description |
---|---|---|---|
project_id | Yes | String | Project ID |
stream_id | Yes | String | Stream ID |
Request Parameters¶
Parameter | Mandatory | Type | Description |
---|---|---|---|
X-Auth-Token | Yes | String | User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
Parameter | Mandatory | Type | Description |
---|---|---|---|
action | Yes | String | Operation to be performed. The value can be create only.
Enumeration values:
|
tags | Yes | Array of Tag objects | Tags |
Parameter | Mandatory | Type | Description |
---|---|---|---|
key | No | String | Tag key.
Minimum: 1 Maximum: 36 |
value | No | String | Value.
Minimum: 0 Maximum: 43 |
Response Parameters¶
None
Example Requests¶
Adding Resource Tags
POST https://{Endpoint}/v2/{project_id}/stream/{stream_id}/tags/action
{
"action" : "create",
"tags" : [ {
"key" : "key1",
"value" : "value1"
}, {
"key" : "key2",
"value" : "value3"
} ]
}
Example Responses¶
None
Status Codes¶
Status Code | Description |
---|---|
204 | Normal response |
Error Codes¶
See Error Codes.