Querying Resource Tags
Function
If there are a large number of cloud resources, you can use Tag Management Service (TMS) to manage them. Query resource information by filtering resource tags.
URI
GET /v1/resources/{resource_id}/tags
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
resource_id |
Yes |
String |
Definition ID of the resource to which you want to add a tag. Constraints N/A Range N/A Default value N/A |
Request Parameters
None
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
tags |
Array of TagResponse objects |
Definition The key-value pair of a tag. Constraints N/A Range N/A Default value N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
key |
String |
Definition Tag key. Range A tag key can contain up to 128 characters. It cannot start with sys or a space, and cannot end with a space. Only letters, digits, spaces, and the following special characters are allowed: _ . : = + - @ |
|
value |
String |
Definition Tag value. Range A tag value can contain a maximum of 255 characters. It cannot start or end with a space. Only letters, digits, spaces, and the following special characters are allowed: _ . : / = + - @ |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Definition Error code. Range The value is a string. It contains 8 to 36 characters. |
|
error_msg |
String |
Definition Error description. Range The value is a string. It contains 2 to 512 characters. |
Example Requests
Query resource tags.
GET https://{Endpoint}/v1/resources/{resource_id}/tags
Example Responses
Status code: 200
Resource tags are queried.
[ {
"key" : "string",
"value" : "string"
} ]
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Resource tags are queried. |
|
400 |
The resource tag fails to be queried. |
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