Retrieves a list of session clusters.
Try it now
Test
RAM authorization
|
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:
|
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.
|
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:
|
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.