Querying the Number of Resources by Tag
Function
This API is used to query the number of resources by tag.
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. For details about the required permissions, see Permissions Policies and Supported Actions.
URI
POST /v1/{resource_type}/resource-instances/count
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
resource_type |
Yes |
Object |
Specifies the resource type. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Specifies the user token. The token can be obtained by calling the IAM API. The value of X-Subject-Token in the response header is the user token. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
tags |
No |
Array of Tag objects |
Specifies the tag list. |
|
matches |
No |
Array of Match objects |
Specifies the matched results. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
total_count |
Integer |
Specifies the total number of resources. |
|
request_id |
String |
Specifies the request ID. |
Example Requests
Querying the Number of Resources by Tag
POST https://{ga_endpoint}/v1/{resource_type}/resource-instances/count
{
"tags" : [ {
"key" : "tagKey",
"values" : [ "tagValue" ]
} ],
"matches" : [ {
"key" : "resourceName",
"value" : "name"
} ]
}
Example Responses
Status code: 200
Operation successful.
{
"total_count" : 10,
"request_id" : "ac1bf54f-6a23-4074-af77-800648d25bc9"
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Operation successful. |
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