All Products
Search
Document Center

E-MapReduce:ListLivyComputeSessions

Last Updated:Oct 10, 2026

Retrieves the historical sessions of a Livy Gateway.

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

list

*All Resource

*

None None

Request syntax

GET /api/v1/workspaces/{workspaceId}/livycompute/{livyComputeId}/session HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

workspaceId

string

No

The workspace ID.

w-d80f373d3ace824f

livyComputeId

string

No

The ID of the Livy Gateway.

lc-zm4dzdiubu73w2yx

Request parameters

Parameter

Type

Required

Description

Example

pageNum

integer

No

The page number. Default value: 1.

1

pageSize

integer

No

The number of entries per page. Default value: 20. Minimum value: 1. Maximum value: 100.

20

regionId

string

No

The region ID.

cn-hangzhou

Response elements

Element

Type

Description

Example

object

Schema of Response

requestId

string

The request ID.

8FAA8EEC-3026-5D15-8733-4E2A3DD970A1

totalCount

integer

The total number of entries.

10

sessions

array<object>

The list of sessions.

object

name

string

The session name.

test_session

computeId

string

The ID of the Livy Gateway.

lc-xxxxxx

sessionId

string

The ID of the Livy Gateway session.

livy-xxxxxx

sparkConf

string

The Spark job configuration.

{ "proxyUser": "test", "conf": { "spark.driver.cores": 1 } }

state

string

The session status. Valid values:

  • starting: Starting.

  • running: Running.

  • terminating: Terminating.

  • terminated: Terminated.

  • error: Error.

Valid values:

  • running :

    Running.

  • terminating :

    Terminating.

  • error :

    Error.

  • starting :

    Starting.

  • terminated :

    Terminated.

running

info

string

The runtime information.

null

createTime

integer

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

1768213240000

webUI

string

The web UI address of the session.

http://emr-spark-ui-cn-hangzhou.data.aliyun.com

endTime

integer

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

1768213240000

queue

string

The queue name.

root_queue

cuHours

number

The number of compute units (CUs) consumed during the job runtime. This value is an estimate. The actual value is subject to the bill.

322.5

vcoreSeconds

integer

The total number of vcores allocated to the job multiplied by the number of seconds the job has run.

343

mbSeconds

integer

The total amount of memory allocated to the job multiplied by the number of seconds the job has run.

1098888

Examples

Success response

JSON format

{
  "requestId": "8FAA8EEC-3026-5D15-8733-4E2A3DD970A1",
  "totalCount": 10,
  "sessions": [
    {
      "name": "test_session",
      "computeId": "lc-xxxxxx",
      "sessionId": "livy-xxxxxx",
      "sparkConf": "{\n    \"proxyUser\": \"test\",\n    \"conf\": {\n        \"spark.driver.cores\": 1\n    }\n}",
      "state": "running",
      "info": "null",
      "createTime": 1768213240000,
      "webUI": "http://emr-spark-ui-cn-hangzhou.data.aliyun.com",
      "endTime": 1768213240000,
      "queue": "root_queue",
      "cuHours": 322.5,
      "vcoreSeconds": 343,
      "mbSeconds": 1098888
    }
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.