aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfengyuanxing <feng.yuanxing@zte.com.cn>2018-01-29 09:57:30 +0800
committerfengyuanxing <feng.yuanxing@zte.com.cn>2018-01-29 09:57:30 +0800
commit19cb252d51a0789a3f896ede525fc9c198bb2244 (patch)
treee1dd13eb4f85221c823a3fa4f9686c692678824e
parent24492becbf1e0b8524753d3c19856b1d79f1aa7d (diff)
Add code for swagger of parsing ns model
Change-Id: Id1982209edf7391374ac48f9b6417d61ff8a55ae Issue-ID: VFC-685 Signed-off-by: fengyuanxing <feng.yuanxing@zte.com.cn>
-rw-r--r--catalog/packages/views.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/catalog/packages/views.py b/catalog/packages/views.py
index e5538915..eccac3b8 100644
--- a/catalog/packages/views.py
+++ b/catalog/packages/views.py
@@ -27,7 +27,7 @@ from catalog.serializers import NfPackageDistributeRequestSerializer
from catalog.serializers import PostJobResponseSerializer
from catalog.serializers import ParseModelRequestSerializer
from catalog.serializers import ParseNfPackageResponseSerializer
-
+from catalog.serializers import ParseNSPackageResponseSerializer
from drf_yasg import openapi
from drf_yasg.utils import no_body, swagger_auto_schema
@@ -203,6 +203,16 @@ def nf_rd_csar(request, *args, **kwargs):
return Response(data=ret[1], status=normal_status)
+@swagger_auto_schema(
+ method='POST',
+ operation_description="Parse NS model",
+ request_body=ParseModelRequestSerializer,
+ responses={
+ status.HTTP_202_ACCEPTED: ParseNSPackageResponseSerializer,
+ status.HTTP_500_INTERNAL_SERVER_ERROR: openapi.Response(
+ 'error',
+ openapi.Schema(
+ type=openapi.TYPE_STRING))})
@api_view(http_method_names=['POST'])
def ns_model_parser(request, *args, **kwargs):
csar_id = ignore_case_get(request.data, "csarId")