Add notify vnf code framework 61/34461/1
authorfujinhua <fu.jinhua@zte.com.cn>
Wed, 7 Mar 2018 08:05:46 +0000 (16:05 +0800)
committerfujinhua <fu.jinhua@zte.com.cn>
Wed, 7 Mar 2018 08:05:46 +0000 (16:05 +0800)
Change-Id: Iae9b0c8ee57380dd6fd3655c94e1b7f90e8a03b1
Issue-ID: VFC-779
Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
lcm/v2/urls.py
lcm/v2/views.py

index 09e32b9..243cdcd 100644 (file)
 from django.conf.urls import url
 from rest_framework.urlpatterns import format_suffix_patterns
 
-from lcm.v2.views import VnfGrantView
+from lcm.v2.views import VnfGrantView, VnfNotifyView
 
 urlpatterns = [
     url(r'^api/nslcm/v2/grants$', VnfGrantView.as_view()),
+    url(r'^api/nslcm/v2/ns/(?P<vnfmId>[0-9a-zA-Z_-]+)/vnfs/(?P<vnfInstanceId>[0-9a-zA-Z_-]+)/Notify$', VnfNotifyView.as_view()),
 ]
 
 urlpatterns = format_suffix_patterns(urlpatterns)
index 3fa240d..c35ab01 100644 (file)
@@ -54,3 +54,13 @@ class VnfGrantView(APIView):
             logger.error(traceback.format_exc())
             logger.error("Exception in VnfGrant: %s", e.message)
             return Response(data={'error': e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
+
+
+class VnfNotifyView(APIView):
+    def post(self, request):
+        logger.debug("VnfNotifyView post: %s" % request.data)
+        return Response(data={}, status=status.HTTP_204_NO_CONTENT)
+
+    def get(self, request):
+        logger.debug("VnfNotifyView get")
+        return Response(data={}, status=status.HTTP_204_NO_CONTENT)