ListResources

Updated at:

Lists the resources associated with a workspace.

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

paiworkspace:ListResources

list

*All Resource

*

None None

Request syntax

GET /api/v1/resources HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

WorkspaceId

string

No

The workspace ID. For more information about how to obtain a workspace ID, see ListWorkspaces.

  • If the Option parameter is set to ListResourceByWorkspace, this parameter is required.

  • If the Option parameter is set to ListResource, you do not need to specify this parameter.

123

PageNumber

integer

No

The page number of the resources. Pages start from 1. Default value: 1.

1

PageSize

integer

No

The number of entries to return on each page in a paged query. Default value: 20.

20

ProductTypes

string

No

[Deprecated] This field is deprecated and will be removed. Use the ResourceType field instead.

MaxCompute

GroupName

string

No

The name of the resource group. For more information about how to obtain the name of a resource group, see ListResources.

group

ResourceName

string

No

The name of the resource. The name must meet the following requirements:

  • The name must be 3 to 28 characters in length.

  • The name must be unique within the same region.

resource

Option

string

No

The option. Valid values:

  • ListResourceByWorkspace (default): Retrieves the list of resources in a workspace.

  • ListResource: Retrieves the list of resources of a user.

ListResourceByWorkspace

Verbose

boolean

No

Specifies whether to display detailed information. Currently, the detailed information includes the Quotas field. Valid values:

  • true (default): Displays detailed information.

  • false: Does not display detailed information.

true

ResourceTypes

string

No

The list of resource types. Valid values:

  • MaxCompute: MaxCompute resources

  • ECS: general computing resources

  • Lingjun: Lingjun AI computing resources

  • ACS: ACS compute resources

  • FLINK: Flink resources

  • SelfManagedAckPro: ACK Pro unified management cluster resources

  • SelfManagedAckLingjun: ACK Lingjun unified management cluster resources

  • SelfManagedASI: ASI unified management cluster resources (third-party cloud)

MaxCompute

QuotaIds

string

No

The collection of quota IDs, separated by commas. Only resources that have all these quota IDs are returned.

Note

Currently, only resources whose ResourceTypes is set to ACS support filtering by this parameter.

quota-k******da,quota-cd******w

Labels

string

No

The collection of label filter conditions, separated by commas. Only resources that meet all these label conditions are returned.

Currently, only resources whose ProductType is set to ACS support filtering by this parameter.

system.supported.dsw=true,system.supported.dlc=true

VerboseFields

string

No

The collection of fields to return, separated by commas. Valid values:

  • Quota

  • Label

  • IsDefault

Quota,IsDefault

Response elements

Element

Type

Description

Example

object

The response struct.

RequestId

string

The request ID.

1e195c5116124202371861018d5bde

Resources

array<object>

The resources.

array<object>

The resource information.

Id

string

The resource ID.

123

Name

string

The resource name.

ResourceName

ProductType

string

[Deprecated] This field is deprecated and will be removed. Use the ResourceType field instead.

MaxCompute

EnvType

string

The environment type. Valid values:

  • dev: development environment

  • prod: production environment

prod

WorkspaceId

string

The ID of the workspace.

123

IsDefault

boolean

Indicates whether the resource is the default resource. Each resource type has a default resource. Valid values:

  • true: The resource is the default resource.

  • false: The resource is not the default resource.

true

Quotas

array<object>

The quotas.

array<object>

The quota information.

Name

string

The quota name.

QuotaName

ProductCode

string

The product name. Valid values:

  • PAI_isolate: subscription resource group for PAI (PAI CPU)

  • PAI_share: pay-as-you-go resource group for PAI (PAI GPU)

  • MaxCompute_share: pay-as-you-go resource group for MaxCompute

  • MaxCompute_isolate: subscription resource group for MaxCompute

  • DataWorks_isolate: subscription resource group for DataWorks

  • DataWorks_share: pay-as-you-go resource group for DataWorks

  • DLC_share: pay-as-you-go resource group for DLC

MaxCompute_isolate

QuotaType

string

The resource quota type. Valid values:

  • PAI

  • MaxCompute

  • DLC

MaxCompute

Mode

string

The billing mode. Valid values:

  • isolate: subscription

  • share: pay-as-you-go

isolate

Specs

array<object>

The list of specification descriptions.

{\"cu\":\"11500\",\"minCu\":\"2300\",\"parentId\":\"0\"}

object

The specification description information.

Name

string

The specification name.

cu

Value

string

The specification description.

11500

CardType

string

The card type. Valid values:

  • CPU

  • GPU

CPU

Id

string

The resource quota ID.

123

DisplayName

string

The alias of the resource quota.

Default pay-as-you-go quota

Spec

object

The specification description.

This example applies to MaxCompute.

{"Endpoint":"odps.alibaba-inc.com","Project":"mignshi"}

GroupName

string

The resource group name, which is unique within the Alibaba Cloud account.

groupName

GmtCreateTime

string

The creation time in UTC. The time format is ISO 8601.

2021-01-21T17:12:35.232Z

Executor

object

[Deprecated] This field is invalid and has been deprecated.

OwnerId

string

[Deprecated] This field is invalid and has been deprecated.

110973******7793

Encryption

object

The encryption information. This field is valid only for MaxCompute resources.

Enabled

boolean

Indicates whether encryption is enabled.

false

Algorithm

string

The encryption algorithm.

AESCTR

Key

string

The encryption master key.

DEFAULT

ResourceType

string

The resource type. Valid values:

  • MaxCompute: big data computing EPS resource

  • ECS: general-purpose compute resource

  • Lingjun: Lingjun AI computing resource

  • ACS: ACS compute resource

  • FLINK: Flink resource

  • SelfManagedAckPro: ACK Pro unified management cluster resource

  • SelfManagedAckLingjun: ACK Lingjun unified management cluster resource

  • SelfManagedASI: ASI unified management cluster resource (third-party cloud)

MaxCompute

Labels

array<object>

The set of labels.

object

The label.

Key

string

The key of the label.

system.supported.dsw

Value

string

The value of the label.

true

TotalCount

integer

The number of resources that meet the filter conditions.

2

Examples

Success response

JSON format

{
  "RequestId": "1e195c5116124202371861018d5bde",
  "Resources": [
    {
      "Id": "123",
      "Name": "ResourceName",
      "ProductType": "MaxCompute",
      "EnvType": "prod",
      "WorkspaceId": "123",
      "IsDefault": true,
      "Quotas": [
        {
          "Name": "QuotaName",
          "ProductCode": "MaxCompute_isolate",
          "QuotaType": "MaxCompute",
          "Mode": "isolate",
          "Specs": [
            {
              "Name": "cu",
              "Value": "11500"
            }
          ],
          "CardType": "CPU",
          "Id": "123",
          "DisplayName": "默认后付费Quota"
        }
      ],
      "Spec": {
        "Endpoint": "odps.alibaba-inc.com",
        "Project": "mignshi"
      },
      "GroupName": "groupName",
      "GmtCreateTime": "2021-01-21T17:12:35.232Z",
      "Executor": {
        "OwnerId": "110973******7793"
      },
      "Encryption": {
        "Enabled": false,
        "Algorithm": "AESCTR",
        "Key": "DEFAULT"
      },
      "ResourceType": "MaxCompute",
      "Labels": [
        {
          "Key": "system.supported.dsw",
          "Value": "true"
        }
      ]
    }
  ],
  "TotalCount": 2
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.