Configure a Notebook

PUT /api/v1.2/notebooks/<notebook ID>

Use this API to configure/edit a notebook. You cannot change the notebook type while configuring or editing it.

You can change the cluster associated with the notebook only when the following conditions are met:

  • Notebook does not have any active command.
  • Notebook does not have any active schedules associated.
  • Notebook does not have any scheduled dashboard.

To know how to configure a notebook using the Notebooks UI, see Configuring a Notebook.

Required Role

The following users can make this API call:

  • Users who belong to the system-admin or system-user group.
  • Users who belong to a group associated with a role that allows submitting a command. See Managing Groups and Managing Roles for more information.

Parameters

Note

Parameters marked in bold below are mandatory. Others are optional and have default values.

Parameter Description
name It is the name of the notebook. It is a string and can accept alpha-numerical characters.
location It is the location of the folder. By default, it goes to Users/current_user_email_id folders. For more information on notebook folders, see Using Folders in Notebooks. The accepted folder locations are: Users/current_user_email_id, Common, and Users. The default location is Users/current_user_email_id and it is equivalent to My Home on the Notebooks UI. You need privileges to create/edit notebooks in Common and Users. For more information, see Managing Folder-level Permissions.
default_lang Default language of the notebook. Default value is spark. Other possible values are pyspark, sql, and r.
cluster_id The ID of the cluster to which the notebook is assigned. You must assign the notebook to a cluster to use it, though you can leave the notebook unassigned when you create it. Make sure you assign the notebook to the appropriate type of cluster: for example, assign a Spark notebook to a Spark cluster.

Request API Syntax

curl -i -X PUT -H "X-AUTH-TOKEN: $AUTH_TOKEN" -H "Content-Type: application/json" -H "Accept: application/json" \
-d '{"name":"<Name>", "location":"<Location>", "cluster_id":"<Cluster ID>", "default_lang":"<language>"}' \
"https://gcp.qubole.com/api/v1.2/notebooks/<notebook ID>"

Sample API Request

Here is an example to configure a Spark notebook with its ID as 2000.

curl -i -X PUT -H "X-AUTH-TOKEN: $AUTH_TOKEN" -H "Content-Type: application/json" -H "Accept: application/json" \
-d '{"name":"Spark", "location":"Users/[email protected]/Notebooks", "cluster_id":"4001", "default_lang":"sql"}' \
"https://gcp.qubole.com/api/v1.2/notebooks/2000"