Clone a Notebook
- PUT /api/v1.2/notebooks/<notebook ID>/clone
Use this API to clone a notebook. You cannot change the notebook type of the parent notebook while cloning it. To know how to clone a notebook using the Notebooks UI, see Cloning a Notebook.
Required Role
The following users can make this API call:
Users who belong to the system-user or system-admin 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. Presto is not currently supported on all Cloud platforms; see QDS Components: Supported Versions and Cloud Platforms.
Parameter |
Description |
---|---|
name |
It is the name of the notebook. It is a string and can accept alpha-numerical characters. By default, - Clone is added to the name. You can also change the name if it is required. |
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. |
cluster_id |
It is the cluster ID to which the notebook gets assigned with. You must assign the notebook with a cluster to use it even though it is not mandatory to assign a notebook with the cluster when you create it. Assign a cluster only with the corresponding type of notebook that is assign a Spark note with a Spark cluster and a Presto notebook with a Presto 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"}' \
"https://api.qubole.com/api/v1.2/notebooks/<notebook ID>/clone"
Note
The above syntax uses https://api.qubole.com as the endpoint. Qubole provides other endpoints to access QDS that are described in Supported Qubole Endpoints on Different Cloud Providers.
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"}' \
"https://api.qubole.com/api/v1.2/notebooks/2000/clone"