Fix VFC swagger bug 63/8863/1
authormaopengzhang <zhang.maopeng1@zte.com.cn>
Sat, 26 Aug 2017 07:38:58 +0000 (15:38 +0800)
committermaopengzhang <zhang.maopeng1@zte.com.cn>
Sat, 26 Aug 2017 07:38:58 +0000 (15:38 +0800)
Add get job status swagger defintion;

Change-Id: Iaa3405f5082c4727586f03836787c526cc9ddc3c
Issue-ID: VFC-144
Signed-off-by: maopengzhang <zhang.maopeng1@zte.com.cn>
lcm/swagger/vfc.nslcm.swagger.json
lcm/swagger/vfc.others.swagger.json
lcm/swagger/views.py

index 75cc6ba..528ec67 100644 (file)
       }\r
     },\r
     "/jobs/{jobId}": {\r
-      "post": {\r
+      "get": {\r
         "tags": [\r
           "job"\r
         ],\r
         "summary": "jobstatus",\r
         "description": "",\r
-        "operationId": "jobstatus",\r
+        "operationId": "get_jobstatus",\r
         "parameters": [\r
           {\r
             "required": true,\r
             "type": "string",\r
-            "description": "",\r
+            "description": "job Id",\r
             "name": "jobId",\r
             "in": "path"\r
           },\r
           {\r
-            "in": "body",\r
-            "name": "body",\r
-            "description": "request param",\r
             "required": true,\r
-            "schema": {\r
-              "$ref": "#/definitions/JobProgressRequest"\r
-            }\r
+            "type": "string",\r
+            "description": "job response message id",\r
+            "name": "responseId",\r
+            "in": "query"\r
           }\r
         ],\r
         "responses": {\r
           "202": {\r
-            "description": ""\r
+            "description": "",\r
+             "schema": {\r
+              "$ref": "#/definitions/JobDetailInfo"\r
+            }\r
           }\r
         }\r
       }\r
         }\r
       }\r
     },\r
-    "JobProgressRequest": {\r
-      "type": "object",\r
-      "properties": {\r
-        "progress": {\r
-          "type": "string"\r
-        },\r
-        "desc": {\r
-          "type": "string"\r
-        },\r
-        "errcode": {\r
-          "type": "string"\r
-        }\r
-      }\r
-    },\r
+   \r
     "NsInfo": {\r
       "type": "object",\r
       "properties": {\r
           "type": "string"\r
         }\r
       }\r
+    },\r
+    "jobResponseInfo": {\r
+       "type": "object",\r
+       "properties": {\r
+          "status": {\r
+            "type": "string"\r
+          },\r
+         "progress":{\r
+            "type": "string"\r
+         },\r
+         "statusDescription": {\r
+            "type": "string"\r
+         },\r
+         "errorCode": {\r
+            "type": "string"\r
+         },\r
+         "responseId": {\r
+            "type": "string"\r
+        }\r
+       }\r
+    },\r
+    "JobDetailInfo":{\r
+      "type": "object",\r
+      "properties": {\r
+            "jobId": {\r
+               "type": "string"\r
+             },\r
+            "responseDescriptor": \r
+            {\r
+                "type":"object",\r
+                "properties": {\r
+                    "status": {\r
+                       "type": "string"\r
+                    },\r
+                    "progress":{\r
+                       "type": "string"\r
+                    },\r
+                    "statusDescription": {\r
+                       "type": "string"\r
+                    },\r
+                    "errorCode": {\r
+                       "type": "string"\r
+                    },\r
+                    "responseId": {\r
+                       "type": "string"\r
+                    },\r
+                    "responseHistoryList": {\r
+                        "type": "array",\r
+                        "items": {\r
+                           "$ref": "#/definitions/jobResponseInfo"\r
+                        }\r
+                    }\r
+                }\r
+           }\r
+      }\r
     }\r
   }\r
 }
\ No newline at end of file
index 9be7490..f6b48fb 100644 (file)
                     }
                 }
             }
+        },
+        "/jobs/{jobId}": {
+          "post": {
+            "tags": [
+              "job"
+            ],
+            "summary": "jobstatus",
+            "description": "",
+            "operationId": "post_jobprogress",
+            "parameters": [
+              {
+                "required": true,
+                "type": "string",
+                "description": "",
+                "name": "jobId",
+                "in": "path"
+              },
+              {
+                "in": "body",
+                "name": "body",
+                "description": "request param",
+                "required": true,
+                "schema": {
+                  "$ref": "#/definitions/JobProgressRequest"
+                }
+              }
+            ],
+            "responses": {
+              "202": {
+                "description": ""
+              }
+            }
         }
+      }
     },
     "definitions": {
 
                 }
             }
         },
-
-
+        "JobProgressRequest": {
+          "type": "object",
+          "properties": {
+            "progress": {
+              "type": "string"
+            },
+            "desc": {
+              "type": "string"
+            },
+            "errcode": {
+              "type": "string"
+            }
+          }
+        },
         "TableInfo": {
             "type": "object",
             "properties": {
index 8386bf0..fdef8ae 100644 (file)
@@ -64,7 +64,9 @@ class SwaggerJsonView(APIView):
         json_data_temp = json.JSONDecoder().decode(f.read())
         f.close()
 
+        json_data_jobtemp=json_data["paths"]["/jobs/{jobId}"]
         json_data["paths"].update(json_data_temp["paths"])
+        json_data["paths"]["/jobs/{jobId}"].update(json_data_jobtemp)
         json_data["definitions"].update(json_data_temp["definitions"])
 
         return Response(json_data)