Querying the Number of Resource Instances
Function
This API is used to query the number of resource instances.
URI
POST /v3/{project_id}/{resource_type}/resource-instances/count
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID, which is used for resource isolation. For details about how to obtain its value, see Obtaining a Project ID. |
resource_type |
Yes |
String |
Resource type. The options are:
|
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
without_any_tag |
No |
Boolean |
Whether no tags are included. The default value is false.
|
tags |
No |
Array of objects |
Tags. For details, see tags.
|
matches |
No |
Array of objects |
Search field. For details, see matches. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
key |
Yes |
String |
Tag key. A tag key can contain a maximum of 128 characters. Only letters, digits, spaces, and special characters (_.:+-@) are allowed, but the value cannot start or end with a space or start with _sys_. |
values |
Yes |
Array of strings |
List of tag values. A tag value can contain a maximum of 255 characters. Only letters, numbers, spaces, and special characters (_.:+-@) are allowed. The value cannot start or end with a space. The value can be an empty array but cannot be left blank. If the values are null, it indicates any_value (querying any value). All values of a tag key are in the OR relationship. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
key |
Yes |
String |
Tag key. Currently, only the option resource_name is available. resource_name: resource name. By default, a fuzzy search is performed based on the prefix of the resource name entered. |
value |
Yes |
String |
Tag value. Enter a maximum of 255 characters. |
Response Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
total_count |
Yes |
Integer |
Total number of records. |
Example Request
{ "tags":[ { "key":"key1", "values":[ "value1", "value2" ] }, { "key":"key2", "values":[ "value1", "value2" ] } ], "matches":[ { "key":"resource_name", "value":"resource1" } ], "without_any_tag":"false" }
Example Response
{ "total_count": 1000 }
Status Codes
Status Code |
Description |
---|---|
200 |
The modification is successful. |
400 |
Request error. |
500 |
Internal server error. |
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