Queries the statistics on resources grouped by region in an account group.

In this topic, the ca-a260626622af0005**** account group is used as an example. The return result shows a total of 10 resources in the cn-hangzhou region.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes GetAggregateResourceCountsGroupByRegion

The operation that you want to perform. Set the value to GetAggregateResourceCountsGroupByRegion.

ResourceType String No ACS::ECS::Instance

The type of resources that you want to query.

For more information about how to obtain the type of a resource, see ListAggregateDiscoveredResources.

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.

For information about common request parameters, see Common parameters.

Response parameters

Parameter Type Example Description
RequestId String 399BD94C-D20C-4D27-88D4-89E8D75C0595

The ID of the request.

DiscoveredResourceCountsSummary Array of GroupedResourceCount

The statistics on resources in the account group.

ResourceCount Long 10

The total number of resources in the region.

Region String cn-hangzhou

The ID of the region that is used to group resources.

Examples

Sample requests

http(s)://[Endpoint]/?Action=GetAggregateResourceCountsGroupByRegion
&AggregatorId=ca-a260626622af0005****
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<GetAggregateResourceCountsGroupByRegionResponse>
	<RequestId>399BD94C-D20C-4D27-88D4-89E8D75C0595</RequestId>
	<DiscoveredResourceCountsSummary>
		<Region>cn-hangzhou</Region>
		<ResourceCount>10</ResourceCount>
	</DiscoveredResourceCountsSummary>
</GetAggregateResourceCountsGroupByRegionResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "399BD94C-D20C-4D27-88D4-89E8D75C0595",
  "DiscoveredResourceCountsSummary" : [ {
    "Region" : "cn-hangzhou",
    "ResourceCount" : 10
  } ]
}

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.