- API Reference
- API Description
- Predefined Tag Operations
- Creating or Deleting Predefined Tags
Creating or Deleting Predefined Tags¶
Function¶
This API is used to create or delete predefined tags. You can add tags to resources using the predefined tags.
This API supports idempotency and batch processing.
Note
Idempotent operations refer to invoking the same API for multiple times by using the same parameters, which have the same impact on the system.
URI¶
POST /v1.0/predefine_tags/action
Request¶
Parameter description
Table 1 Request header parameters¶ Parameter
Mandatory
Type
Description
X-Auth-Token
Yes
String
Specifies the user token. TMS is a global service. When calling the IAM API to obtain a user token, set scope to domain. The value of X-Subject-Token in the response header is the user token.
tags field description
Table 3 Fields¶ Name
Mandatory
Type
Description
key
Yes
String
Specifies the key.
It can contain up to 36 characters. The key cannot be empty. Only digits, letters, hyphens (-), at signs (@), and underscores (_) are allowed.
value
Yes
String
Specifies the value.
Each value contains a maximum of 43 Unicode characters and can be an empty string. Only digits, letters, hyphens (-), at signs (@), and underscores (_) are allowed.
Example request
POST https://{TMS endpoint}/v1.0/predefine_tags/action
{ "action": "create", "tags": [ { "key": "ENV1", "value": "DEV1" }, { "key": "ENV2", "value": "DEV2" } ] }
Example Response¶
Status code: 204
Status Codes¶
See Status Codes.
Error Codes¶
See Error Codes.