diff options
author | 2017-11-07 15:17:04 +0800 | |
---|---|---|
committer | 2017-11-07 15:17:08 +0800 | |
commit | 337f08fb45a5f84cbc0a17915ea387bb1b269221 (patch) | |
tree | f57b4db6e2406b6fd247de760a4f075c08fe8605 /usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/controller/ServiceTemplateService.js | |
parent | b52a4f74875fd4c8082268e7eb2cdb6f75ac5bb6 (diff) |
add onboard result
Change-Id: I715eed694b35c469ea00fc3a78bf1bde8acac64c
Issue-id: USECASEUI-55
Signed-off-by: Luji7 <lu.ji3@zte.com.cn>
Diffstat (limited to 'usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/controller/ServiceTemplateService.js')
-rw-r--r-- | usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/controller/ServiceTemplateService.js | 96 |
1 files changed, 74 insertions, 22 deletions
diff --git a/usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/controller/ServiceTemplateService.js b/usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/controller/ServiceTemplateService.js index d46c35c4..09c40b56 100644 --- a/usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/controller/ServiceTemplateService.js +++ b/usecaseui-lcm/src/main/webapp/app/uui/fusion/scripts/controller/ServiceTemplateService.js @@ -266,6 +266,7 @@ uuid: ns.uuid, invariantUUID: ns.invariantUUID, name: ns.name, + version: ns.version, type: 'NS' }) }); @@ -274,6 +275,7 @@ uuid: vnf.uuid, invariantUUID: vnf.invariantUUID, name: vnf.name, + version: vnf.version,, type: 'VF' }) }); @@ -281,33 +283,83 @@ }); }, - packageOnboard: function (onboardPackage) { + nsPackageOnboard: function (onboardPackage, processFun) { console.log('onboard...'); console.log(onboardPackage); var requestBody = { csarId: onboardPackage.uuid }; - if(onboardPackage.type === 'NS') { - return $http({ - url: url+'/ns-packages', - method: 'POST', - data: JSON.stringify(requestBody), - headers: uuiHeaders - }).then(function(response){ - console.log('onboard ns package response...'); - console.log(response.data); - }); - } else { - return $http({ - url: url+'/vf-packages', - method: 'POST', - data: JSON.stringify(requestBody), - headers: uuiHeaders - }).then(function(response){ - console.log('onboard vf package response...'); - console.log(response.data); - }); - } + return $http({ + url: url+'/ns-packages', + method: 'POST', + data: JSON.stringify(requestBody), + headers: uuiHeaders + }).then(function(response){ + console.log('onboard ns package response...'); + console.log(response.data); + processFun(response.data); + }); + }, + + vfPackageOnboard: function (onboardPackage, processFun) { + console.log('onboard...'); + console.log(onboardPackage); + var requestBody = { + csarId: onboardPackage.uuid + }; + return $http({ + url: url+'/vf-packages', + method: 'POST', + data: JSON.stringify(requestBody), + headers: uuiHeaders + }).then(function(response){ + console.log('onboard vf package response...'); + console.log(response.data); + processFun(response.data); + }); + }, + + queryVfOnboardProgress: function (jobId, progressFun) { + return $http({ + url: url+'/jobs/' + jobId, + method: 'GET', + data: null, + headers: uuiHeaders + }).then(function(response){ + console.log('get progress response...'); + console.log(response.data); + progressFun(response.data.responseDescriptor); + }); + }, + + nsPackageDelete: function (deletePackage, processFun) { + console.log('delete package...'); + console.log(deletePackage); + return $http({ + url: url+'/ns-packages/' + deletePackage.uuid, + method: 'DELETE', + data: null, + headers: uuiHeaders + }).then(function(response){ + console.log('delete ns package response...'); + console.log(response.data); + processFun(response.data); + }); + }, + + vfPackageDelete: function (deletePackage, processFun) { + console.log('delete package...'); + console.log(deletePackage); + return $http({ + url: url+'/vf-packages/' + deletePackage.uuid, + method: 'DELETE', + data: null, + headers: uuiHeaders + }).then(function(response){ + console.log('delete vf package response...'); + console.log(response.data); + processFun(response.data); + }); } }; }); |