diff options
author | Luji7 <lu.ji3@zte.com.cn> | 2016-09-19 09:30:00 +0800 |
---|---|---|
committer | Luji7 <lu.ji3@zte.com.cn> | 2016-09-19 09:30:00 +0800 |
commit | 043f605643e9de8c1bc2d6ae7719a518b05e6ec0 (patch) | |
tree | 260c6cb4ee4abef0b5c8f3d4cabcb2556cec89cf /openo-portal/portal-lifecyclemgr | |
parent | fecb1a78a7d939c6c73c8f4399c614c97389d416 (diff) |
update implementation for service gateway api changes
Change-Id: I5d9a5b5bea79b63e01660c1cb3a8585eabc461a9
Signed-off-by: Luji7 <lu.ji3@zte.com.cn>
Diffstat (limited to 'openo-portal/portal-lifecyclemgr')
-rw-r--r-- | openo-portal/portal-lifecyclemgr/js/gsolcm.js | 41 |
1 files changed, 30 insertions, 11 deletions
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", |