list_datalab_sessions

DatalabsApi.list_datalab_sessions(id, role_id, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)

List interactive sessions on a datalab

Returns the interactive sessions running under the datalab’s service role. Applies to both notebook and studio datalabs; the list is empty when none are running.

Parameters:
  • id (str) – Identifier of the datalab. (required)

  • role_id (str) – User role id (required)

  • _request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

  • _request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.

  • _content_type (str, Optional) – force content-type for the request.

  • _headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.

  • _host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.

Return type:

DatalabSessionsResponse

Returns:

Returns the result object.

Request and Response Examples

HTTP: GET /datalabs/{id}/sessions

Success (HTTP 200)

Successful API response

Request / response example

{
  "Sessions": [
    {
      "Id": "s-1a2b3c4d5e6f7a8b",
      "CreatedOn": "2026-08-12 11:05:00",
      "Status": "READY",
      "Role": "arn:aws:iam::123456789012:role/amorphic-notebook-role",
      "Command": {
        "Name": "glueetl",
        "PythonVersion": "3"
      },
      "Progress": 100.0,
      "GlueVersion": "4.0",
      "WorkerType": "G.1X",
      "NumberOfWorkers": 2,
      "ExecutionTime": 142.5,
      "DPUSeconds": 285.0
    }
  ]
}

Errors

Documented error codes: IPV-1016, AUTH-1002.

HTTP 400

Invalid input metadata

Datalab does not have interactive sessions enabled

{
  "Message": "IPV-1016 - Unsupported Datalab type - sagemaker-studio."
}

Caller has no access on the datalab

{
  "Message": "AUTH-1002 - User action is not permitted"
}

HTTP 500

Something went wrong at backend

Request / response example

{
  "Message": "An error occurred (ThrottlingException) when calling the DescribeNotebookInstance operation (reached max retries: 4): Rate exceeded"
}