seperate sol and deprecated api
[vfc/nfvo/lcm.git] / lcm / ns / views / sol / ns_instances_views.py
index 7ab324c..60683ec 100644 (file)
@@ -19,14 +19,31 @@ from rest_framework import status
 from rest_framework.response import Response
 from rest_framework.views import APIView
 
+from lcm.ns.serializers.sol.create_ns_serializers import CreateNsRequestSerializer, CreateNsRespSerializer
+from lcm.ns.serializers.sol.pub_serializers import QueryNsRespSerializer
+
 logger = logging.getLogger(__name__)
 
 
 class NSInstancesView(APIView):
+    @swagger_auto_schema(
+        request_body=None,
+        responses={
+            status.HTTP_200_OK: QueryNsRespSerializer(help_text="NS instances", many=True),
+            status.HTTP_500_INTERNAL_SERVER_ERROR: "Inner error"
+        }
+    )
     def get(self, request):
         logger.debug(request.query_params)
         # todo
 
+    @swagger_auto_schema(
+        request_body=CreateNsRequestSerializer(),
+        responses={
+            status.HTTP_201_CREATED: CreateNsRespSerializer(),
+            status.HTTP_500_INTERNAL_SERVER_ERROR: "Inner error"
+        }
+    )
     def post(self, request):
         logger.debug("Enter NSInstancesView::POST ns_instances %s", request.data)
         # todo