All Products
Search
Document Center

E-MapReduce:ListSessionClusters

Last Updated:Sep 08, 2025

Queries the list of sessions.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
emr-serverless-spark:ListSessionClusterslist
*All Resources
*
    none
none

Request syntax

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

Request parameters

ParameterTypeRequiredDescriptionExample
nextTokenstringNo

The pagination token that is used in the request to retrieve a new page of results.

DD6B1B2A-5837-5237-ABE4-FF0C89568980
maxResultsintegerNo

The maximum number of entries to return.

20
workspaceIdstringNo

The workspace ID.

w-1234abcd
sessionClusterIdstringNo

The name of the job.

emr-spark-demo-job
queueNamestringNo

The name of the queue.

root
kindstringNo

The session type.

Valid values:

  • NOTEBOOK
  • THRIFT
  • SQL
SQL
regionIdstringNo

The region ID.

cn-hangzhou

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

sessionClustersarray<object>

The sessions.

SessionClusterobject

The information about the session.

workspaceIdstring

The workspace ID.

w-1234abcd
sessionClusterIdstring

The session ID.

sc-123131
userIdstring

The user ID.

123131
queueNamestring

The name of the queue that is used to run the session.

dev_queue
statestring

The status of the session.

  • Starting
  • Running
  • Stopping
  • Stopped
  • Error
Running
stateChangeReasonobject

The details of the most recent status change of the session.

codestring

The status change code.

200
messagestring

The status change message.

ok
autoStartConfigurationobject

The automatic startup configurations.

enableboolean

Indicates whether automatic startup is enabled.

true
autoStopConfigurationobject

The configurations of automatic termination.

enableboolean

Indicates whether automatic termination is enabled.

false
idleTimeoutMinutesinteger

The idle timeout period. The session is automatically terminated when the idle timeout period is exceeded.

45
applicationConfigsarray<object>

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

ApplicationConfigobject

The session configuration, which is equivalent to the configuration of the Spark job.

configFileNamestring

The name of the configuration file.

spark-default.conf
configItemKeystring

The key of the configuration.

spark.app.name
configItemValuestring

The configuration value.

test_application
namestring

The name of the session.

adhoc_query
userNamestring

The username.

test_user
kindstring

The session type.

Valid values:

  • NOTEBOOK
  • THRIFT
  • SQL
SQL
webUIstring

The Spark UI of the session.

http://spark-ui-xxxx
releaseVersionstring

The version of EMR Serverless Spark.

esr-2.1
draftIdstring

The ID of the job that is associated with the session.

TSK-xxxxxxxxx
domainstring

The public endpoint of the Thrift server.

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

The version of the Spark engine.

esr-4.0.0 (Spark 3.5.2, Scala 2.12)
fusionboolean

Indicates whether the Fusion engine is used for acceleration.

false
gmtCreatelong

The creation time.

1732267598000
startTimelong

The start time.

1732267598000
domainInnerstring

The internal endpoint of the Thrift server.

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

The additional metadata of the session.

{"extraInfoKey":"extraInfoValue"}
requestIdstring

The request ID.

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

A pagination token.

DD6B1B2A-5837-5237-ABE4-FF0C89568980
maxResultsinteger

The maximum number of entries returned.

20
totalCountinteger

The total number of entries returned.

200

Examples

Sample success responses

JSONformat

{
  "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-2.1",
      "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
    }
  ],
  "requestId": "DD6B1B2A-5837-5237-ABE4-FF0C8944****",
  "nextToken": "DD6B1B2A-5837-5237-ABE4-FF0C89568980",
  "maxResults": 20,
  "totalCount": 200
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-08-20The response structure of the API has changedView Change Details
2024-07-09The request parameters of the API has changed. The response structure of the API has changedView Change Details