Queries the statistics on resources grouped by resource type in an account group.
In this example, the ca-a260626622af0005****
account group is used. The return result shows a total of seven
resources of the ACS::RAM::Role
resource type.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | GetAggregateResourceCountsGroupByResourceType |
The operation that you want to perform. Set the value to GetAggregateResourceCountsGroupByResourceType. |
Region | String | No | cn-hangzhou |
The ID of the region in which the resource resides. |
AggregatorId | String | Yes | ca-a260626622af0005**** |
The ID of the account group. For more information about how to obtain the ID of an account group, see ListAggregators. |
FolderId | String | No | r-BU**** |
The ID of the folder in the resource directory. For more information about how to obtain the ID of a folder, see View the basic information of a folder. |
For more information about common request parameters, see Common parameters.
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 99114B22-1EFF-47DF-B906-1CCE82FF9D60 |
The ID of the request. |
DiscoveredResourceCountsSummary | Array of GroupedResourceCount |
The statistics on resources. |
|
ResourceCount | Long | 7 |
The total number of resources of the type. |
ResourceType | String | ACS::RAM::Role |
The resource type that is used to group resources. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=GetAggregateResourceCountsGroupByResourceType
&AggregatorId=ca-a260626622af0005****
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<GetAggregateResourceCountsGroupByResourceTypeResponse>
<RequestId>99114B22-1EFF-47DF-B906-1CCE82FF9D60</RequestId>
<DiscoveredResourceCountsSummary>
<ResourceType>ACS::RAM::Role</ResourceType>
<ResourceCount>7</ResourceCount>
</DiscoveredResourceCountsSummary>
</GetAggregateResourceCountsGroupByResourceTypeResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "99114B22-1EFF-47DF-B906-1CCE82FF9D60",
"DiscoveredResourceCountsSummary" : [ {
"ResourceType" : "ACS::RAM::Role",
"ResourceCount" : 7
} ]
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | NoPermission | You are not authorized to perform this operation. | The error message returned because you are not authorized to perform the specified operation. |
400 | Invalid.AggregatorId.Value | The specified AggregatorId is invalid. | The error message returned because the specified account group ID does not exist or you are not authorized to use the account group. |
404 | AccountNotExisted | Your account does not exist. | The error message returned because your account does not exist. |
503 | ServiceUnavailable | The request has failed due to a temporary failure of the server. | The error message returned because the service is unavailable. |
For a list of error codes, visit the API Error Center.