diff options
Diffstat (limited to 'src/api/views.py')
-rw-r--r-- | src/api/views.py | 10 |
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=""): |