EMR / Client / list_sessions
list_sessions¶
- EMR.Client.list_sessions(**kwargs)¶
Lists the sessions on a cluster. You can filter the results by session state. Newer sessions are returned first.
See also: AWS API Documentation
Request Syntax
response = client.list_sessions( ClusterId='string', SessionStates=[ 'SUBMITTED'|'STARTING'|'STARTED'|'IDLE'|'BUSY'|'TERMINATING'|'TERMINATED'|'FAILED', ], NextToken='string', MaxResults=123 )
- Parameters:
ClusterId (string) –
[REQUIRED]
The ID of the cluster to list sessions for.
SessionStates (list) –
An optional filter that limits the results to sessions in the specified states.
(string) –
NextToken (string) – The pagination token returned by a previous
ListSessionscall. Use it to retrieve the next page of results.MaxResults (integer) – The maximum number of sessions to return in each page of results.
- Return type:
dict
- Returns:
Response Syntax
{ 'Sessions': [ { 'Id': 'string', 'ClusterId': 'string', 'Name': 'string', 'Arn': 'string', 'State': 'SUBMITTED'|'STARTING'|'STARTED'|'IDLE'|'BUSY'|'TERMINATING'|'TERMINATED'|'FAILED', 'StateChangeReason': 'string', 'ReleaseLabel': 'string', 'ExecutionRoleArn': 'string', 'AccountId': 'string', 'CreatedAt': datetime(2015, 1, 1), 'UpdatedAt': datetime(2015, 1, 1), 'StartedAt': datetime(2015, 1, 1), 'EndedAt': datetime(2015, 1, 1), 'IdleSince': datetime(2015, 1, 1), 'EngineConfigurations': [ { 'Classification': 'string', 'Configurations': {'... recursive ...'}, 'Properties': { 'string': 'string' } }, ], 'MonitoringConfiguration': { 'CloudWatchLoggingConfiguration': { 'Enabled': True|False, 'LogGroup': 'string', 'LogStreamNamePrefix': 'string', 'EncryptionKeyArn': 'string', 'LogTypes': { 'string': [ 'string', ] } }, 'ManagedLoggingConfiguration': { 'Enabled': True|False, 'EncryptionKeyArn': 'string' }, 'S3LoggingConfiguration': { 'Enabled': True|False, 'LogUri': 'string', 'EncryptionKeyArn': 'string', 'LogTypes': { 'string': [ 'string', ] } } }, 'SessionIdleTimeoutInMinutes': 123, 'CertificateAuthority': { 'CertificateArn': 'string', 'CertificateData': 'string' }, 'ServerUrl': 'string', 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ] }, ], 'NextToken': 'string' }
Response Structure
(dict) –
Output of the
ListSessionsoperation.Sessions (list) –
The sessions that match the request.
(dict) –
Detailed information about a Spark Connect session.
Id (string) –
The ID of the session.
ClusterId (string) –
The ID of the cluster that the session belongs to.
Name (string) –
The name of the session, if one was provided at creation time.
Arn (string) –
The Amazon Resource Name (ARN) of the session.
State (string) –
The current state of the session. Valid values are
SUBMITTED,STARTING,STARTED,IDLE,BUSY,TERMINATING,TERMINATED, andFAILED.StateChangeReason (string) –
A human-readable message describing the most recent state change.
ReleaseLabel (string) –
The Amazon EMR release label of the cluster that the session is running on.
ExecutionRoleArn (string) –
The execution role ARN for the session. Amazon EMR uses this role to access Amazon Web Services resources on your behalf during session execution.
AccountId (string) –
The Amazon Web Services account ID that owns the session.
CreatedAt (datetime) –
The date and time that the session was created.
UpdatedAt (datetime) –
The date and time that the session was last updated.
StartedAt (datetime) –
The date and time that the session entered the
STARTEDstate.EndedAt (datetime) –
The date and time that the session was terminated or failed.
IdleSince (datetime) –
The date and time that the session last entered the
IDLEstate.EngineConfigurations (list) –
The configuration overrides for the session. Only runtime configuration overrides are supported.
(dict) –
Note
Amazon EMR releases 4.x or later.
An optional configuration specification to be used when provisioning cluster instances, which can include configurations for applications and software bundled with Amazon EMR. A configuration consists of a classification, properties, and optional nested configurations. A classification refers to an application-specific configuration file. Properties are the settings you want to change in that file. For more information, see Configuring Applications.
Classification (string) –
The classification within a configuration.
Configurations (list) –
A list of additional configurations to apply within a configuration object.
Properties (dict) –
A set of properties specified within a configuration classification.
(string) –
(string) –
MonitoringConfiguration (dict) –
The monitoring configuration for the session.
CloudWatchLoggingConfiguration (dict) –
The CloudWatch Logs configuration for the session.
Enabled (boolean) –
Whether CloudWatch Logs is enabled for the session.
LogGroup (string) –
The name of the log group where session logs are published.
LogStreamNamePrefix (string) –
The prefix applied to the log stream name where session logs are published.
EncryptionKeyArn (string) –
The Amazon Resource Name (ARN) of the KMS key used to encrypt the logs published to CloudWatch Logs.
LogTypes (dict) –
A map of log component names (for example,
SPARK_DRIVER,SPARK_EXECUTOR) to the list of log types to publish for that component (for example,stdout,stderr).(string) –
(list) –
(string) –
ManagedLoggingConfiguration (dict) –
The Amazon EMR-managed logging configuration for the session.
Enabled (boolean) –
Whether Amazon EMR-managed logging is enabled for the session.
EncryptionKeyArn (string) –
The Amazon Resource Name (ARN) of the KMS key used to encrypt the managed logs.
S3LoggingConfiguration (dict) –
The Amazon S3 logging configuration for the session.
Enabled (boolean) –
Whether Amazon S3 logging is enabled for the session.
LogUri (string) –
The Amazon S3 destination URI where session logs are published.
EncryptionKeyArn (string) –
The Amazon Resource Name (ARN) of the KMS key used to encrypt logs published to Amazon S3.
LogTypes (dict) –
A map of log component names (for example,
SPARK_DRIVER,SPARK_EXECUTOR) to the list of log types to publish for that component (for example,stdout,stderr).(string) –
(list) –
(string) –
SessionIdleTimeoutInMinutes (integer) –
The idle timeout, in minutes. If the session is idle for this duration, Amazon EMR automatically terminates it.
CertificateAuthority (dict) –
The certificate authority used to establish an mTLS connection to the Spark Connect server when connecting directly over VPC peering.
CertificateArn (string) –
The Amazon Resource Name (ARN) of the certificate authority in Amazon Web Services Private CA that issued the Spark Connect server certificate.
CertificateData (string) –
The PEM-encoded root CA certificate data. Provide this certificate to your client’s trust store when connecting directly to the Spark Connect server over VPC peering.
ServerUrl (string) –
The Spark Connect server URL for the session. Use this URL with the
Credentialsreturned byGetSessionEndpointto connect directly to the session over VPC peering.Tags (list) –
The tags associated with the session.
(dict) –
A key-value pair containing user-defined metadata that you can associate with an Amazon EMR resource. Tags make it easier to associate clusters in various ways, such as grouping clusters to track your Amazon EMR resource allocation costs. For more information, see Tag Clusters.
Key (string) –
A user-defined key, which is the minimum required information for a valid tag. For more information, see Tag.
Value (string) –
A user-defined value, which is optional in a tag. For more information, see Tag Clusters.
NextToken (string) –
The pagination token to use in a subsequent
ListSessionscall to retrieve the next page of results. This field is absent when there are no more results.
Exceptions