All Products
Search
Document Center

E-MapReduce:ListWorkspaces

Last Updated:Jul 15, 2026

Queries a list of workspaces.

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

emr-serverless-spark:ListWorkspaces

list

*All Resource

*

None None

Request syntax

GET /api/v1/workspaces HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

nextToken

string

No

The pagination token that marks the current read position.

1

maxResults

integer

No

The maximum number of records to retrieve in a single request.

20

name

string

No

The name of the workspace. Fuzzy match is supported.

test_workspace

state

string

No

The workspace status.

running

regionId

string

No

The region ID.

cn-hangzhou

tag

array<object>

No

object

No

key

string

No

cn-shenzhen-finance.edas.config.server

value

string

No

iPhone disk space remaining rate

resourceGroupId

string

No

The ID of the resource group.

rg-aek2thxggoqhmhq

Response elements

Element

Type

Description

Example

object

The response data.

workspaces

array<object>

The list of workspaces.

array<object>

The workspace details.

workspaceId

string

Workspace ID。

w-******

workspaceName

string

The workspace name.

Spark batch workspace-1

resourceSpec

string

The resource specification.

100cu

storage

string

The OSS path.

spark-result

dlfCatalogId

string

The DLF Catalog information.

default

paymentType

string

The payment type.

PayAsYouGo or Subscription

paymentDurationUnit

string

The subscription period unit. This parameter is required for the prepaid type.

YEAR, MONTH, WEEK, DAY, HOUR, MINUTE

duration

integer

The subscription period quantity. This parameter is required for the prepaid type.

1

autoRenew

boolean

Indicates whether auto-renewal is enabled. This parameter is required for the prepaid type.

true

autoRenewPeriod

integer

The auto-renewal duration. This parameter is required for the prepaid type.

1

autoRenewPeriodUnit

string

The auto-renewal epoch unit. This parameter is required for the prepaid type.

YEAR, MONTH, WEEK, DAY, HOUR, MINUTE

workspaceStatus

string

The workspace status.

STARTING,RUNNING,TERMINATED

failReason

string

The failure reason.

out of stock

paymentStatus

string

The payment status.

PAID/UNPAID

regionId

string

The region ID.

cn-shanghai

createTime

integer

The time when the workspace was created.

1684115879955

endTime

integer

The time when the workspace was released.

1687103999999

stateChangeReason

object

The state change information of the workspace.

code

string

Error code.

0

message

string

Error message.

Success

releaseType

string

The reason why the workspace was released.

SERVICE_RELEASE

dlfType

string

The DLF binding type.

1.0

prePaidQuota

object

The prepaid resource quota information.

usedResource

string

The amount of resources currently in use.

{\"cpu\":\"0\",\"memory\":\"0Gi\",\"cu\":\"0\"}

maxResource

string

The maximum amount of resources.

{\"cpu\":\"1\",\"memory\":\"4Gi\",\"cu\":\"1\"}

allocatedResource

string

The amount of resources that are currently allocated.

{\"cpu\":\"1\",\"memory\":\"4Gi\",\"cu\":\"1\"}

createTime

integer

The creation time of the resource quota.

1745683200000

expireTime

integer

The expiration time of the resource quota.

1740537153000

autoRenewal

boolean

Whether auto-renewal is enabled for the resource.

  • true: Enables auto-renewal. The resource is automatically renewed after it expires.

  • false: Auto-renewal is disabled. The resource is stopped upon expiration.

true

paymentStatus

string

The payment status of the current resource. The possible values are as follows:

  • NORMAL: Active.

  • WAIT_FOR_EXPIRE: Will expire.

  • EXPIRED: The item has expired.

NORMAL

instanceId

string

The resource instance ID that is associated with the quota.

i-abc12345

orderId

string

The order ID.

23464687565

prePaidQuotaGpu

array<object>

object

orderId

string

2534863936

instanceId

string

w-xxxxxxxxx-gpu-quota-xxxx

createTime

integer

1782292672000

expireTime

integer

1782292772000

autoRenewal

boolean

paymentStatus

string

NORMAL

gpuSpec

string

ecs.gn7i-c8g1.2xlarge

gpuNum

integer

8

gpuMachineNum

integer

4

instanceTypeId

string

instanceTypeFamily

string

cpuCoreCount

string

gpuAmount

integer

memorySize

string

gpuMemorySize

integer

tags

array<object>

object

tagKey

string

The tag key.

tagValue

string

The tag value.

resourceGroupId

string

The resource group ID.

rg-xxxxxxxxxx

gpuSpec

array

The GPU specifications.

string

A GPU specification.

ecs.gn7i-c8g1.2xlarge

ipWhiteList

array

string

0.0.0.1

requestId

string

The request ID.

DD6B1B2A-5837-5237-ABE4-FF0C8944****

nextToken

string

The token for the next page.

1

maxResults

integer

The maximum number of records to retrieve in a single request.

20

totalCount

integer

The total number of records.

200

Examples

Success response

JSON format

{
  "workspaces": [
    {
      "workspaceId": "w-******",
      "workspaceName": "Spark batch workspace-1",
      "resourceSpec": "100cu",
      "storage": "spark-result",
      "dlfCatalogId": "default",
      "paymentType": "PayAsYouGo or Subscription",
      "paymentDurationUnit": "YEAR, MONTH, WEEK, DAY, HOUR, MINUTE",
      "duration": 1,
      "autoRenew": true,
      "autoRenewPeriod": 1,
      "autoRenewPeriodUnit": "YEAR, MONTH, WEEK, DAY, HOUR, MINUTE",
      "workspaceStatus": "STARTING,RUNNING,TERMINATED",
      "failReason": "out of stock",
      "paymentStatus": "PAID/UNPAID",
      "regionId": "cn-shanghai",
      "createTime": 1684115879955,
      "endTime": 1687103999999,
      "stateChangeReason": {
        "code": "0",
        "message": "Success"
      },
      "releaseType": "SERVICE_RELEASE",
      "dlfType": "1.0",
      "prePaidQuota": {
        "usedResource": "{\\\"cpu\\\":\\\"0\\\",\\\"memory\\\":\\\"0Gi\\\",\\\"cu\\\":\\\"0\\\"}",
        "maxResource": "{\\\"cpu\\\":\\\"1\\\",\\\"memory\\\":\\\"4Gi\\\",\\\"cu\\\":\\\"1\\\"}",
        "allocatedResource": "{\\\"cpu\\\":\\\"1\\\",\\\"memory\\\":\\\"4Gi\\\",\\\"cu\\\":\\\"1\\\"}",
        "createTime": 1745683200000,
        "expireTime": 1740537153000,
        "autoRenewal": true,
        "paymentStatus": "NORMAL",
        "instanceId": "i-abc12345",
        "orderId": "23464687565"
      },
      "prePaidQuotaGpu": [
        {
          "orderId": "2534863936",
          "instanceId": "w-xxxxxxxxx-gpu-quota-xxxx",
          "createTime": 1782292672000,
          "expireTime": 1782292772000,
          "autoRenewal": true,
          "paymentStatus": "NORMAL",
          "gpuSpec": "ecs.gn7i-c8g1.2xlarge",
          "gpuNum": 8,
          "gpuMachineNum": 4,
          "instanceTypeId": "",
          "instanceTypeFamily": "",
          "cpuCoreCount": "",
          "gpuAmount": 0,
          "memorySize": "",
          "gpuMemorySize": 0
        }
      ],
      "tags": [
        {
          "tagKey": "",
          "tagValue": ""
        }
      ],
      "resourceGroupId": "rg-xxxxxxxxxx",
      "gpuSpec": [
        "ecs.gn7i-c8g1.2xlarge"
      ],
      "ipWhiteList": [
        "0.0.0.1"
      ]
    }
  ],
  "requestId": "DD6B1B2A-5837-5237-ABE4-FF0C8944****",
  "nextToken": "1",
  "maxResults": 20,
  "totalCount": 200
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.