Querying Project Tags
Function
This API is used to query all resource tags of instances in a specified project.
URI
GET /v2/{project_id}/{resource_type}/tags
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details about how to obtain a project ID, see Obtaining a Project ID. |
resource_type |
Yes |
String |
Resource type.
|
Request
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
Content-Type |
Yes |
String |
Message body type (format). The default value application/json is recommended. |
X-Auth-Token |
Yes |
String |
User token. The token can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
Response
Response parameters
Parameter |
Type |
Description |
---|---|---|
count |
Integer |
Number of tags. |
tags |
Array of tag objects |
A list of tags. |
Parameter |
Type |
Description |
---|---|---|
key |
String |
Tag key. |
values |
Array of strings |
A list of tag values. |
Example response
{ "count": 5, "tags": [ { "values": [ "hwg" ], "key": "deployer" }, { "values": [ "batchjob" ], "key": "batchjob" }, { "values": [ "2" ], "key": "2" }, { "values": [ "bbb" ], "key": "aaa" }, { "values": [ "autotest" ], "key": "autotest" } ] }
Error Codes
For details, 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