Reviewed-by: Bobkova, Natalia <natalia.bobkova@t-systems.com> Co-authored-by: Zaoxu, Li <lizaoxu@huawei.com> Co-committed-by: Zaoxu, Li <lizaoxu@huawei.com>
12 KiB
Adding a Tag
Description
URI
- URI format
- Parameter description
Parameter
Mandatory
Type
Description
project_id
Yes
String
Project ID
resource_type
Yes
String
Resource type
Only smn_topic (topic) is supported.
resource_id
Yes
String
Resource ID
Obtain a resource ID:
- Add X-SMN-RESOURCEID-TYPE=name in the request header and set the resource ID to the topic name.
- Call the GetResourceInstances API to obtain the resource ID.
Request
- Parameter description
Parameter
Mandatory
Type
Description
tag
Yes
Resource_tag structure
Tag to be added. For details, see Table 1.
Table 1 Resource_tag structure Parameter
Type
Description
Constraint
key
String
Tag key
A key can contain up to 36 Unicode characters, including only digits, letters, hyphens (-), and underscores (_). A key cannot be left blank, be an empty string, or start or end with a space.
value
String
Tag value
A value can contain up to 43 Unicode characters, including only digits, letters, hyphens (-), and underscores (_). A value can be an empty string, but it cannot start or end with a space.
- Example request
POST https://{SMN_Endpoint}/v2/{project_id}/{resource_type}/{resource_id}/tags
- Example request
{ "tag": { "key": "DEV", "value": "DEV1" } }
Response
None
Returned Value
See Returned Value.
Error Codes
See Error Codes.