plasmabio / tljh-repo2docker

Plugin for The Littlest JupyterHub to build multiple user environments with repo2docker
BSD 3-Clause "New" or "Revised" License
60 stars 15 forks source link

Document starting a single user server with a specific environment using the JupyterHub REST API #59

Open stevejpurves opened 1 year ago

stevejpurves commented 1 year ago

The plugin seems to extend the hub REST API to provide endpoints for querying environments but relies on the JupyterHub REST API /users/{name}/server/{serverName} endpoint to start a server.

from the REST API docs spawn options can be passed as a JSON body so I am assuming that the spawn form selection will be posted as the JSON body and that body will have the shape { "image": "my-image-name" }

Is this the case? are there any existing documentation (or a location in the code) to confirm this? if not some documentation would be valuable - perhaps as a subsection in the readme.

stevejpurves commented 1 year ago

it seems that the spawn page completes a form-data POST to /hub/spawn-pending/{user}/random with image: recharge-base:HEAD.

And an authenticated POST to /users/{user}/server or /users/{user}/server/{server-name} with a JSON body {"image": "my-env-name"} succeeds as expected 🥳

jtpio commented 1 year ago

And an authenticated POST to /users/{user}/server or /users/{user}/server/{server-name} with a JSON body {"image": "my-env-name"} succeeds as expected partying_face

Ah nice! Would you like to open a PR to add it to the docs / README.md?