Querying Tags of a Project
Function
This API is used to query all tags of a resource type in a region.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions. For details about the required permissions, see Permissions Policies and Supported Actions.
URI
GET /v1/{project_id}/{resource_type}/tags
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Specifies the project ID. |
|
resource_type |
Yes |
String |
Specifies the resource type. cph-server: cloud phone server |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
limit |
No |
Integer |
Number of resources on each page. The value ranges from 1 to 100. The default value is 100. Generally, the value is set to 10, 20, or 50. |
|
offset |
No |
Integer |
Index position. If offset is set to N, the resource query starts from the N+1 piece of data. The default value is 0, indicating that the query starts from the first piece of data. The value cannot be a negative number. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Specifies the user token. It can be obtained by calling an Identity and Access Management (IAM) API. The value of X-Subject-Token in the response header is the user token. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
tags |
Array of Tags objects |
Specifies resource tag list. |
|
Parameter |
Type |
Description |
|---|---|---|
|
key |
String |
Specifies the tag key.
|
|
values |
Array of strings |
Specifies the tag value list.
|
Example Requests
Querying all tags of a resource type in a region
GET https://{CPH Endpoint}/v1/{project_id}/{resource_type}/tags
Example Responses
Status code: 200
OK
{
"tags" : [ {
"key" : "key1",
"values" : [ "value1", "value2" ]
}, {
"key" : "key2",
"values" : [ "value1", "value2" ]
} ],
"total_count" : 1001
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
OK |
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