This API is used to query the number of resource instances based on tags.
For details, see Calling APIs.
POST /v5/{project_id}/{resource_type}/resource-instances/count
Parameter |
Type |
Mandatory |
Description |
|---|---|---|---|
project_id |
String |
Yes |
Specifies a project ID. You can obtain the project ID by referring to Obtaining the Project ID. |
resource_type |
String |
Yes |
Parameter |
Type |
Mandatory |
Description |
|---|---|---|---|
without_any_tag |
Boolean |
No |
|
tags |
Array of Tag objects |
No |
|
matches |
Array of Match objects |
No |
|
Parameter |
Type |
Mandatory |
Description |
|---|---|---|---|
key |
String |
Yes |
|
values |
Array of String |
Yes |
|
POST https://{Endpoint}/v5/{project_id}/{resource_type}/resource-instances/count
{
"tags": [{
"key": "key1",
"values": [
"value1",
"value2"
]
},
{
"key": "key2",
"values": [
"value1",
"value2"
]
}
],
"matches": [{
"key": "resource_name",
"value": "resource1"
}],
"without_any_tag": "false"
}
Returned status code 200: successful query
Parameter |
Type |
Description |
|---|---|---|
total_count |
Integer |
Indicates the total number of records. |
{
"total_count": 1000
}
For details, see Status Codes.