aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/views.py
diff options
context:
space:
mode:
authorSawyer Bergeron <sbergeron@iol.unh.edu>2020-03-25 19:21:04 +0000
committerSawyer Bergeron <sbergeron@iol.unh.edu>2020-04-14 18:10:14 +0000
commit557659acfd97ddaacdb89192ff6a575691b39093 (patch)
treefa261e530212e096536de439b623d9a3cf3a354a /src/api/views.py
parent45044bdab74c969a9ca4b712625e0c3175b16787 (diff)
Add user + user list to API
Change-Id: I15cf0c33b9d452fda47f97e3d9b43e00c1bf9bfd Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
Diffstat (limited to 'src/api/views.py')
-rw-r--r--src/api/views.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/api/views.py b/src/api/views.py
index bc01562..4e0d058 100644
--- a/src/api/views.py
+++ b/src/api/views.py
@@ -97,6 +97,16 @@ def lab_status(request, lab_name=""):
return JsonResponse(lab_manager.set_status(request.POST), safe=False)
return JsonResponse(lab_manager.get_status(), safe=False)
+def lab_users(request, lab_name=""):
+ lab_token = request.META.get('HTTP_AUTH_TOKEN')
+ lab_manager = LabManagerTracker.get(lab_name, lab_token)
+ return HttpResponse(lab_manager.get_users(), content_type="text/plain")
+
+def lab_user(request, lab_name="", user_id=-1):
+ lab_token = request.META.get('HTTP_AUTH_TOKEN')
+ lab_manager = LabManagerTracker.get(lab_name, lab_token)
+ return HttpResponse(lab_manager.get_user(user_id), content_type="text/plain")
+
@csrf_exempt
def update_host_bmc(request, lab_name="", host_id=""):