Closed mathis-marcotte closed 5 months ago
The api call from jupyter api to start a notebook is a PATCH call to api/namespaces/{namespace}/notebooks/{name}
with the body {stopped: true}
. So, we just need to send that call to the jupyter api from whatever trigger we want(in this case, after the login) to start the notebook.
To know the name of which notebook to start, I see two ways we could find it:
As a first draft, I added the api call in with the rest of the other api calls in the main-page.pug of centraldashboard that loads up the environment.
This call first gets the list of notebooks for the current namespace. Then, it loops through the notebooks to find the first one with the label notebook.statcan.gc.ca/default-notebook
set to true, as well as a status of "stopped". It then sends the request to start the notebook
Pr merged
For 2.0, there will be a default notebook created in a user's namespace. That notebook will need to be auto-started when the user logins to their namespace.
This will need to be done in both centraldashboard for the login trigger, and jupyter-apis for the actual logic of starting a notebook.