From 043f605643e9de8c1bc2d6ae7719a518b05e6ec0 Mon Sep 17 00:00:00 2001 From: Luji7 Date: Mon, 19 Sep 2016 09:30:00 +0800 Subject: update implementation for service gateway api changes Change-Id: I5d9a5b5bea79b63e01660c1cb3a8585eabc461a9 Signed-off-by: Luji7 --- openo-portal/portal-lifecyclemgr/js/gsolcm.js | 41 ++++++++++++++++++++------- 1 file changed, 30 insertions(+), 11 deletions(-) (limited to 'openo-portal/portal-lifecyclemgr/js') diff --git a/openo-portal/portal-lifecyclemgr/js/gsolcm.js b/openo-portal/portal-lifecyclemgr/js/gsolcm.js index 9655691d..d8c3fa1d 100644 --- a/openo-portal/portal-lifecyclemgr/js/gsolcm.js +++ b/openo-portal/portal-lifecyclemgr/js/gsolcm.js @@ -282,8 +282,7 @@ function createNetworkService(gatewayService, gatewayUri, serviceInstance) { 'nsdId': serviceInstance.serviceTemplateId, 'nsName': serviceInstance.serviceName, 'description': serviceInstance.serviceDescription, - 'gatewayUri': gatewayUri, - 'parameters': serviceInstance.serviceParameters + 'gatewayUri': gatewayUri }; var nsInstanceId; $.ajax({ @@ -396,15 +395,27 @@ function deleteServiceInstance(templateId, instanceId) { function deleteGsoServiceInstance(gatewayService, instanceId) { var gsoLcmUrl = '/openoapi/lifecyclemgr/v1/services/'+ instanceId; - return sendDeleteRequest(gatewayService, gsoLcmUrl); + var operation = 'DELETE'; + return sendDeleteRequest(operation, gatewayService, gsoLcmUrl); } function deleteNfvoServiceInstance(gatewayService, instanceId) { var nfvoNsUrl = '/openoapi/nslcm/v1.0/ns/' + instanceId; var nfvoNsTerminateUrl = nfvoNsUrl +'/terminate'; - var result = sendDeleteRequest(gatewayService, nfvoNsTerminateUrl); + var terminateParameter = { + 'nsInstanceId': instanceId, + 'terminationType': "graceful", + 'gracefulTerminationTimeout': "60", + 'operation': "POST", + 'gatewayUri': nfvoNsTerminateUrl + }; + var result = sendRequest(gatewayService, terminateParameter); if(result) { - result = sendDeleteRequest(gatewayService, nfvoNsUrl); + var serviceParameter = { + 'operation': "DELETE", + 'gatewayUri': nfvoNsUrl + }; + result = sendRequest(gatewayService, serviceParameter); } return result; } @@ -412,17 +423,25 @@ function deleteNfvoServiceInstance(gatewayService, instanceId) { function deleteSdnoServiceInstance(gatewayService, instanceId) { var sdnoNsUrl = '/openoapi/sdnonslcm/v1.0/ns/' + instanceId; var sdnoNsTerminateUrl = sdnoNsUrl + '/terminate'; - var result = sendDeleteRequest(gatewayService, sdnoNsTerminateUrl); + var terminateParameter = { + 'nsInstanceId': instanceId, + 'terminationType': "graceful", + 'gracefulTerminationTimeout': "60", + 'operation': "POST", + 'gatewayUri': sdnoNsTerminateUrl + }; + var result = sendDeleteRequest(gatewayService, terminateParameter); if(result) { - result = sendDeleteRequest(gatewayService, sdnoNsUrl); + var serviceParameter = { + 'operation': "DELETE", + 'gatewayUri': sdnoNsUrl + }; + result = sendDeleteRequest(gatewayService, serviceParameter); } return result; } -function sendDeleteRequest(gatewayService, url) { - var parameter = { - URL: url - }; +function sendDeleteRequest(gatewayService, parameter) { var result = false; $.ajax({ type : "DELETE", -- cgit 1.2.3-korg