ListResourceGroups

Updated at:

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

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

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: descending order

  • asc: ascending order

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:

  • ECS: general compute resources

  • Lingjun: Lingjun AI compute resources

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.