Adding Resource Tags in Batches
Function
This API is used to add resource tags in batches.
URI
POST /v1/{project_id}/{resource_type}/{resource_id}/tags/create
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID |
resource_type |
Yes |
String |
Resource type.Default usage: auditInstance |
resource_id |
Yes |
String |
Resource ID (DBSS instances ID, the instance ID is not in the basic information.) This parameter can be obtained through the interface : GET /v1/{project_id}/dbss/audit/instances |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
Content-type |
Yes |
String |
The fixed value of this parameter is application/json;charset=UTF-8, which cannot be changed. |
X-Auth-Token |
Yes |
String |
User token |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
tags |
No |
Array of KeyValueBean objects |
Tag list This parameter is mandatory for tenants. For users with the op_service permission, choose either this field or sys_tags. |
sys_tags |
No |
Array of KeyValueBean objects |
System tag listThis field is available only to the op_service permission. Choose either this field or tags.Currently, TMS invokes only one resource_tag structure. The key is fixed as _sys_enterprise_project_id.The value is UUID or 0. 0 indicates the enterprise project by default. |
Response Parameters
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error |
Object |
Error message. |
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error information. |
Status code: 403
Parameter |
Type |
Description |
---|---|---|
error |
Object |
Error message. |
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error information. |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error |
Object |
Error message. |
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error information. |
Example Requests
/v1/{project_id}/{resource_type}/{resource_id}/tags/create { "tags" : [ { "key" : "key1" }, { "key" : "key2", "value" : "value3" } ], "sys_tags" : [ { "key" : "_sys_enterprise_project_id", "value" : "5aa119a8-d25b-45a7-8d1b-88e127885635" } ] }
Example Responses
Status code: 204
Success
Status code: 400
Failure
{ "error" : { "error_code" : "DBSS.XXXX", "error_msg" : "XXX" } }
Status Codes
Status Code |
Description |
---|---|
204 |
Success |
400 |
Failure |
403 |
Authentication failed. |
500 |
Server 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