diff options
author | Parker Berberian <pberberian@iol.unh.edu> | 2020-04-14 18:15:55 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2020-04-14 18:15:55 +0000 |
commit | 6bf37e9864787e0398a1d2e1cdd10b40a8ebc6e6 (patch) | |
tree | 18396967cc32110ae5455827e612e2846e55392c /src/api/views.py | |
parent | d5b4f4c77534824430fd8e2d3f15e5f7ed6303f5 (diff) | |
parent | 557659acfd97ddaacdb89192ff6a575691b39093 (diff) |
Merge "Add user + user list to API"
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=""): |