from catalog.serializers import PostJobResponseSerializer
from catalog.serializers import ParseModelRequestSerializer
from catalog.serializers import ParseModelResponseSerializer
+from catalog.serializers import InternalErrorRequestSerializer
from drf_yasg import openapi
from drf_yasg.utils import no_body, swagger_auto_schema
openapi.Schema(
type=openapi.TYPE_STRING,
pattern='CSAR(\w+) distributed successfully.')),
- status.HTTP_500_INTERNAL_SERVER_ERROR: openapi.Response(
- 'error',
- openapi.Schema(
- type=openapi.TYPE_STRING))})
+ status.HTTP_500_INTERNAL_SERVER_ERROR: InternalErrorRequestSerializer})
@swagger_auto_schema(
method='GET',
operation_description="Query NS packages",
request_body=no_body,
responses={
status.HTTP_200_OK: NsPackagesSerializer,
- status.HTTP_500_INTERNAL_SERVER_ERROR: openapi.Response(
- 'error',
- openapi.Schema(
- type=openapi.TYPE_STRING))})
+ status.HTTP_500_INTERNAL_SERVER_ERROR: InternalErrorRequestSerializer})
@api_view(http_method_names=['POST', 'GET'])
def nspackages_rc(request, *args, **kwargs):
logger.debug("Enter %s, method is %s", fun_name(), request.method)
request_body=NfPackageDistributeRequestSerializer(),
responses={
status.HTTP_202_ACCEPTED: PostJobResponseSerializer,
- status.HTTP_500_INTERNAL_SERVER_ERROR: openapi.Response(
- 'error',
- openapi.Schema(
- type=openapi.TYPE_STRING))})
+ status.HTTP_500_INTERNAL_SERVER_ERROR: InternalErrorRequestSerializer})
@swagger_auto_schema(
method='GET',
operation_description="Query Nf packages",
request_body=no_body,
responses={
status.HTTP_200_OK: NfPackagesSerializer,
- status.HTTP_500_INTERNAL_SERVER_ERROR: openapi.Response(
- 'error',
- openapi.Schema(
- type=openapi.TYPE_STRING))})
+ status.HTTP_500_INTERNAL_SERVER_ERROR: InternalErrorRequestSerializer})
@api_view(http_method_names=['POST', 'GET'])
def nfpackages_rc(request, *args, **kwargs):
logger.debug(
request_body=ParseModelRequestSerializer,
responses={
status.HTTP_202_ACCEPTED: ParseModelResponseSerializer,
- status.HTTP_500_INTERNAL_SERVER_ERROR: openapi.Response(
- 'error',
- openapi.Schema(
- type=openapi.TYPE_STRING))})
+ status.HTTP_500_INTERNAL_SERVER_ERROR: InternalErrorRequestSerializer})
@api_view(http_method_names=['POST'])
def ns_model_parser(request, *args, **kwargs):
csar_id = ignore_case_get(request.data, "csarId")
request_body=ParseModelRequestSerializer,
responses={
status.HTTP_202_ACCEPTED: ParseModelResponseSerializer,
- status.HTTP_500_INTERNAL_SERVER_ERROR: openapi.Response(
- 'error',
- openapi.Schema(
- type=openapi.TYPE_STRING))})
+ status.HTTP_500_INTERNAL_SERVER_ERROR: InternalErrorRequestSerializer})
@api_view(http_method_names=['POST'])
def vnf_model_parser(request, *args, **kwargs):
csar_id = ignore_case_get(request.data, "csarId")