diff options
author | Parker Berberian <pberberian@iol.unh.edu> | 2019-05-08 17:00:01 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2019-05-08 17:00:01 +0000 |
commit | 48cff65180d0584bdd0f60a4226bd36511f36161 (patch) | |
tree | 47e303a8898f60c1fc5e4f01ce430cf2a97d9316 /src/api/views.py | |
parent | 19350b192914a2bfadac81f9885d6be236d58346 (diff) | |
parent | 3d078d2df3fac997c783435ba07e7710d087fd4b (diff) |
Merge "Adds pdf and idf into api"
Diffstat (limited to 'src/api/views.py')
-rw-r--r-- | src/api/views.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/api/views.py b/src/api/views.py index 2ae1ac5..fb28958 100644 --- a/src/api/views.py +++ b/src/api/views.py @@ -13,7 +13,7 @@ from django.contrib.auth.decorators import login_required from django.shortcuts import redirect from django.utils.decorators import method_decorator from django.views import View -from django.http.response import JsonResponse +from django.http.response import JsonResponse, HttpResponse from rest_framework import viewsets from rest_framework.authtoken.models import Token from django.views.decorators.csrf import csrf_exempt @@ -64,6 +64,18 @@ def lab_host(request, lab_name="", host_id=""): return JsonResponse(lab_manager.update_host(host_id, request.POST), safe=False) +def get_pdf(request, lab_name="", booking_id=""): + lab_token = request.META.get('HTTP_AUTH_TOKEN') + lab_manager = LabManagerTracker.get(lab_name, lab_token) + return HttpResponse(lab_manager.get_pdf(booking_id), content_type="text/plain") + + +def get_idf(request, lab_name="", booking_id=""): + lab_token = request.META.get('HTTP_AUTH_TOKEN') + lab_manager = LabManagerTracker.get(lab_name, lab_token) + return HttpResponse(lab_manager.get_idf(booking_id), content_type="text/plain") + + def lab_status(request, lab_name=""): lab_token = request.META.get('HTTP_AUTH_TOKEN') lab_manager = LabManagerTracker.get(lab_name, lab_token) |