update_datalab

DatalabsApi.update_datalab(id, role_id, content_type=None, operation=None, datalab_update_input=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)

Update, start or stop a datalab

Updates a datalab’s description, compute, resource access or additional settings. With operation set, starts or stops a notebook datalab instead - start needs it stopped or failed and stop needs it running. A studio datalab cannot be updated while it is pending, deleting or failed. Requires editor access or higher.

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

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

  • content_type (str) – Must be application/json.

  • operation (str) – Omit to update the datalab. Use start to start a stopped or failed notebook datalab, or stop to stop a running one. Both apply to notebook datalabs only and ignore the request body.

  • datalab_update_input (DatalabUpdateInput)

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

UpdateDatalabResponse

Returns:

Returns the result object.

Request and Response Examples

HTTP: PUT /datalabs/{id}

Request

Change instance type and volume size

{
  "Description": "Updated notebook workspace",
  "ComputeMetadata": {
    "InstanceList": [
      "ml.t3.large"
    ],
    "VolumeSizeInGB": 40
  }
}

Change keywords only

{
  "AdditionalMetadata": {
    "Keywords": [
      "ml",
      "sales",
      "q3"
    ]
  }
}

Success (HTTP 200)

Datalab updated successfully

Request / response example

{
  "Message": "Successfully updated Data Lab."
}

Errors

Documented error codes: IPV-1041, IPV-1040, GE-1043, IPV-1036.

HTTP 400

Missing required request parameters

Field not accepted on update

{
  "Message": "IPV-1041 - Invalid key passed for datalab update operation - DatalabName"
}

DirectInternetAccess cannot change after creation

{
  "Message": "IPV-1040 - The DirectInternetAccess can only be modified during creation."
}

start requested while the datalab is not stopped

{
  "Message": "GE-1043 - This operation can only be done when resource 'Datalab' is in 'Stopped' state."
}

Volume size reduced

{
  "Message": "IPV-1036 - Input volume size cannot be lesser than the current volume size 20"
}

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