All Products
Search
Document Center

E-MapReduce:ListSessionClusters

Last Updated:Oct 10, 2026

Retrieves a list of sessions.

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 indicates the position from which to start reading.

1

maxResults

integer

No

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

20

sessionClusterId

string

No

The job name.

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 response data.

sessionClusters

array<object>

The 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 where the session runs.

dev_queue

state

string

The session status. Valid values:

  • Starting: Starting.

  • Running: Running.

  • Stopping: Stopping.

  • Stopped: Stopped.

  • Error: Failed.

Running

stateChangeReason

object

The details of the most recent session status change.

code

string

The status change code.

200

message

string

The status change message.

ok

autoStartConfiguration

object

The auto-start configuration.

enable

boolean

Specifies whether auto-start is enabled.

true

autoStopConfiguration

object

The auto-stop configuration.

enable

boolean

Specifies whether auto-stop is enabled.

false

idleTimeoutMinutes

integer

The number of idle minutes after which the session is automatically stopped.

45

applicationConfigs

array<object>

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

object

The SQL Compute configurations, which 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 Spark UI URL of 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 development job bound to the session.

TSK-xxxxxxxxx

domain

string

The public domain name of the Thrift server.

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

displayReleaseVersion

string

The version actually displayed in the console.

esr-4.0.0 (Spark 3.5.2, Scala 2.12)

fusion

boolean

Specifies whether Fusion engine acceleration is enabled.

false

gmtCreate

integer

The creation time.

1732267598000

startTime

integer

The start time. The value is a UNIX timestamp in milliseconds.

1732267598000

domainInner

string

The internal domain name 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

Specifies whether the public network access endpoint is enabled.

true

connectionToken

string

The token used to connect to the session cluster.

requestId

string

The request ID.

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

nextToken

string

The token that indicates the position of the returned data.

1

maxResults

integer

The maximum number of records returned in the current request.

20

totalCount

integer

The total number of records that meet the current request conditions.

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": true,
      "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.