From b196dd2beaeab95c34bfb35dbf2ee43ddef58c03 Mon Sep 17 00:00:00 2001 From: Min RK Date: Wed, 6 Feb 2019 13:15:42 +0100 Subject: [PATCH] add activity spec to rest api --- docs/rest-api.yml | 64 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 59 insertions(+), 5 deletions(-) diff --git a/docs/rest-api.yml b/docs/rest-api.yml index 8ea61094..573e886b 100644 --- a/docs/rest-api.yml +++ b/docs/rest-api.yml @@ -89,7 +89,7 @@ paths: post: summary: Create multiple users parameters: - - name: data + - name: body in: body required: true schema: @@ -147,7 +147,7 @@ paths: in: path required: true type: string - - name: data + - name: body in: body required: true description: Updated user info. At least one key to be updated (name or admin) is required. @@ -176,6 +176,60 @@ paths: responses: '204': description: The user has been deleted + /users/{name}/activity: + post: + summary: + Notify Hub of activity for a given user. + description: + Notify the Hub of activity by the user, + e.g. accessing a service or (more likely) + actively using a server. + parameters: + - name: name + description: username + in: path + required: true + type: string + - body: + in: body + schema: + type: object + properties: + last_activity: + type: string + format: date-time + description: | + Timestamp of last-seen activity for this user. + Only needed if this is not activity associated + with using a given server. + required: false + servers: + description: | + Register activity for specific servers by name. + The keys of this dict are the names of servers. + The default server has an empty name (''). + required: false + type: object + properties: + '': + description: | + Activity for a single server. + type: object + properties: + last_activity: + required: true + type: string + format: date-time + description: | + Timestamp of last-seen activity on this server. + example: + last_activity: '2019-02-06T12:54:14Z' + servers: + '': + last_activity: '2019-02-06T12:54:14Z' + gpu: + last_activity: '2019-02-06T12:54:14Z' + /users/{name}/server: post: summary: Start a user's single-user notebook server @@ -370,7 +424,7 @@ paths: in: path required: true type: string - - name: data + - name: body in: body required: true description: The users to add to the group @@ -395,7 +449,7 @@ paths: in: path required: true type: string - - name: data + - name: body in: body required: true description: The users to remove from the group @@ -453,7 +507,7 @@ paths: summary: Notify the Hub about a new proxy description: Notifies the Hub of a new proxy to use. parameters: - - name: data + - name: body in: body required: true description: Any values that have changed for the new proxy. All keys are optional.