All Products
Search
Document Center

E-MapReduce:ListSessionClusters

Last Updated:Dec 22, 2025

Retrieves a list of session clusters.

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:ListSessionClusters

list

*All Resource

*

None None

Request syntax

GET /api/v1/workspaces/{workspaceId}/sessionClusters HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

workspaceId

string

No

The workspace ID.

w-1234abcd

Request parameters

Parameter

Type

Required

Description

Example

nextToken

string

No

The token that marks the start of the next page of results.

1

maxResults

integer

No

The maximum number of records to return.

20

sessionClusterId

string

No

The name of the job.

emr-spark-demo-job

queueName

string

No

The queue name.

root

kind

string

No

The session type.

Valid values:

  • NOTEBOOK :

    NOTEBOOK

  • THRIFT :

    THRIFT

  • SQL :

    SQL

SQL

regionId

string

No

The region ID.

cn-hangzhou

Response elements

Element

Type

Description

Example

object

The returned data.

sessionClusters

array<object>

A list of sessions.

array<object>

The session details.

workspaceId

string

The workspace ID.

w-1234abcd

sessionClusterId

string

The session ID.

sc-123131

userId

string

The user ID.

123131

queueName

string

The name of the queue in which the session runs.

dev_queue

state

string

The session state.

  • Starting: The session is starting.

  • Running: The session is running.

  • Stopping: The session is stopping.

  • Stopped: The session is stopped.

  • Error: The session has failed.

Running

stateChangeReason

object

The details of the last state change of the session.

code

string

The state change code.

200

message

string

The state change message.

ok

autoStartConfiguration

object

The auto-start configuration.

enable

boolean

Indicates whether auto-start is enabled.

true

autoStopConfiguration

object

The auto-stop configuration.

enable

boolean

Indicates whether auto-stop is enabled.

false

idleTimeoutMinutes

integer

The number of minutes of inactivity before the session is automatically stopped.

45

applicationConfigs

array<object>

The session configurations. These are equivalent to the configurations of the underlying Spark job.

object

The SQL Compute configurations. These are equivalent to the configurations of the underlying Spark job.

configFileName

string

The configuration file name.

spark-default.conf

configItemKey

string

The configuration key.

spark.app.name

configItemValue

string

The configuration value.

test_application

name

string

The session name.

adhoc_query

userName

string

The username.

test_user

kind

string

The session type.

Valid values:

  • NOTEBOOK :

    NOTEBOOK

  • THRIFT :

    THRIFT

  • SQL :

    SQL

SQL

webUI

string

The URL of the Spark UI for the session.

http://spark-ui-xxxx

releaseVersion

string

The Serverless Spark version.

esr-4.0.0 (Spark 3.5.2, Scala 2.12)

draftId

string

The ID of the developer job that is attached to the session.

TSK-xxxxxxxxx

domain

string

The public endpoint of the Thrift server.

emr-spark-gateway-cn-hangzhou.data.aliyun.com

displayReleaseVersion

string

The version displayed in the console.

esr-4.0.0 (Spark 3.5.2, Scala 2.12)

fusion

boolean

Indicates whether acceleration by the Fusion engine is enabled.

false

gmtCreate

integer

The time when the session was created.

1732267598000

startTime

integer

The time when the session was started.

1732267598000

domainInner

string

The internal same-region endpoint of the Thrift server.

emr-spark-gateway-cn-hangzhou-internal.data.aliyuncs.com

extra

string

The extra metadata of the session.

{"extraInfoKey":"extraInfoValue"}

publicEndpointEnabled

boolean

connectionToken

string

requestId

string

The request ID.

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

nextToken

string

The token that marks the start of the next page of results.

1

maxResults

integer

The maximum number of entries returned for the request.

20

totalCount

integer

The total number of entries that match the query criteria.

200

Examples

Success response

JSON format

{
  "sessionClusters": [
    {
      "workspaceId": "w-1234abcd",
      "sessionClusterId": "sc-123131",
      "userId": "123131",
      "queueName": "dev_queue",
      "state": "Running",
      "stateChangeReason": {
        "code": "200",
        "message": "ok"
      },
      "autoStartConfiguration": {
        "enable": true
      },
      "autoStopConfiguration": {
        "enable": false,
        "idleTimeoutMinutes": 45
      },
      "applicationConfigs": [
        {
          "configFileName": "spark-default.conf",
          "configItemKey": "spark.app.name",
          "configItemValue": "test_application"
        }
      ],
      "name": "adhoc_query",
      "userName": "test_user",
      "kind": "SQL",
      "webUI": "http://spark-ui-xxxx",
      "releaseVersion": "esr-4.0.0 (Spark 3.5.2, Scala 2.12)",
      "draftId": "TSK-xxxxxxxxx\n",
      "domain": "emr-spark-gateway-cn-hangzhou.data.aliyun.com",
      "displayReleaseVersion": "esr-4.0.0 (Spark 3.5.2, Scala 2.12)",
      "fusion": false,
      "gmtCreate": 1732267598000,
      "startTime": 1732267598000,
      "domainInner": "emr-spark-gateway-cn-hangzhou-internal.data.aliyuncs.com",
      "extra": "{\"extraInfoKey\":\"extraInfoValue\"}",
      "publicEndpointEnabled": false,
      "connectionToken": ""
    }
  ],
  "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.