fix NS update error 14/72614/1
authormaopengzhang <zhang.maopeng1@zte.com.cn>
Wed, 14 Nov 2018 08:32:27 +0000 (16:32 +0800)
committermaopengzhang <zhang.maopeng1@zte.com.cn>
Wed, 14 Nov 2018 08:32:27 +0000 (16:32 +0800)
fix  NS update error in VNFLCM

Change-Id: I47f345b6f716758c387291ea546281531ef7d856
Issue-ID: VFC-1185
Signed-off-by: maopengzhang <zhang.maopeng1@zte.com.cn>
lcm/lcm/nf/views/heal_vnf_view.py
lcm/lcm/nf/views/operate_vnf_view.py

index 08daa98..6b3b313 100644 (file)
@@ -52,8 +52,9 @@ class HealVnfView(APIView):
             JobUtil.add_job_status(job_id, 0, "HEAL_VNF_READY")\r
             self.heal_pre_check(instanceid, job_id)\r
             HealVnf(heal_vnf_request_serializer.data, instanceid, job_id).start()\r
-            response = Response(data=None, status=status.HTTP_202_ACCEPTED)\r
-            response["Location"] = "/vnf_lc_ops/%s" % job_id\r
+            response = Response(data={"jobId": job_id}, status=status.HTTP_202_ACCEPTED)\r
+            # todo, heal_vnf codes uses job as the status storage, not in VNFLcmOpOccModel.\r
+            # response["Location"] = "/api/vnflcm/v1/vnf_lc_ops/%s" % lcmopoccid\r
             return response\r
         except NFLCMExceptionNotFound as e:\r
             probDetail = ProblemDetailsSerializer(data={"status": status.HTTP_404_NOT_FOUND, "detail": "VNF Instance not found"})\r
index 947e983..ab8f905 100644 (file)
@@ -52,8 +52,9 @@ class OperateVnfView(APIView):
             JobUtil.add_job_status(job_id, 0, "OPERATE_VNF_READY")\r
             self.operate_pre_check(instanceid, job_id)\r
             OperateVnf(operate_vnf_request_serializer.data, instanceid, job_id).start()\r
-            response = Response(data=None, status=status.HTTP_202_ACCEPTED)\r
-            response["Location"] = "/vnf_lc_ops/%s" % job_id\r
+            response = Response(data={"jobId": job_id}, status=status.HTTP_202_ACCEPTED)\r
+            # Location todo, it use job as the status storage\r
+            # response["Location"] = "/api/vnflcm/v1/vnf_lcm_op_occs/%s" % lcmopoccid\r
             return response\r
         except NFLCMExceptionNotFound as e:\r
             probDetail = ProblemDetailsSerializer(data={"status": 404, "detail": "VNF Instance not found"})\r