ListResourceGroups
Retrieves a list of resource groups for general compute resources or Lingjun AI compute resources.
Operation description
Currently, AI compute resource groups, including general compute resources and Lingjun AI compute resources, are available only in specific regions. For the list of supported regions, see AI compute resource management.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
pai:ListResourceGroups |
list |
*All Resource
|
None | None |
Request syntax
GET /api/v1/resources HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Name |
string |
No |
The name of the resource group. |
rgf0zhfqn1d4ity2 |
| PageNumber |
integer |
No |
The page number. |
2 |
| PageSize |
integer |
No |
The number of entries per page. |
10 |
| Order |
string |
No |
The sort order. Valid values:
|
desc |
| SortBy |
string |
No |
The name of the field used for sorting. Valid values: DisplayName, GmtCreated, GmtModified, RegionID, Duration, PricingCycle, and PayType. |
DisplayName |
| Status |
string |
No |
The status of the resource group. |
Creating |
| ShowAll |
boolean |
No |
Specifies whether to return all results. |
false |
| ComputingResourceProvider |
string |
No |
The compute resource type of the resource group. |
Ecs |
| ResourceType |
string |
No |
The list of resource types. Valid values:
|
Lingjun |
| ResourceGroupIDs |
string |
No |
The list of resource group IDs. |
rg123,rg456 |
| HasResource |
boolean |
No |
Specifies whether the resource group contains resources. |
|
| Versions |
string |
No |
The version to search for. |
1.0 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response. |
||
| ResourceGroups |
array |
The list of resource groups. |
[{"Name":"RG1"}] |
| ResourceGroup |
The resource group. |
||
| TotalCount |
integer |
The total number of resource groups returned. |
2 |
| RequestId |
string |
The request ID. |
9CFA2665-1FFE-5929-8468-C14C25890486 |
Examples
Success response
JSON format
{
"ResourceGroups": [
{
"Name": "RG1",
"ResourceGroupID": "rg17tmvwiokh****",
"WorkspaceID": "23000",
"UserVpc": {
"VpcId": "vpc-abcdef****",
"SwitchId": "vs-abcdef****",
"SecurityGroupId": "sg-abcdef****",
"ExtendedCIDRs": [
"\"192.168.0.1/24\""
],
"RoleArn": "acs:ram::25xxxx:role/AliyunPAIDLCDefaultRole",
"DefaultRoute": "eth0",
"DefaultForwardInfo": {
"NatGatewayId": "nat-7j4mka9wguxj",
"EipAllocationId": "eip-h29r78ieufbih"
}
},
"GmtCreatedTime": "2023-06-22T00:00:00Z",
"GmtModifiedTime": "2023-06-22T00:00:00Z",
"CreatorID": "161228528250****",
"NodeCount": 3,
"Version": "1.0",
"Status": "Ready",
"ResourceType": "Ecs"
}
],
"TotalCount": 2,
"RequestId": "9CFA2665-1FFE-5929-8468-C14C25890486"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.