From 462aded144f4cdfbe7a8c1546c603dc554003a34 Mon Sep 17 00:00:00 2001 From: "ying.yunlong" Date: Wed, 8 Feb 2017 13:50:01 +0800 Subject: Implement instantiation related interface Change-Id: I981dc6728062475659ccb3a044e5df9019af55ac Issue-Id:GVNFM-9 Signed-off-by: ying.yunlong --- lcm/lcm/nf/vnfs/urls.py | 15 ++++++++++++--- lcm/lcm/nf/vnfs/views.py | 32 +++++++++++++++++++++++++++++++- 2 files changed, 43 insertions(+), 4 deletions(-) (limited to 'lcm') diff --git a/lcm/lcm/nf/vnfs/urls.py b/lcm/lcm/nf/vnfs/urls.py index 1afc60eb..4a64bdf6 100644 --- a/lcm/lcm/nf/vnfs/urls.py +++ b/lcm/lcm/nf/vnfs/urls.py @@ -15,12 +15,21 @@ from django.conf.urls import patterns, url from rest_framework.urlpatterns import format_suffix_patterns -from lcm.nf.vnfs.views import CreateVnfIdentifier, InstantiateVnf +from lcm.nf.vnfs.views import CreateVnfIdentifier, InstantiateVnf, DeleteVnfIdentifier, QueryMultipleVnf, TerminateVnf, \ + QuerySingleVnf, GetOperationStatus urlpatterns = patterns('', url(r'^gvnfmapi/lcm/v1/vnf_instances$', CreateVnfIdentifier.as_view()), - url(r'^gvnfmapi/lcm/v1/vnf_instances/(?P[0-9a-zA-Z_-]+)/instantiate$', - InstantiateVnf.as_view()), + url(r'^gvnfmapi/lcm/v1/vnf_instances/(?P[0-9a-zA-Z_-]+)/instantiate$', InstantiateVnf.as_view()), + url(r'^gvnfmapi/lcm/v1/vnf_instances/(?P[0-9a-zA-Z_-]+)$', + DeleteVnfIdentifier.as_view()), + url(r'^gvnfmapi/lcm/v1/vnf_instances/(?P[0-9a-zA-Z_-]+)/terminate$', + TerminateVnf.as_view()), + url(r'^gvnfmapi/lcm/v1/vnf_instances$', QueryMultipleVnf.as_view()), + url(r'^gvnfmapi/lcm/v1/vnf_instances/(?P[0-9a-zA-Z_-]+)$', QuerySingleVnf.as_view()), + url( + r'^gvnfmapi/lcm/v1/vnf_lc_ops/(?P[0-9a-zA-Z_-]+)&responseId=(?P[0-9a-zA-Z_-]+)$', + GetOperationStatus.as_view()), ) urlpatterns = format_suffix_patterns(urlpatterns) \ No newline at end of file diff --git a/lcm/lcm/nf/vnfs/views.py b/lcm/lcm/nf/vnfs/views.py index b5846709..a1caefa2 100644 --- a/lcm/lcm/nf/vnfs/views.py +++ b/lcm/lcm/nf/vnfs/views.py @@ -57,4 +57,34 @@ class InstantiateVnf(APIView): # CreateVnfs(data, nf_inst_id, job_id).start() rsp = {"jobId": job_id} - return Response(data=rsp, status=status.HTTP_202_ACCEPTED) \ No newline at end of file + return Response(data=rsp, status=status.HTTP_202_ACCEPTED) + + +class DeleteVnfIdentifier(APIView): + def delete(self, request): + logger.debug("DeleteVnfIdentifier--delete::> %s" % request.data) + return Response(data='', status=status.HTTP_202_ACCEPTED) + + +class TerminateVnf(APIView): + def post(self, request): + logger.debug("TerminateVnf--post::> %s" % request.data) + return Response(data='', status=status.HTTP_202_ACCEPTED) + + +class QueryMultipleVnf(APIView): + def get(self, request): + logger.debug("QueryMultipleVnf--get::> %s" % request.data) + return Response(data='', status=status.HTTP_202_ACCEPTED) + + +class QuerySingleVnf(APIView): + def get(self, request): + logger.debug("QuerySingleVnf--get::> %s" % request.data) + return Response(data='', status=status.HTTP_202_ACCEPTED) + + +class GetOperationStatus(APIView): + def get(self, request): + logger.debug("GetOperationStatus--get::> %s" % request.data) + return Response(data='', status=status.HTTP_202_ACCEPTED) \ No newline at end of file -- cgit 1.2.3-korg