CreateResourceTag
You can add a maximum of 10 tags to a resource.
The API is idempotent. If a to-be-created tag has the same key as an existing tag, the tag will be created and overwrite the existing one.
POST /v2/{project_id}/{resource_type}/{resource_id}/tags
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID |
resource_type |
Yes |
String |
Resource type The value can be the following: smn_topic: topic |
resource_id |
Yes |
String |
Resource ID Obtain a resource ID:
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
tag |
Yes |
Resource tag structure |
Resource tag to be added. For details, see Table 1. |
Parameter |
Mandatory |
Type |
Description |
Constraint |
---|---|---|---|---|
key |
Yes |
String |
Tag key |
The key contains 36 Unicode characters at most and cannot be blank or an empty string. It can contain only digits, letters, hyphens (-), and underscores (_) and must not start or end with a space. |
value |
Yes |
String |
Tag value |
Each value contains 43 Unicode characters at most and can be an empty string. It can contain only digits, letters, hyphens (-), and underscores (_) and must not start or end with a space. |
POST https://{SMN_Endpoint}/v2/{project_id}/{resource_type}/{resource_id}/tags
{ "tag": { "key":"DEV", "value":"DEV1" } }
None
See Returned Value.
See section Error Code.