diff options
Diffstat (limited to 'zte/vmanager')
-rw-r--r-- | zte/vmanager/driver/interfaces/tests.py | 2 | ||||
-rw-r--r-- | zte/vmanager/driver/interfaces/views.py | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/zte/vmanager/driver/interfaces/tests.py b/zte/vmanager/driver/interfaces/tests.py index c0c062c8..5e975f04 100644 --- a/zte/vmanager/driver/interfaces/tests.py +++ b/zte/vmanager/driver/interfaces/tests.py @@ -181,7 +181,7 @@ class InterfacesTest(TestCase): "gracefulTerminationTimeout": 120 } response = self.client.post( - "/api/ztevnfmdriver/v1/ztevnfmid/vnfs/vbras_innstance_id/terminate", data=req_data) + "/api/ztevnfmdriver/v1/ztevnfmid/vnfs/1/terminate", data=req_data) self.assertEqual(status.HTTP_200_OK, response.status_code) expect_resp_data = {"jobId": "1", "vnfInstanceId": "1"} diff --git a/zte/vmanager/driver/interfaces/views.py b/zte/vmanager/driver/interfaces/views.py index 11dd6a09..fd99a92d 100644 --- a/zte/vmanager/driver/interfaces/views.py +++ b/zte/vmanager/driver/interfaces/views.py @@ -193,6 +193,7 @@ class TerminateVnf(APIView): def post(self, request, vnfmid, vnfInstanceId): try: logger.debug("[%s] request.data=%s", fun_name(), request.data) + logger.debug("vnfmid=%s, vnfInstanceId=%s", vnfmid, vnfInstanceId) terminate_vnf_request_serializer = TerminateVnfRequestSerializer(data=request.data) if not terminate_vnf_request_serializer.is_valid(): raise Exception(terminate_vnf_request_serializer.errors) @@ -208,15 +209,15 @@ class TerminateVnf(APIView): user=ignorcase_get(vnfm_info, "userName"), passwd=ignorcase_get(vnfm_info, "password"), auth_type=restcall.rest_no_auth, - resource="v1/vnfs/%s" % vnfInstanceId, + resource="v1/vnfs/%s?NFVOID=1&VNFMID=%s" % (vnfInstanceId, vnfmid), method='delete', - content=json.JSONEncoder().encode(terminate_vnf_request_serializer.data)) + content='{}') if ret[0] != 0: raise Exception(ret[1]) resp = json.JSONDecoder().decode(ret[1]) resp_data = { - "vnfInstanceId": ignorcase_get(resp, "VNFInstanceID"), + "vnfInstanceId": vnfInstanceId, "jobId": ignorcase_get(resp, "JobId") } logger.debug("[%s]resp_data=%s", fun_name(), resp_data) |