Queries the resource groups in the current account.
Operation description
Queries all resource groups under the current account. You can filter results by resource group status, ID, identifier, or display name.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Status |
string |
No |
The resource group status. Valid values:
|
OK |
| PageNumber |
integer |
No |
The number of the page to return. Pages start from page 1. Default value: 1. |
1 |
| PageSize |
integer |
No |
The number of entries to return on each page. Valid values: 1 to 100. Default value: 10. |
10 |
| ResourceGroupId |
string |
No |
The resource group ID. Maximum 18 characters. Must start with Note
This parameter is merged into |
rg-9gLOoK**** |
| DisplayName |
string |
No |
The resource group display name. Supports fuzzy match. Maximum 50 characters. |
my-project |
| Name |
string |
No |
The resource group identifier. Supports fuzzy match. Maximum 50 characters. Allows letters, digits, and hyphens (-). |
my-project |
| Tag |
array<object> |
No |
The tags to filter by. |
|
|
object |
No |
The tag filter conditions. You can specify up to 20 tags. |
||
| Key |
string |
No |
The tag key. |
k1 |
| Value |
string |
No |
The tag value. |
v1 |
| IncludeTags |
boolean |
No |
Whether to return tag information. Valid values:
Note
If the Tag parameter is specified, tag information is always returned regardless of |
false |
| ResourceGroupIds |
array |
No |
The resource group IDs to filter by. You can specify a maximum of 100 resource group IDs. Note
If you configure both the |
|
|
string |
No |
The resource group IDs. You can specify up to 100 resource group IDs. Note
If both |
{"rg-1hSBH2****","rg-9gLOoK****"} |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| PageNumber |
integer |
The page number. |
1 |
| PageSize |
integer |
The number of entries returned per page. |
10 |
| RequestId |
string |
The ID of the request. |
4B450CA1-36E8-4AA2-8461-86B42BF4CC4E |
| ResourceGroups |
object |
||
| ResourceGroup |
array<object> |
The resource group details. |
|
|
array<object> |
The list of resource groups. |
||
| AccountId |
string |
The Alibaba Cloud account ID of the resource group owner. |
123456789**** |
| CreateDate |
string |
The creation time of the resource group, in UTC. |
2015-01-23T12:33:18Z |
| DisplayName |
string |
The display name of the resource group. |
my-project |
| Id |
string |
The ID of the resource group. |
rg-9gLOoK**** |
| Name |
string |
The identifier of the resource group. |
my-project |
| Status |
string |
The status of the resource group. Valid values:
|
OK |
| Tags |
object |
||
| Tag |
array<object> |
The resource group tags. |
|
|
object |
The tag list. |
||
| TagKey |
string |
The tag key. |
k1 |
| TagValue |
string |
The tag value. |
v1 |
| TotalCount |
integer |
The total number of entries returned. |
2 |
Examples
Success response
JSON format
{
"PageNumber": 1,
"PageSize": 10,
"RequestId": "4B450CA1-36E8-4AA2-8461-86B42BF4CC4E",
"ResourceGroups": {
"ResourceGroup": [
{
"AccountId": "123456789****",
"CreateDate": "2015-01-23T12:33:18Z",
"DisplayName": "my-project",
"Id": "rg-9gLOoK****",
"Name": "my-project",
"Status": "OK",
"Tags": {
"Tag": [
{
"TagKey": "k1",
"TagValue": "v1"
}
]
}
}
]
},
"TotalCount": 2
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.