Queries the number of resources in a visible resource group.
Debugging
Authorization information
There is currently no authorization information disclosed in the API.
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| ResourceTypes | array<object> | No | The resource types. | |
| object | No | The resource type. | ||
| ResourceTypeCode | string | No | The resource type. You can obtain the resource type from the Resource type column in Services that work with Resource Group. | instance |
| Service | string | No | The service code. You can obtain the code from the Service code column in Services that work with Resource Group. | ecs |
| GroupByKey | string | No | The dimension by which resources are queried. Note
If you do not specify a dimension, no results are returned.
Valid values:
| ResourceGroupId |
| ResourceGroupId | string | No | The resource group ID. You can call the ListResourceGroups operation to obtain the ID. | rg-9gLOoK**** |
| ResourceRegionId | string | No | The region ID of the resources. | cn-shanghai |
Response parameters
Examples
Sample success responses
JSONformat
{
"RequestId": "9B34724D-54B0-4A51-B34D-4512372FE1BE",
"ResourceCounts": [
{
"Count": 1,
"GroupByKey": "ResourceGroupId",
"ResourceGroupId": "rg-9gLOoK****\n"
}
]
}Error codes
| HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 400 | UnsupportedResourceType | The resource type is not supported. | The resource type is not supported. |
| 400 | InvalidParameter.GroupByKey | The parameter GroupByKey is invalid. | The parameter GroupByKey is invalid. |
| 404 | EntityNotExists.ResourceGroup | The specified resource group does not exist. You must first create a resource group. | The specified resource group does not exist. You must first create a resource group. |
For a list of error codes, visit the Service error codes.
