All Products
Search
Document Center

E-MapReduce:GetSessionCluster

Last Updated:Dec 22, 2025

Retrieves session details.

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

get

*All Resource

*

None None

Request syntax

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

Path Parameters

Parameter

Type

Required

Description

Example

workspaceId

string

No

The workspace ID.

w-1234abcd

sessionClusterId

string

No

The name of the job.

emr-spark-demo-job

Request parameters

Parameter

Type

Required

Description

Example

regionId

string

No

The region ID.

cn-hangzhou

Response elements

Element

Type

Description

Example

object

The data returned.

sessionCluster

object

The session object.

workspaceId

string

The workspace ID.

w-1234abcd

sessionClusterId

string

The session cluster ID.

1234abcd-12ab-34cd-56ef-1234567890ab

userId

string

The user ID.

123xxxxxxxx

queueName

string

The queue name.

dev_queue

state

string

The state of the job.

  • Starting: The job is starting.

  • Running: The job is running.

  • Stopping: The job is stopping.

  • Stopped: The job is stopped.

  • Error: The job failed.

Running

stateChangeReason

object

The reason for the state change.

code

string

The state change code.

1000000

message

string

The state change message.

ok

autoStartConfiguration

object

The auto-start configuration.

enable

boolean

Specifies whether to enable auto-start.

  • true: Auto-start is enabled.

  • false: Auto-start is disabled.

false

autoStopConfiguration

object

The auto-stop configuration.

enable

boolean

Specifies whether to enable auto-stop.

  • true: Auto-stop is enabled.

  • false: Auto-stop is disabled.

false

idleTimeoutMinutes

integer

The number of minutes a session can be idle before it is automatically stopped.

60

applicationConfigs

array<object>

The list of Spark application configurations.

object

The Spark application configuration.

configFileName

string

The name of the configuration file.

spark-defaults.conf

configItemKey

string

The configuration key.

spark.app.name

configItemValue

string

The configuration value.

test

releaseVersion

string

The Serverless Spark version.

esr-4.0.0 (Spark 3.5.2, Scala 2.12)

name

string

The session name.

test

userName

string

The name of the user who created the session.

user1

kind

string

The job type. This parameter is required and cannot be modified after the job is created.

  • SQLSCRIPT: an SQL job.

  • JAR: a JAR job.

  • PYTHON: a Python job.

SQL

webUI

string

The URL of the Spark UI for the session.

https://spark-ui/link

draftId

string

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

TSK-xxxxxxxx

domain

string

The domain name of the Spark UI for the session.

your.domain.com

displayReleaseVersion

string

The version that is displayed in the console.

esr-4.0.0 (Spark 3.5.2, Scala 2.12)

fusion

boolean

Specifies whether to enable acceleration using the Fusion engine.

false

envId

string

The environment ID.

env-cpv569tlhtgndjl8****

gmtCreate

integer

The time when the session was created.

2024-09-01 06:23:01

startTime

integer

The time when the session started.

2024-09-01 06:23:01

domainInner

string

The internal same-region endpoint.

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****

Examples

Success response

JSON format

{
  "sessionCluster": {
    "workspaceId": "w-1234abcd",
    "sessionClusterId": "1234abcd-12ab-34cd-56ef-1234567890ab",
    "userId": "123xxxxxxxx",
    "queueName": "dev_queue",
    "state": "Running",
    "stateChangeReason": {
      "code": "1000000",
      "message": "ok"
    },
    "autoStartConfiguration": {
      "enable": false
    },
    "autoStopConfiguration": {
      "enable": false,
      "idleTimeoutMinutes": 60
    },
    "applicationConfigs": [
      {
        "configFileName": "spark-defaults.conf",
        "configItemKey": "spark.app.name",
        "configItemValue": "test"
      }
    ],
    "releaseVersion": "esr-4.0.0 (Spark 3.5.2, Scala 2.12)",
    "name": "test",
    "userName": "user1",
    "kind": "SQL",
    "webUI": "https://spark-ui/link",
    "draftId": "TSK-xxxxxxxx",
    "domain": "your.domain.com",
    "displayReleaseVersion": "esr-4.0.0 (Spark 3.5.2, Scala 2.12)",
    "fusion": false,
    "envId": "env-cpv569tlhtgndjl8****",
    "gmtCreate": 0,
    "startTime": 0,
    "domainInner": "emr-spark-gateway-cn-hangzhou-internal.data.aliyuncs.com",
    "extra": "{\"extraInfoKey\":\"extraInfoValue\"}",
    "publicEndpointEnabled": false,
    "connectionToken": ""
  },
  "requestId": "DD6B1B2A-5837-5237-ABE4-FF0C8944****"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.