Querying Resource Tags
Function
This API is used to query all resource tags.
Calling Method
For details, see Calling APIs.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
cts:tag:listForResource
List
-
-
-
-
URI
GET /v3/{project_id}/{resource_type}/{resource_id}/tags
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID. |
|
resource_type |
Yes |
String |
Resource type. The value is cts-tracker. |
|
resource_id |
Yes |
String |
Resource ID. |
Request Parameters
None
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
tags |
Array of ResourceTag objects |
Tag list. |
|
Parameter |
Type |
Description |
|---|---|---|
|
key |
String |
Tag key. A tag key contains a maximum of 128 Unicode characters. It can contain letters, digits, spaces, and special characters _.:=+-@. It cannot start or end with a space, or start with sys. |
|
value |
String |
Tag value. Each value contains a maximum of 255 Unicode characters. If value is specified, tags are deleted by key and value. If value is not specified, tags are deleted by key. A tag value can contain letters, digits, spaces, and special characters _.:/=+-@. It cannot start or end with a space. |
Example Requests
https://{endpoint}/v3/{project_id}/{resource_type}/{resource_id}/tags
Example Responses
Status code: 200
Request succeeded.
{
"tags" : [ {
"key" : "key1",
"value" : "value1"
}, {
"key" : "key2",
"value" : "value2"
}, {
"key" : "_sys_enterprise_project_id",
"value" : "0"
} ]
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Request succeeded. |
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