stop_datalab_session

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

Stop an interactive session

Stops a running interactive session on a notebook datalab. Requires editor access or higher.

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

  • sessionid (str) – Identifier of the interactive session. (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:

StopDatalabSessionResponse

Returns:

Returns the result object.

Request and Response Examples

HTTP: PUT /datalabs/{id}/sessions/{sessionid}

Success (HTTP 200)

Successful API response

Request / response example

{
  "Message": "Session stop initiated for session with Id - s-1a2b3c4d5e6f7a8b"
}

Errors

Documented error codes: GE-1034.

HTTP 400

Invalid input metadata

Session belongs to a different datalab

{
  "Message": "GE-1034 - Failed to process the api request, the session is not associated with the datalab."
}

Session is already in that state

{
  "Message": "GE-1034 - Failed to process the api request, the session is already in STOPPED state."
}

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