diff options
author | dyh <dengyuanhong@chinamobile.com> | 2019-09-11 14:26:19 +0800 |
---|---|---|
committer | dyh <dengyuanhong@chinamobile.com> | 2019-09-11 14:28:14 +0800 |
commit | 78a414334876164ba61f63bed7cc91dc48620fcf (patch) | |
tree | 2af8444e8be7abb421fc1142383a3216e406383b /catalog/packages | |
parent | 5d5d8f38910c9e776a3d38bbeea26e85a08ed177 (diff) |
update swagger info, add tags for swagger_auto_schema
Change-Id: I50867c324e492cc7472bc199a4f72d202f235ce0
Issue-ID: MODELING-221
Signed-off-by: dyh <dengyuanhong@chinamobile.com>
Diffstat (limited to 'catalog/packages')
-rw-r--r-- | catalog/packages/views/catalog_views.py | 15 | ||||
-rw-r--r-- | catalog/packages/views/health_check_views.py | 1 | ||||
-rw-r--r-- | catalog/packages/views/ns_descriptor_views.py | 6 | ||||
-rw-r--r-- | catalog/packages/views/nsdm_subscription_views.py | 4 | ||||
-rw-r--r-- | catalog/packages/views/pnf_descriptor_views.py | 7 | ||||
-rw-r--r-- | catalog/packages/views/vnf_package_artifact_views.py | 1 | ||||
-rw-r--r-- | catalog/packages/views/vnf_package_subscription_views.py | 4 | ||||
-rw-r--r-- | catalog/packages/views/vnf_package_views.py | 7 |
8 files changed, 45 insertions, 0 deletions
diff --git a/catalog/packages/views/catalog_views.py b/catalog/packages/views/catalog_views.py index 6ed9fb9..740c530 100644 --- a/catalog/packages/views/catalog_views.py +++ b/catalog/packages/views/catalog_views.py @@ -46,6 +46,7 @@ logger = logging.getLogger(__name__) @swagger_auto_schema( method='POST', operation_description="On distribute NS package", + tags=["NS packages API"], request_body=NsPackageDistributeRequestSerializer, responses={ status.HTTP_202_ACCEPTED: NsPackageDistributeResponseSerializer, @@ -53,6 +54,7 @@ logger = logging.getLogger(__name__) @swagger_auto_schema( method='GET', operation_description="Query NS packages", + tags=["NS packages API"], request_body=no_body, responses={ status.HTTP_200_OK: NsPackagesSerializer, @@ -98,6 +100,7 @@ def nspackages_rc(request, *args, **kwargs): @swagger_auto_schema( method='POST', operation_description="On distribute Nf package", + tags=["NF packages API"], request_body=NfPackageDistributeRequestSerializer(), responses={ status.HTTP_202_ACCEPTED: PostJobResponseSerializer, @@ -105,6 +108,7 @@ def nspackages_rc(request, *args, **kwargs): @swagger_auto_schema( method='GET', operation_description="Query Nf packages", + tags=["NF packages API"], request_body=no_body, responses={ status.HTTP_200_OK: NfPackagesSerializer, @@ -158,6 +162,7 @@ def nfpackages_rc(request, *args, **kwargs): @swagger_auto_schema( method='DELETE', operation_description="Delete one NS package", + tags=["NS packages API"], request_body=no_body, manual_parameters=[ openapi.Parameter( @@ -174,6 +179,7 @@ def nfpackages_rc(request, *args, **kwargs): @swagger_auto_schema( method='GET', operation_description="Query one NS package", + tags=["NS packages API"], request_body=no_body, manual_parameters=[ openapi.Parameter( @@ -216,6 +222,7 @@ def ns_rd_csar(request, *args, **kwargs): @swagger_auto_schema( method='POST', operation_description="On distribute Service package", + tags=["Service packages API"], request_body=ServicePackageDistributeRequestSerializer, responses={ status.HTTP_202_ACCEPTED: "", @@ -224,6 +231,7 @@ def ns_rd_csar(request, *args, **kwargs): @swagger_auto_schema( method='GET', operation_description="Query Service packages", + tags=["Service packages API"], request_body=no_body, responses={ status.HTTP_200_OK: ServicePackagesSerializer, @@ -267,6 +275,7 @@ def servicepackages_rc(request, *args, **kwargs): @swagger_auto_schema( method='DELETE', operation_description="Delete one Service package", + tags=["Service packages API"], request_body=no_body, manual_parameters=[ openapi.Parameter( @@ -281,6 +290,7 @@ def servicepackages_rc(request, *args, **kwargs): @swagger_auto_schema( method='GET', operation_description="Query one Service package", + tags=["Service packages API"], request_body=no_body, manual_parameters=[ openapi.Parameter( @@ -327,6 +337,7 @@ def service_rd_csar(request, *args, **kwargs): @swagger_auto_schema( method='DELETE', operation_description="Delete one Nf package", + tags=["NF packages API"], request_body=no_body, manual_parameters=[ openapi.Parameter( @@ -343,6 +354,7 @@ def service_rd_csar(request, *args, **kwargs): @swagger_auto_schema( method='GET', operation_description="Query one Nf package", + tags=["NF packages API"], request_body=no_body, manual_parameters=[ openapi.Parameter( @@ -393,6 +405,7 @@ def nf_rd_csar(request, *args, **kwargs): @swagger_auto_schema( method='POST', operation_description="Parse model(NS, Service, VNF, PNF)", + tags=["Parser API"], request_body=ParseModelRequestSerializer, responses={ status.HTTP_202_ACCEPTED: ParseModelResponseSerializer, @@ -453,6 +466,7 @@ def model_parser(request, *args, **kwargs): @swagger_auto_schema( method='POST', operation_description="Parse NS model", + tags=["Parser API"], request_body=ParseModelRequestSerializer, responses={ status.HTTP_202_ACCEPTED: ParseModelResponseSerializer, @@ -486,6 +500,7 @@ def ns_model_parser(request, *args, **kwargs): @swagger_auto_schema( method='POST', operation_description="Parse NF model", + tags=["Parser API"], request_body=ParseModelRequestSerializer, responses={ status.HTTP_202_ACCEPTED: ParseModelResponseSerializer, diff --git a/catalog/packages/views/health_check_views.py b/catalog/packages/views/health_check_views.py index cc1a379..e5aad9a 100644 --- a/catalog/packages/views/health_check_views.py +++ b/catalog/packages/views/health_check_views.py @@ -24,6 +24,7 @@ logger = logging.getLogger(__name__) class HealthCheckView(APIView): @swagger_auto_schema( + tags=["Health check API"], responses={ status.HTTP_200_OK: 'Active'}) def get(self, request, format=None): diff --git a/catalog/packages/views/ns_descriptor_views.py b/catalog/packages/views/ns_descriptor_views.py index 3b8c1f9..797bfec 100644 --- a/catalog/packages/views/ns_descriptor_views.py +++ b/catalog/packages/views/ns_descriptor_views.py @@ -34,6 +34,7 @@ logger = logging.getLogger(__name__) @swagger_auto_schema( method='GET', operation_description="Query a NSD", + tags=["NSD API"], request_body=no_body, responses={ status.HTTP_200_OK: NsdInfoSerializer(), @@ -44,6 +45,7 @@ logger = logging.getLogger(__name__) @swagger_auto_schema( method='DELETE', operation_description="Delete a NSD", + tags=["NSD API"], request_body=no_body, responses={ status.HTTP_204_NO_CONTENT: "No content", @@ -66,6 +68,7 @@ def ns_info_rd(request, **kwargs): @swagger_auto_schema( method='POST', operation_description="Create a NSD", + tags=["NSD API"], request_body=CreateNsdInfoRequestSerializer(), responses={ status.HTTP_201_CREATED: NsdInfoSerializer(), @@ -75,6 +78,7 @@ def ns_info_rd(request, **kwargs): @swagger_auto_schema( method='GET', operation_description="Query multiple NSDs", + tags=["NSD API"], request_body=no_body, responses={ status.HTTP_200_OK: NsdInfosSerializer(), @@ -100,6 +104,7 @@ def ns_descriptors_rc(request): @swagger_auto_schema( method='PUT', operation_description="Upload NSD content", + tags=["NSD API"], request_body=no_body, responses={ status.HTTP_204_NO_CONTENT: 'PNFD file', @@ -109,6 +114,7 @@ def ns_descriptors_rc(request): @swagger_auto_schema( method='GET', operation_description="Download NSD content", + tags=["NSD API"], request_body=no_body, responses={ status.HTTP_204_NO_CONTENT: "No content", diff --git a/catalog/packages/views/nsdm_subscription_views.py b/catalog/packages/views/nsdm_subscription_views.py index 5e6394e..b4b82ae 100644 --- a/catalog/packages/views/nsdm_subscription_views.py +++ b/catalog/packages/views/nsdm_subscription_views.py @@ -44,6 +44,7 @@ def validate_data(data, serializer): @swagger_auto_schema( method='POST', operation_description="Create Subscription for NSD Management", + tags=["NSD API"], request_body=NsdmSubscriptionRequestSerializer(), responses={ status.HTTP_201_CREATED: NsdmSubscriptionSerializer, @@ -55,6 +56,7 @@ def validate_data(data, serializer): @swagger_auto_schema( method='GET', operation_description="Query subscriptions for Nsd Management", + tags=["NSD API"], request_body=no_body, responses={ status.HTTP_200_OK: NsdmSubscriptionsSerializer(), @@ -94,6 +96,7 @@ def nsd_subscription_rc(request): @swagger_auto_schema( method='GET', operation_description="Query subscriptions for Nsd Management", + tags=["NSD API"], request_body=no_body, responses={ status.HTTP_200_OK: NsdmSubscriptionSerializer(), @@ -105,6 +108,7 @@ def nsd_subscription_rc(request): @swagger_auto_schema( method='DELETE', operation_description="Delete subscription for Nsd Management", + tags=["NSD API"], request_body=no_body, responses={ status.HTTP_204_NO_CONTENT: 'No_Content', diff --git a/catalog/packages/views/pnf_descriptor_views.py b/catalog/packages/views/pnf_descriptor_views.py index 9120980..381b557 100644 --- a/catalog/packages/views/pnf_descriptor_views.py +++ b/catalog/packages/views/pnf_descriptor_views.py @@ -39,6 +39,7 @@ logger = logging.getLogger(__name__) @swagger_auto_schema( method='GET', operation_description="Query a PNFD", + tags=["PNFD API"], request_body=no_body, responses={ status.HTTP_200_OK: PnfdInfoSerializer(), @@ -49,6 +50,7 @@ logger = logging.getLogger(__name__) @swagger_auto_schema( method='DELETE', operation_description="Delete a PNFD", + tags=["PNFD API"], request_body=no_body, responses={ status.HTTP_204_NO_CONTENT: "No content", @@ -74,6 +76,7 @@ def pnfd_info_rd(request, **kwargs): # TODO @swagger_auto_schema( method='POST', operation_description="Create a PNFD", + tags=["PNFD API"], request_body=CreatePnfdInfoRequestSerializer(), responses={ status.HTTP_201_CREATED: PnfdInfoSerializer(), @@ -83,6 +86,7 @@ def pnfd_info_rd(request, **kwargs): # TODO @swagger_auto_schema( method='GET', operation_description="Query multiple PNFDs", + tags=["PNFD API"], request_body=no_body, responses={ status.HTTP_200_OK: PnfdInfosSerializer(), @@ -107,6 +111,7 @@ def pnf_descriptors_rc(request): @swagger_auto_schema( method='PUT', operation_description="Upload PNFD content", + tags=["PNFD API"], request_body=no_body, responses={ status.HTTP_204_NO_CONTENT: "No content", @@ -116,6 +121,7 @@ def pnf_descriptors_rc(request): @swagger_auto_schema( method='GET', operation_description="Fetch PNFD content", + tags=["PNFD API"], request_body=no_body, responses={ status.HTTP_204_NO_CONTENT: 'PNFD file', @@ -145,6 +151,7 @@ def pnfd_content_ru(request, **kwargs): @swagger_auto_schema( method='POST', operation_description="Parse PNF model", + tags=["Parser API"], request_body=ParseModelRequestSerializer, responses={ status.HTTP_202_ACCEPTED: ParseModelResponseSerializer, diff --git a/catalog/packages/views/vnf_package_artifact_views.py b/catalog/packages/views/vnf_package_artifact_views.py index 0de9682..23a76c7 100644 --- a/catalog/packages/views/vnf_package_artifact_views.py +++ b/catalog/packages/views/vnf_package_artifact_views.py @@ -38,6 +38,7 @@ VALID_FILTERS = [ class FetchVnfPkgmArtifactsView(APIView): @swagger_auto_schema( + tags=["VNF Package API"], responses={ status.HTTP_200_OK: "HTTP_200_OK", status.HTTP_404_NOT_FOUND: ProblemDetailsSerializer(), diff --git a/catalog/packages/views/vnf_package_subscription_views.py b/catalog/packages/views/vnf_package_subscription_views.py index 32904e3..27be798 100644 --- a/catalog/packages/views/vnf_package_subscription_views.py +++ b/catalog/packages/views/vnf_package_subscription_views.py @@ -46,6 +46,7 @@ VALID_FILTERS = [ class CreateQuerySubscriptionView(APIView): @swagger_auto_schema( + tags=["VNF Package API"], request_body=PkgmSubscriptionRequestSerializer, responses={ status.HTTP_201_CREATED: PkgmSubscriptionSerializer(), @@ -62,6 +63,7 @@ class CreateQuerySubscriptionView(APIView): return Response(data=subscription_info.data, status=status.HTTP_201_CREATED) @swagger_auto_schema( + tags=["VNF Package API"], responses={ status.HTTP_200_OK: PkgmSubscriptionSerializer(), status.HTTP_400_BAD_REQUEST: ProblemDetailsSerializer(), @@ -87,6 +89,7 @@ class CreateQuerySubscriptionView(APIView): class QueryTerminateSubscriptionView(APIView): @swagger_auto_schema( + tags=["VNF Package API"], responses={ status.HTTP_200_OK: PkgmSubscriptionSerializer(), status.HTTP_404_NOT_FOUND: ProblemDetailsSerializer(), @@ -106,6 +109,7 @@ class QueryTerminateSubscriptionView(APIView): return Response(data=subscription_serializer.data, status=status.HTTP_200_OK) @swagger_auto_schema( + tags=["VNF Package API"], responses={ status.HTTP_204_NO_CONTENT: "", status.HTTP_404_NOT_FOUND: ProblemDetailsSerializer(), diff --git a/catalog/packages/views/vnf_package_views.py b/catalog/packages/views/vnf_package_views.py index 9fc143b..44e3df7 100644 --- a/catalog/packages/views/vnf_package_views.py +++ b/catalog/packages/views/vnf_package_views.py @@ -37,6 +37,7 @@ logger = logging.getLogger(__name__) @swagger_auto_schema( method="GET", operation_description="Query multiple VNF package resource", + tags=["VNF Package API"], request_body=no_body, responses={ status.HTTP_200_OK: VnfPkgInfosSerializer(), @@ -46,6 +47,7 @@ logger = logging.getLogger(__name__) @swagger_auto_schema( method="POST", operation_description="Create an individual VNF package resource", + tags=["VNF Package API"], request_body=CreateVnfPkgInfoRequestSerializer, responses={ status.HTTP_201_CREATED: VnfPkgInfoSerializer(), @@ -73,6 +75,7 @@ def vnf_packages_rc(request): @swagger_auto_schema( method='PUT', operation_description="Upload VNF package content", + tags=["VNF Package API"], request_body=no_body, responses={ status.HTTP_202_ACCEPTED: "Successfully", @@ -82,6 +85,7 @@ def vnf_packages_rc(request): @swagger_auto_schema( method="GET", operation_description="Fetch VNF package content", + tags=["VNF Package API"], request_body=no_body, responses={ status.HTTP_200_OK: VnfPkgInfosSerializer(), @@ -113,6 +117,7 @@ def package_content_ru(request, **kwargs): @swagger_auto_schema( method='POST', operation_description="Upload VNF package content from uri", + tags=["VNF Package API"], request_body=UploadVnfPackageFromUriRequestSerializer, responses={ status.HTTP_202_ACCEPTED: "Successfully", @@ -136,6 +141,7 @@ def upload_from_uri_c(request, **kwargs): @swagger_auto_schema( method='GET', operation_description="Query an individual VNF package resource", + tags=["VNF Package API"], request_body=no_body, responses={ status.HTTP_200_OK: VnfPkgInfoSerializer(), @@ -146,6 +152,7 @@ def upload_from_uri_c(request, **kwargs): @swagger_auto_schema( method='DELETE', operation_description="Delete an individual VNF package resource", + tags=["VNF Package API"], request_body=no_body, responses={ status.HTTP_204_NO_CONTENT: "No content", |