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 | e4d40617fd6ebc6ef255ff9d00f586261c1d309f (patch) | |
tree | 51a74cb1d218a8c03d389b2e844355961fe97c29 /dashboard/src/api/views.py | |
parent | 0cc66d9fa833f12c23bfe7cf79d8276ef68a8cf7 (diff) | |
parent | b906ab1a020858d99577bd4b6476c6aec965330b (diff) |
Merge "Adds pdf and idf into api"
Diffstat (limited to 'dashboard/src/api/views.py')
-rw-r--r-- | dashboard/src/api/views.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/dashboard/src/api/views.py b/dashboard/src/api/views.py index 2ae1ac5..fb28958 100644 --- a/dashboard/src/api/views.py +++ b/dashboard/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) |