view_datalab_logs_paginated

DatalabsApi.view_datalab_logs_paginated(id, role_id, serviceloggroup, timestamp_range_with_next_token, logtype=None, sessionid=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)

Get notebook datalab logs page by page

Returns a page of log output for a notebook datalab, using the time range in the request body. Send the nextToken from a previous response to fetch the following page; when a response has no nextToken there are no more pages.

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

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

  • serviceloggroup (str) – Which logs to read - NotebookInstances for the datalab instance itself, notebook-glue-session for a single interactive session. (required)

  • timestamp_range_with_next_token (TimestampRangeWithNextToken) – Time range for log retrieval (startTime and endTime) and nextToken for pagination (required)

  • logtype (str) – Which instance log to read. Required for NotebookInstances and not accepted for session logs.

  • sessionid (str) – Identifier of the interactive session. Required when serviceloggroup is notebook-glue-session; not used otherwise.

  • _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:

DataLabsLogsResponse

Returns:

Returns the result object.

Request and Response Examples

HTTP: POST /datalabs/{id}/logs

Request

Time range for log retrieval (startTime and endTime) and nextToken for pagination

Read a time window

{
  "startTime": "2026-08-12T00:00:00",
  "endTime": "2026-08-12T23:59:59"
}

Resume from a previous response

{
  "startTime": "2026-08-12T00:00:00",
  "endTime": "2026-08-12T23:59:59",
  "nextToken": "f/38215732104563421098765432109876543210987654321098765432109876543210"
}

Success (HTTP 200)

Successful API response

Request / response example

{
  "logPreview": "2026-08-12 11:02:41,220 INFO  Starting notebook kernel\n2026-08-12 11:02:44,881 INFO  Kernel ready\n",
  "logTruncated": true,
  "nextToken": "f/38215732104563421098765432109876543210987654321098765432109876543210"
}

Errors

Documented error codes: IPV-1008, IPV-1054, LOG-1002.

HTTP 400

Missing required request parameters

Time window incomplete

{
  "Message": "IPV-1008 - Invalid request body, missing key(s) - {'startTime'}"
}

Timestamp not in the expected format

{
  "Message": "IPV-1054 - Input startTime are in invalid format should be in YYYY-MM-DDThh:mm:ss and in UTC timezone"
}

Window starts at the epoch

{
  "Message": "LOG-1002 - Logs can be downloaded only after time Jan 1, 1970 00:00:00 UTC"
}

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"
}