Queries the statistics on resources grouped by resource type.

This topic provides an example of how to query the statistics on resources grouped by resource type. The return result shows a total of 10 resources of the ACS::ECS::Instance resource type.

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 GetDiscoveredResourceCountsGroupByResourceType

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

Region String No cn-hangzhou

The ID of the region based on which you want to query resources.

For information about common request parameters, see Common parameters.

Response parameters

Parameter Type Example Description
RequestId String AC9BD94C-D20C-4D27-88D4-89E8D75C051B

The ID of the request.

DiscoveredResourceCountsSummary Array of GroupedResourceCount

The statistics on resources.

ResourceCount Long 10

The total number of resources of the type.

ResourceType String ACS::ECS::Instance

The resource type that is used to group resources.

Examples

Sample requests

http(s)://[Endpoint]/?Action=GetDiscoveredResourceCountsGroupByResourceType
&Region=cn-hangzhou
&<Common request parameters>

Sample success responses

XML format

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

<GetDiscoveredResourceCountsGroupByResourceTypeResponse>
    <RequestId>AC9BD94C-D20C-4D27-88D4-89E8D75C051B</RequestId>
    <DiscoveredResourceCountsSummary>
        <ResourceCount>10</ResourceCount>
        <ResourceType>ACS::ECS::Instance</ResourceType>
    </DiscoveredResourceCountsSummary>
</GetDiscoveredResourceCountsGroupByResourceTypeResponse>

JSON format

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

{
  "RequestId" : "AC9BD94C-D20C-4D27-88D4-89E8D75C051B",
  "DiscoveredResourceCountsSummary" : [ {
    "ResourceCount" : 10,
    "ResourceType" : "ACS::ECS::Instance"
  } ]
}

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 MemberNotBelongToMaster The specified member does not belong to your organization. The error message returned because the specified member account does not belong to your resource directory.
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.