A GET on the user shows their server status(es). If the user is not
running, the server value will be null. If it is running, the server value
will be the URL of the running server.

The below results are with the named-servers extension enabled. If it is
not enabled, then the servers key may be omitted. Only the 'default' server
will show up in user.server, so user.servers will have a dict of all
running servers for a given user, keyed by name.

Running:

GET /users/:name

    {
      "kind": "user",
      "name": "name",
      "admin": true,
      "groups": [],
      "server": "/user/name/",
      "pending": null,
      "last_activity": "2018-01-16T18:31:36.151369",
      "servers": {
        "": {
          "name": "",
          "url": "/user/name/"
        }
      }
    }

Not running:

    {
      "kind": "user",
      "name": "name",
      "admin": true,
      "groups": [],
      "server": null,
      "pending": null,
      "last_activity": "2018-01-16T18:35:54.491154",
      "servers": {}
    }

​

On Wed, Dec 20, 2017 at 4:14 PM, Tim Harsch <[email protected]> wrote:

> Right.  Sorry, I should have been more clear.  In the case of DELETE, if
> you attempt to DELETE when no server is running you will get a HTTP 400 and
> no action taken.  But, if you DELETE and a server is running then the
> server stops and you will get HTTP 204(I think).   Similar logic for POST.
> I really just want to check the status, without causing stop or start of
> the server.
>
> Since there seems to be no GET method, could I possibly something using
> the services?  or maybe I could implement the GET ?  Just looking for
> advice on best way forward.
>

I think it would be fine to add a GET for individual servers.


>
> Thanks,
> Tim
>
> On Wednesday, December 20, 2017 at 3:26:32 PM UTC-8, Lawrence D’Oliveiro
> wrote:
>>
>> On Wednesday, December 20, 2017 at 11:44:35 AM UTC+13, Tim Harsch wrote:
>>>
>>> I see with JupyterHub API you can POST or DELETE to
>>> /users/{name}/server but there doesn't seem to be a GET.  If that's true is
>>> there another way I can test for a running server other than POST or DELETE
>>> which have their side effects?..
>>>
>>
>> Whether POST and GET have “side” effects or not is entirely up to how the
>> server interprets the request.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jupyter/4de7b283-659c-4d63-ad8e-ca5c432f5b12%40googlegroups.com
> <https://groups.google.com/d/msgid/jupyter/4de7b283-659c-4d63-ad8e-ca5c432f5b12%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/CAHNn8BXWTJvi%2Br3%3DTPg_w4pKeG%2BS1LiXtCrg4tMw9fhoQ0CBfQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to