get_datalab_logs¶
- DatalabsApi.get_datalab_logs(role_id, id, serviceloggroup, logtype=None, sessionid=None, start_time=None, end_time=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Get notebook datalab logs
Returns a page of log output for a notebook datalab. Choose which logs to read with serviceloggroup. Defaults to the last 24 hours when no time range is given.
- Parameters:
role_id (str) – User role id (required)
id (str) – Identifier of the datalab. (required)
serviceloggroup (str) – Which logs to read - NotebookInstances for the datalab instance itself, notebook-glue-session for a single interactive session. (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.
start_time (str) – Start of the time range, as YYYY-MM-DDThh:mm:ss in UTC. Defaults to 24 hours ago.
end_time (str) – End of the time range, as YYYY-MM-DDThh:mm:ss in UTC. Defaults to now.
_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:
- Returns:
Returns the result object.
Request and Response Examples¶
HTTP: GET /datalabs/{id}/logs
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-1052, IPV-1002.
HTTP 400
Missing required request parameters
serviceloggroup query parameter omitted
{
"Message": "IPV-1052 - Missing mandatory parameter(s) servicename in queryStringParameters/pathParameters"
}
DatalabId does not exist
{
"Message": "IPV-1002 - Invalid DatalabId - b1e6c2a0-9f4d-4c7a-8f2e-1a2b3c4d5e6f, resource not found."
}
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"
}