Adding a Tag
Function
Add a tag.
URI
POST /v1/{project_id}/{resource_type}/{resource_id}/tags/action
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details about how to obtain a project ID, see Obtaining the Account ID, Project ID, Log Group ID, and Log Stream ID. Minimum length: 1 character. Maximum length: 64 characters. |
resource_type |
Yes |
String |
Resource type. |
resource_id |
Yes |
String |
Resource ID. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token obtained from IAM. For details about how to obtain a user token, see Obtaining a User Token. Minimum length: 1 character. Maximum length: 10,000 characters. |
Content-Type |
Yes |
String |
Set this parameter to application/json;charset=UTF-8. Minimum length: 30 characters. Maximum length: 30 characters. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
action |
Yes |
String |
Method of adding tags. |
is_open |
No |
Boolean |
Whether to invoke external APIs. |
tags |
Yes |
Array of tagsBody objects |
Tag field information. |
Response Parameters
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. Minimum: 8 Maximum: 36 |
error_msg |
String |
Error description. Minimum: 2 Maximum: 512 |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. Minimum: 8 Maximum: 36 |
error_msg |
String |
Error description. Minimum: 2 Maximum: 512 |
Example Requests
/v1/2a473356cca5487f8373be891bffc1cf/groups/0933a172-379e-44d0-9ed9-f491b1c528ea/tags/action { "action" : "create", "is_open" : false, "tags" : [ { "key" : "zzz", "value" : "zzz" }, { "key" : "sgq", "value" : "123" } ] }
Example Responses
Status code: 400
Invalid request. Modify the request based on the description in error_msg before a retry.
{ "error_code" : "LTS.1836", "error_msg" : "action is create or delete" }
Status code: 500
The server has received the request but encountered an internal error.
{ "error_code" : "LTS.0203", "error_msg" : "Internal Server Error" }
Status Codes
Status Code |
Description |
---|---|
201 |
The tag is added. |
400 |
Invalid request. Modify the request based on the description in error_msg before a retry. |
500 |
The server has received the request but encountered an internal error. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot