From b2cad09d5c19e0aa59d3b0a2afe60a4cb3b0c36c Mon Sep 17 00:00:00 2001 From: yangyan Date: Fri, 20 Mar 2020 14:43:33 +0800 Subject: Add etsicatalog api Add etsicatalog api for nslcm to modify package status" Change-Id: Ib54c19f5908540d233a839a36f387832f9278584 Issue-ID: MODELING-346 Signed-off-by: yangyan --- catalog/packages/views/ns_descriptor_views.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'catalog/packages/views/ns_descriptor_views.py') diff --git a/catalog/packages/views/ns_descriptor_views.py b/catalog/packages/views/ns_descriptor_views.py index 2d98628..44e06e4 100644 --- a/catalog/packages/views/ns_descriptor_views.py +++ b/catalog/packages/views/ns_descriptor_views.py @@ -144,3 +144,21 @@ def nsd_content_ru(request, **kwargs): file_range = request.META.get('HTTP_RANGE') file_iterator = NsDescriptor().download(nsd_info_id, file_range) return StreamingHttpResponse(file_iterator, status=status.HTTP_200_OK) + + +@swagger_auto_schema( + method='PUT', + operation_description="Update a NSD", + request_body=no_body, + responses={ + status.HTTP_202_ACCEPTED: "Successfully", + status.HTTP_500_INTERNAL_SERVER_ERROR: "Internal error" + } +) +@api_view(http_method_names=['PUT']) +@view_safe_call_with_log(logger=logger) +def ns_descriptors_u(request, **kwargs): + if request.method == 'PUT': + nsd_info_id = kwargs.get("nsdInfoId") + NsDescriptor().update(request.data, nsd_info_id) + return Response(data=None, status=status.HTTP_202_ACCEPTED) -- cgit 1.2.3-korg