diff options
author | 2018-10-12 16:49:58 +0800 | |
---|---|---|
committer | 2018-10-12 16:49:58 +0800 | |
commit | 0b26f00338deb21f46a3aa9df0b80602663a086e (patch) | |
tree | a0b421dd714d6e244ce7817272d2a0667ec727a5 | |
parent | 31b41e271ab2002be5cd0c99331771df219bdeaf (diff) |
Add job req param swagger definition
Change-Id: Ib61cfa6871841575cde8c9e14c7ba8d50e7e95f5
Issue-ID: VFC-1146
Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
-rw-r--r-- | lcm/jobs/views.py | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/lcm/jobs/views.py b/lcm/jobs/views.py index 75f248dc..f60189ef 100644 --- a/lcm/jobs/views.py +++ b/lcm/jobs/views.py @@ -30,14 +30,21 @@ logger = logging.getLogger(__name__) class JobView(APIView): + + input_job_id = openapi.Parameter( + 'job_id', + openapi.IN_QUERY, + description="job id", + type=openapi.TYPE_STRING) + input_response_id = openapi.Parameter( + 'responseId', + openapi.IN_QUERY, + description="response id", + type=openapi.TYPE_STRING) + @swagger_auto_schema( - manual_parameters=[ - openapi.Parameter('responseId', - openapi.IN_QUERY, - "responseId", - type=openapi.TYPE_INTEGER - ), - ], + operation_description="Query job", + manual_parameters=[input_job_id, input_response_id], responses={ status.HTTP_200_OK: JobQueryRespSerializer(), status.HTTP_500_INTERNAL_SERVER_ERROR: "Inner error" @@ -56,6 +63,8 @@ class JobView(APIView): return Response(data={'error': e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR) @swagger_auto_schema( + operation_description="Update job", + manual_parameters=[input_job_id], request_body=JobUpdReqSerializer(), responses={ status.HTTP_202_ACCEPTED: JobUpdRespSerializer() |