All Products
Search
Document Center

E-MapReduce:ListSessionClusters

Last Updated:Jun 11, 2026

Mengambil daftar cluster sesi.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

emr-serverless-spark:ListSessionClusters

list

*All Resource

*

None None

Sintaks permintaan

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

Path Parameters

Parameter

Type

Required

Description

Example

workspaceId

string

No

ID ruang kerja.

w-1234abcd

Parameter permintaan

Parameter

Type

Required

Description

Example

nextToken

string

No

Token yang menandai awal halaman hasil berikutnya.

1

maxResults

integer

No

Jumlah maksimum rekaman yang akan dikembalikan.

20

sessionClusterId

string

No

Nama pekerjaan.

emr-spark-demo-job

queueName

string

No

Nama antrian.

root

kind

string

No

Tipe sesi.

Valid values:

  • NOTEBOOK :

    NOTEBOOK.

  • THRIFT :

    THRIFT.

  • SQL :

    SQL.

SQL

regionId

string

No

ID wilayah.

cn-hangzhou

Elemen respons

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

Contoh

Respons sukses

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

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.