Queries the number of resources in your account that you have permission to access.
Operation description
The operation counts only the resources that you have permission to access.
This operation supports only Alibaba Cloud services and resource types that work with Resource Center.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| GroupByKey |
string |
No |
The dimension by which the resource count is grouped. Valid values:
|
ResourceType |
| Filter |
array<object> |
No |
The filter conditions. |
|
|
object |
No |
A filter condition. |
||
| Key |
string |
No |
The key of the filter condition. For valid values, see |
RegionId |
| MatchType |
string |
No |
The match type. The value must be Equals, which indicates an exact match. |
Equals |
| Value |
array |
No |
The value of the filter condition. |
|
|
string |
No |
The value of the filter condition. |
cn-shanghai |
Supported filter parameters
| Parameter | Description | Supported match types |
| ResourceType | The resource type. | Equals |
| RegionId | The region ID. | Equals |
| ResourceId | The resource ID. | Equals, Prefix |
| ResourceGroupId | The resource group ID. | Equals, Exists, NotExists |
| ResourceName | The resource name. | Equals, Contains |
| Tag | The key-value pair of a tag. The value is a JSON string in the { "key": $key, "value": $value } format. You must specify at least one of `key` and `value`. For example, to query for the tag key foo and tag value bar, pass { "key": "foo", "value": "bar" }. To query for only the tag key foo, pass { "key": "foo" }. | Contains, NotContains, NotExists |
| VpcId | The VPC ID. | Equals |
| VSwitchId | The vSwitch ID. | Equals |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| Filters |
array<object> |
The filter conditions. |
|
|
object |
A filter condition. |
||
| Key |
string |
The key of the filter condition. |
RegionId |
| Values |
array |
The values of the filter condition. |
|
|
string |
The value of the filter condition. |
cn-shanghai |
|
| GroupByKey |
string |
The dimension by which the resources are grouped. |
ResourceType |
| RequestId |
string |
The request ID. |
6D98D9B0-318D-56A4-910C-93B5F945AF2B |
| ResourceCounts |
array<object> |
The list of resource counts. |
|
|
object |
The resource count. |
||
| Count |
integer |
The number of resources. |
2 |
| GroupName |
string |
The group name. |
ACS::ECS::NetworkInterface |
Examples
Success response
JSON format
{
"Filters": [
{
"Key": "RegionId",
"Values": [
"cn-shanghai"
]
}
],
"GroupByKey": "ResourceType",
"RequestId": "6D98D9B0-318D-56A4-910C-93B5F945AF2B",
"ResourceCounts": [
{
"Count": 2,
"GroupName": "ACS::ECS::NetworkInterface"
}
]
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameter.Filter.ResourceType | The specified parameter value of Filter.ResourceType is not valid. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.