From 3d078d2df3fac997c783435ba07e7710d087fd4b Mon Sep 17 00:00:00 2001 From: Parker Berberian Date: Wed, 17 Apr 2019 12:44:04 -0400 Subject: Adds pdf and idf into api The Pod Descriptor File (pdf) and Installer descriptor file (idf) are now hosted in the api. The url endpoint where the lab can retrieve them are now part of a software task. An OPNFV task also contains a new dictionary that describes how bridges should be configured on the jumphost. This information is not contained in the pdf/idf but is needed by the lab. Change-Id: I6971279979ba180725926035bd9db481aafb1073 Signed-off-by: Parker Berberian --- src/api/views.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/api/views.py') 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) -- cgit 1.2.3-korg