ListResourceGroups

Updated at:

Queries the list of resource groups of a specified type.

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

dataworks:ListResourceGroups

get

TenantResourceGroup

acs:dataworks:{#regionId}:{#accountId}:exclusive_resource_group/*

None None

Request parameters

Parameter

Type

Required

Description

Example

ResourceGroupType

integer

No

The type ID of the resource group to query. Valid values:

  • 0: DataWorks

  • 1: scheduling

  • 2: MaxCompute

  • 3: PAI

  • 4: data integration

  • 7: the purchase resource ID generated when you purchase a dedicated schedule resource group

  • 9: dataService

  • Default value: 1 (scheduling).

When the value represents an engine, the returned resource group list contains the resource groups created when you purchased that type of engine.

3

Keyword

string

No

The keyword. Used for fuzzy matching of resource group names and resource group identifiers.

abc

BizExtKey

string

No

The category of the resource group. Valid values:

  • default: default value; public resource group.

  • single: dedicated resource group.

default

ResourceManagerResourceGroupId

string

No

The resource group ID.

rg-acfmzbn7pti3zfa

Tags

array<object>

No

The list of tags.

object

No

The tag information.

Key

string

No

The tag key.

Env

Value

string

No

The tag value.

Test

Response elements

Element

Type

Description

Example

object

The response parameters.

HttpStatusCode

integer

The HTTP status code.

200

RequestId

string

The request ID.

0bc1411515937635973****

Success

boolean

Indicates whether the request was successful.

true

Data

array<object>

The list of resource groups.

array<object>

The details of the resource group.

Status

integer

The status of the resource group. Valid values:

  • NORMAL(0): The resource group is running or in service.

  • STOP(1): The resource group has expired and is frozen.

  • DELETED(2): The resource group has been released or destroyed.

  • CREATING(3): The resource group is being created or started.

  • CREATE_FAILED(4): The resource group failed to be created or started.

  • UPDATING(5): The resource group is being scaled out or upgraded.

  • UPDATE_FAILED(6): The resource group failed to be scaled out or upgraded.

  • DELETING(7): The resource group is being released or destroyed.

  • DELETE_FAILED(8): The resource group failed to be released or destroyed.

  • TIMEOUT(9): The operation performed on the resource group timed out. All change operations may time out. This value is temporarily available only for DataService.

0

UpdateTime

string

The time when the resource group was last updated.

The format is MMM d, yyyy h:mm:ss a, for example, Jul 9, 2018 2:43:37 PM.

Jul 9, 2018 2:43:37 PM

IsDefault

boolean

Indicates whether the resource group is the default resource group. Valid values:

  • true: The resource group is the default resource group.

  • false: The resource group is not the default resource group.

true

Cluster

string

The name of the cluster. This parameter is valid only for MaxCompute and PAI resource group types.

AY18G

EnableKp

boolean

Indicates whether Kp (key person) access is used. Valid values:

  • true: The MaxCompute engine uses the Alibaba Cloud account UID as the display name of the access account.

  • false: The MaxCompute engine uses the Alibaba Cloud account name as the display name of the access account. This parameter is meaningless for other types and is valid only for the MaxCompute engine.

false

ResourceGroupType

string

The type of the resource group. Valid values:

  • 0: DataWorks

  • 2: MaxCompute

  • 3: PAI

  • 4: data integration

  • 7: scheduling

  • 9: dataService

3

CreateTime

string

The time when the cluster was created. The format is Jul 9, 2018 2:43:37 PM.

Jul 9, 2018 2:43:37 PM

Identifier

string

The identifier of the resource group.

e1815577-2f4e-4c5e-b29****

Mode

string

The type of the resource group. Valid values:

  • ISOLATE: a prepaid dedicated resource group.

  • SHARE: a pay-as-you-go public resource group.

  • DEVELOP: a developer edition.

SHARE

BizExtKey

string

The category of the resource group. Valid values:

  • default: public resource group.

  • single: dedicated resource group.

default

Sequence

integer

The sequence field. Used to sort created resource groups in ascending order by creation sequence number.

300

Specs

object

The detailed information of the resource group. The content displayed in {} is the detailed information of the resource group.

{}

Name

string

The name of the resource group.

abc

Id

integer

The ID of the resource group.

1234567

TenantId

integer

The tenant ID.

1234567

ResourceManagerResourceGroupId

string

The resource group ID.

rg-acfmzbn7pti3zfa

Tags

array<object>

The list of tags.

object

The tag information.

Key

string

The tag key.

Env

Value

string

The tag value.

Test

Examples

Success response

JSON format

{
  "HttpStatusCode": 200,
  "RequestId": "0bc1411515937635973****",
  "Success": true,
  "Data": [
    {
      "Status": 0,
      "UpdateTime": "Jul 9, 2018 2:43:37 PM",
      "IsDefault": true,
      "Cluster": "AY18G",
      "EnableKp": false,
      "ResourceGroupType": "3",
      "CreateTime": "Jul 9, 2018 2:43:37 PM",
      "Identifier": "e1815577-2f4e-4c5e-b29****",
      "Mode": "SHARE",
      "BizExtKey": "default",
      "Sequence": 300,
      "Specs": {},
      "Name": "abc",
      "Id": 1234567,
      "TenantId": 1234567,
      "ResourceManagerResourceGroupId": "rg-acfmzbn7pti3zfa",
      "Tags": [
        {
          "Key": "Env",
          "Value": "Test"
        }
      ]
    }
  ]
}

Error codes

HTTP status code

Error code

Error message

Description

400 Invalid.Tenant.ConnectionNotExists The connection does not exist. The connection does not exist.
400 Invalid.Tenant.ProjectNotExists The project does not exist. The project does not exist.
400 Invalid.Tenant.UserNotInProject The user is not in the project. The user is not in the project.
403 Invalid.Tenant.UserIsNotProjectOwnerOrAdmin The user is not a project administrator or owner. The user is not a project administrator or owner.
403 Invalid.Tenant.UserNotInTenant The user is not in tenant. The user is not in tenant.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.