Skip to content

get_sessions()

Get information about all sessions.

get_sessions(...)

Description

This function retrieves information about all sessions that you started. You can filter based on cluster name and status, additionally.

Optional Parameters

cluster_name (str)

Name of cluster to filter sessions by. Will only retrieve sessions that were created on this cluster.

status (str)

Status to filter sessions by. Will only retrieve sessions that are in this status.

Returns (dict)

Dictionary of session ID mapping to session configuration and information.

{
    "2021-06-10-2240237175e6921d0c69f8a93aaa49ffd30287": {
        "session_name":"mnist_classify",
        "instance_type": "c5.2xlarge",
        "num_workers": 8,
        "cluster_instance_id": "mlexperimentation_2021-06-08-02:25:37_942673c86e9c3e18",
        "cluster_name": "mlexperimentation",
        "created": "2021-07-27-14:36:07",
        "ended": "",
        "status": "running"
    }
}

Example Usage

# Get information about all sessions
get_sessions()

# Get information about failed sessions for cluster `mlexperimentation`
get_sessions(cluster_name"="mlexperimentation", "status"="failed")