Queries the number of resources of each type or in each region supported by Cloud Config under the specified account.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | GetDiscoveredResourceCounts |
The operation that you want to perform. Set the value to GetDiscoveredResourceCounts. |
GroupByKey | String | No | ResourceType |
The dimension by which resources are grouped. Valid values:
|
MultiAccount | Boolean | No | true |
Specifies whether to query the numbers of resources under the member accounts of the current master account. Valid values:
Note If you are using Cloud Config for individuals, ignore this parameter.
|
MemberId | Long | No | 123456789 |
The ID of the member account whose resources are to be queried. This parameter is empty by default. This parameter is available only when MultiAccount is set to true.
Note If you are using Cloud Config for individuals, ignore this parameter.
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
GroupedResourceCounts | Struct |
The returned information about resources. |
|
GroupByKey | String | ResourceType |
The dimension by which resources are grouped. |
GroupedResourceCountList | Array of GroupedResourceCount |
The information about resources in a specific group. |
|
GroupName | String | ACS::ECS::Snapshot |
The name of the resource group. |
ResourceCount | Long | 13 |
The number of resources in the group. |
RequestId | String | 54BFA4FB-6E08-4D58-9E83-1A8A3EC80247 |
The ID of the request. |
Examples
Sample requests
http(s)://[Endpoint]/? Action=GetDiscoveredResourceCounts
&<Common request parameters>
Sample success responses
XML
format
<GetDiscoveredResourceCountsResponse>
<RequestId>54BFA4FB-6E08-4D58-9E83-1A8A3EC80247</RequestId>
<GroupedResourceCounts>
<GroupedResourceCountList>
<GroupName>ACS::ECS::Snapshot</GroupName>
<ResourceCount>13</ResourceCount>
</GroupedResourceCountList>
<GroupedResourceCountList>
<GroupName>ACS::ECS::SecurityGroup</GroupName>
<ResourceCount>10</ResourceCount>
</GroupedResourceCountList>
<GroupByKey>ResourceType</GroupByKey>
</GroupedResourceCounts>
</GetDiscoveredResourceCountsResponse>
JSON
format
{
"RequestId": "54BFA4FB-6E08-4D58-9E83-1A8A3EC80247",
"GroupedResourceCounts": {
"GroupedResourceCountList": [
{
"GroupName": "ACS::ECS::Snapshot",
"ResourceCount": 13
},
{
"GroupName": "ACS::ECS::SecurityGroup",
"ResourceCount": 10
}
],
"GroupByKey": "ResourceType"
}
}
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. |
503 | ServiceUnavailable | The request has failed due to a temporary failure of the server. | The error message returned because the service is unavailable. |
404 | AccountNotExisted | Your account does not exist. | The error message returned because your account does not exist. |
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. |
For a list of error codes, visit the API Error Center.