Clone¶
bookstore.clone¶
Handler to clone notebook from storage.
-
class
bookstore.clone.BookstoreCloneHandler(application: tornado.web.Application, request: tornado.httputil.HTTPServerRequest, **kwargs)¶ Handle notebook clone from storage.
Provides API handling for
GETandPOSTwhen cloning a notebook from storage (S3). Launches a user interface cloning options page whenGETis sent.-
initialize(self)¶ Helper to access bookstore settings.
-
get(self)¶ Checks for valid storage settings and render a UI for clone options.
-
construct_template_params(self, s3_bucket, s3_object_key)¶ Helper to populate Jinja template for cloning option page.
-
post(self)¶ Clone a notebook from the location specified by the payload.
-
get_template(self, name)¶ Loads a Jinja template and its related settings.
-
construct_template_params(s3_bucket, s3_object_key) Helper that takes valid S3 parameters and populates UI template
-
get() GET /api/bookstore/cloned
Renders an options page that will allow you to clone a notebook from a specific bucket.
-
get_template(name) Loads a Jinja template by name.
-
initialize() Helper to retrieve bookstore setting for the session.
-
post() POST /api/bookstore/cloned
Clone a notebook to the path specified in the payload.
The payload type for the request should be:
{ "s3_bucket": string, "s3_key": string, "target_path"?: string }The response payload should match the standard Jupyter contents API POST response.
-