ListResourceGroups

更新时间:
复制 MD 格式

Retrieves a list of resource groups.

Operation description

  1. This operation requires DataWorks Basic Edition or higher.

  2. Before you call this operation, make sure that you have created the service-linked role AliyunServiceRoleForDataWorks.

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

list

*DwResourceGroup

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

None None

Request parameters

Parameter

Type

Required

Description

Example

Name

string

No

The name of the resource group. Fuzzy search is supported.

Resource

ProjectId

integer

No

The ID of the workspace.

1000

Statuses

array

No

The statuses of the resource groups to query.

string

No

The status of the resource group. Valid values include:

  • Normal: The resource group is running.

  • Stop: The resource group is stopped, typically because it has expired.

  • Deleted: The resource group is deleted, released, or destroyed.

  • Creating: The resource group is being created.

  • CreateFailed: The resource group failed to be created.

  • Updating: The resource group is being updated, for example, by scaling up, scaling down, or changing configurations.

  • UpdateFailed: The resource group failed to be updated, for example, due to a scaling or upgrade failure.

  • Deleting: The resource group is being deleted, released, or destroyed.

  • DeleteFailed: The resource group failed to be deleted, for example, due to a release or destroy failure.

  • Timeout: The operation has timed out.

  • Frozen: The resource group is frozen.

  • Starting: The resource group is starting.

Normal

ResourceGroupTypes

array

No

The types of the resource groups to query. If this parameter is not specified, general-purpose resource groups are queried by default.

string

No

The type of the resource group. Valid values include:

  • CommonV2: General-purpose resource group (new version).

  • ExclusiveDataIntegration: exclusive data integration resource group.

  • ExclusiveScheduler: exclusive scheduler resource group.

  • ExclusiveDataService: exclusive data service resource group.

CommonV2

PaymentType

string

No

The billing method of the resource group. Valid values include:

  • PrePaid: subscription.

  • PostPaid: pay-as-you-go.

PrePaid

AliyunResourceGroupId

string

No

The Alibaba Cloud resource group ID.

rg-aek2kqofrgXXXXX

AliyunResourceTags

array<object>

No

The list of Alibaba Cloud tags.

object

No

An Alibaba Cloud tag.

Key

string

No

The tag key.

key

Value

string

No

The tag value.

value

PageSize

integer

No

The page size.

100

PageNumber

integer

No

The page number.

1

SortBy

string

No

The sorting criterion for the results. The format is FieldName SortOrder. SortOrder can be Asc (ascending) or Desc (descending). If you do not specify SortOrder, the default is Asc. The following fields are supported:

  • Id: Resource group ID

  • Name: Resource group name

  • Remark: Resource group remarks

  • Type: Resource group type

  • Status: Resource group status

  • Spec: Resource group specifications

  • CreateUser: The user who created the resource group

  • CreateTime: The time when the resource group was created

Default value: CreateTime Asc

CreateTime Asc

Response elements

Element

Type

Description

Example

object

The data returned.

Success

boolean

Indicates whether the request was successful.

true

PagingInfo

object

The pagination information.

ResourceGroupList

array<object>

The list of resource groups.

array<object>

The details of a resource group.

Id

string

The unique identifier of the resource group.

Serverless_res_group_524257424564736_6831777003XXXXX

Name

string

The name of the resource group.

common_resource_group

Remark

string

The description of the resource group.

创建用于普通任务的通用资源组

PaymentType

string

The billing method of the resource group. PrePaid indicates subscription and PostPaid indicates pay-as-you-go.

PrePaid

Status

string

The status of the resource group. Valid values:

  • Normal: Running.

  • Stop: Frozen due to expiration.

  • Deleted: Released.

  • Creating: Creation in progress.

  • CreateFailed: Creation failed.

  • Updating: Update in progress.

  • UpdateFailed: Update failed.

  • Deleting: Release in progress.

  • DeleteFailed: Release failed.

  • Timeout: The operation timed out.

  • Freezed: Frozen.

  • Starting: Starting.

Normal

Spec

object

The specifications of the resource group.

Standard

string

The resource specifications.

2CU

Amount

integer

The number of resource units.

1

ResourceGroupType

string

The type of the resource group. Valid values:

  • CommonV2: The new general-purpose resource group.

  • ExclusiveDataIntegration: The exclusive resource group for data integration.

  • ExclusiveScheduler: The exclusive resource group for scheduling.

  • ExclusiveDataService: The exclusive resource group for data services.

CommonV2

OrderInstanceId

string

The ID of the order for the resource group.

c442b330-3b10-4584-959e-736e4edXXXXX

CreateUser

string

The user ID of the creator.

11075500042XXXXX

CreateTime

integer

The creation time of the resource group, as a 64-bit timestamp.

1727055811000

DefaultVpcId

string

The ID of the default Virtual Private Cloud (VPC) bound to the general-purpose resource group.

vpc-m2et4f3oc8msfbccXXXXX

DefaultVswicthId

string

The ID of the default vSwitch bound to the general-purpose resource group.

vsw-uf8usrhs7hjd9amsXXXXX

AliyunResourceGroupId

string

The Alibaba Cloud resource group ID.

rg-aek2kqofrgXXXXX

AliyunResourceTags

array<object>

A list of Alibaba Cloud tags.

object

An Alibaba Cloud tag.

Key

string

The tag key.

Key

Value

string

The tag value.

Value

PageNumber

integer

The page number.

1

PageSize

integer

The number of entries per page.

100

TotalCount

integer

The total number of entries.

100

RequestId

string

The request ID. You can use this ID to locate logs and troubleshoot issues.

6A6CBE87-9F91-1323-B680-E7A7065XXXXX

Examples

Success response

JSON format

{
  "Success": true,
  "PagingInfo": {
    "ResourceGroupList": [
      {
        "Id": "Serverless_res_group_524257424564736_6831777003XXXXX",
        "Name": "common_resource_group",
        "Remark": "创建用于普通任务的通用资源组",
        "PaymentType": "PrePaid",
        "Status": "Normal",
        "Spec": {
          "Standard": "2CU",
          "Amount": 1
        },
        "ResourceGroupType": "CommonV2",
        "OrderInstanceId": "c442b330-3b10-4584-959e-736e4edXXXXX",
        "CreateUser": "11075500042XXXXX",
        "CreateTime": 1727055811000,
        "DefaultVpcId": "vpc-m2et4f3oc8msfbccXXXXX",
        "DefaultVswicthId": "vsw-uf8usrhs7hjd9amsXXXXX",
        "AliyunResourceGroupId": "rg-aek2kqofrgXXXXX",
        "AliyunResourceTags": [
          {
            "Key": "Key",
            "Value": "Value"
          }
        ]
      }
    ],
    "PageNumber": 1,
    "PageSize": 100,
    "TotalCount": 100
  },
  "RequestId": "6A6CBE87-9F91-1323-B680-E7A7065XXXXX"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.