Spark Session - Get Spark Sessions

List all spark sessions which are running under a particular spark pool.

GET {endpoint}/livyApi/versions/{livyApiVersion}/sparkPools/{sparkPoolName}/sessions
GET {endpoint}/livyApi/versions/{livyApiVersion}/sparkPools/{sparkPoolName}/sessions?from={from}&size={size}&detailed={detailed}

URI Parameters

Name In Required Type Description
endpoint
path True

string

The workspace development endpoint, for example https://myworkspace.dev.azuresynapse.net.

livyApiVersion
path True

string

Valid api-version for the request.

sparkPoolName
path True

string

Name of the spark pool.

detailed
query

boolean

Optional query param specifying whether detailed response is returned beyond plain livy.

from
query

integer

int32

Optional param specifying which index the list should begin from.

size
query

integer

int32

Optional param specifying the size of the returned list.

        By default it is 20 and that is the maximum.

Responses

Name Type Description
200 OK

SparkSessionCollection

Success

Examples

List all spark session jobs

Sample request

GET myWorkspace.dev.azuresynapse.net/livyApi/versions/2020-12-01/sparkPools/mySparkPool/sessions?from=0&size=2&detailed=True

Sample response

{
  "from": 0,
  "total": 2,
  "sessions": []
}

Definitions

Name Description
LivyStates

The batch state

PluginCurrentState
SchedulerCurrentState
SparkErrorSource
SparkJobType

The job type.

SparkRequest
SparkScheduler
SparkServiceError
SparkServicePlugin
SparkSession
SparkSessionCollection
SparkSessionResultType
SparkSessionState

LivyStates

The batch state

Name Type Description
busy

string

dead

string

error

string

idle

string

killed

string

not_started

string

recovering

string

running

string

shutting_down

string

starting

string

success

string

PluginCurrentState

Name Type Description
Cleanup

string

Ended

string

Monitoring

string

Preparation

string

Queued

string

ResourceAcquisition

string

Submission

string

SchedulerCurrentState

Name Type Description
Ended

string

Queued

string

Scheduled

string

SparkErrorSource

Name Type Description
Dependency

string

System

string

Unknown

string

User

string

SparkJobType

The job type.

Name Type Description
SparkBatch

string

SparkSession

string

SparkRequest

Name Type Description
archives

string[]

args

string[]

className

string

conf

object

driverCores

integer

driverMemory

string

executorCores

integer

executorMemory

string

file

string

files

string[]

jars

string[]

name

string

numExecutors

integer

pyFiles

string[]

SparkScheduler

Name Type Description
cancellationRequestedAt

string

currentState

SchedulerCurrentState

endedAt

string

scheduledAt

string

submittedAt

string

SparkServiceError

Name Type Description
errorCode

string

message

string

source

SparkErrorSource

SparkServicePlugin

Name Type Description
cleanupStartedAt

string

currentState

PluginCurrentState

monitoringStartedAt

string

preparationStartedAt

string

resourceAcquisitionStartedAt

string

submissionStartedAt

string

SparkSession

Name Type Description
appId

string

appInfo

object

artifactId

string

errorInfo

SparkServiceError[]

id

integer

jobType

SparkJobType

livyInfo

SparkSessionState

log

string[]

name

string

pluginInfo

SparkServicePlugin

result

SparkSessionResultType

schedulerInfo

SparkScheduler

sparkPoolName

string

state

LivyStates

The session state.

submitterId

string

submitterName

string

tags

object

workspaceName

string

SparkSessionCollection

Name Type Description
from

integer

sessions

SparkSession[]

total

integer

SparkSessionResultType

Name Type Description
Cancelled

string

Failed

string

Succeeded

string

Uncertain

string

SparkSessionState

Name Type Description
busyAt

string

currentState

string

deadAt

string

errorAt

string

idleAt

string

jobCreationRequest

SparkRequest

killedAt

string

notStartedAt

string

recoveringAt

string

shuttingDownAt

string

startingAt

string