Querying the Number of Resource Instances
Function
This API is used to query the number of resource instances.
URI
POST /v5/{project_id}/{resource_type}/resource-instances/count
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID of a tenant in a region. For details, see Obtaining a Project ID. |
resource_type |
Yes |
String |
Resource type.
Enumerated values:
|
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
Content-Type |
Yes |
String |
MIME type of the request body. Use the default value application/json. For APIs used to upload objects or images, the value varies depending on the flow type. The default value is application/json. |
X-Auth-Token |
Yes |
String |
User token obtained from IAM. It is a response to the API for obtaining a user token. After a request is processed, the value of X-Subject-Token in the header is the token value. |
X-Language |
No |
String |
Request language type. Default value: en-us Enumerated values:
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
without_any_tag |
No |
Boolean |
If this parameter is set to true, all resources without tags are queried. In this case, the tags field is ignored. If this parameter is set to false or not specified, it does not take effect, which means that all resources are returned or resources are filtered by tags or matches. |
tags |
No |
Array of objects |
Included tags. A maximum of 20 keys are included. Each key can have a maximum of 20 values. For details, see Table 4. |
matches |
No |
Array of objects |
Search field. The tag key is the field to be matched, for example, resource_name. The tag value indicates the value to be matched. For details, see Table 5. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
total_count |
Integer |
Total number. |
Example Request
Querying the number of synchronization task resource instances
https://{endpoint}/v5/5237e10fe9aa4ad5b16b6a5245248314/sync/resource-instances/count { "tags" : [ { "key" : "key1", "values" : [ "value1", "value2" ] }, { "key" : "key2", "values" : [ "value1", "value2" ] } ], "matches" : [ { "key" : "resource_name", "value" : "resource1" } ], "without_any_tag" : false }
Example Response
Status code: 200
OK
{ "total_count" : 1 }
Status Code
Status Code |
Description |
---|---|
200 |
OK |
Error Code
For details, see Error Code.
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