summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSonsino, Ofir (os0695) <os0695@intl.att.com>2018-05-25 19:11:02 +0300
committerSonsino, Ofir (os0695) <os0695@intl.att.com>2018-05-25 19:11:02 +0300
commitcd389fd8381b37db031b777791910fd4a062912c (patch)
tree81e12a795849a97df7f1e20cf6dcd09f30497e1b
parentdaa1cf9ca3d60c5e5c0313a2cb42778d3934e1dc (diff)
Scale out fixes
Change-Id: Ibab8a96558d16a1b030a52583eeb17e9ad036f84 Issue-ID: VID-188 Signed-off-by: Sonsino, Ofir (os0695) <os0695@intl.att.com>
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js41
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/services/change-management.service.js11
2 files changed, 43 insertions, 9 deletions
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js
index f76a64b06..d37bcb8c1 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js
@@ -209,14 +209,14 @@
if(moduleToScale.userParams) {
requestParametersData = {
controllerType: changeManagement.controllerType,
- userParams: moduleToScale.userParams,
- usePreload: true
+ userParams: moduleToScale.userParams
+ //,usePreload: true
}
}else{
requestParametersData = {
controllerType: changeManagement.controllerType,
- userParams: [],
- usePreload: false
+ userParams: []
+ //,usePreload: false
}
}
}
@@ -250,13 +250,14 @@
modelInvariantId: moduleToScale.invariantUuid,
modelName: name,
modelVersion: moduleToScale.version,
- modelCustomizationId: moduleToScale.customizationUuid
+ modelVersionId: moduleToScale.uuid
},
cloudConfiguration: vnf.cloudConfiguration,
requestInfo: requestInfoData,
relatedInstanceList: [],
requestParameters:requestParametersData
}
+ requestInfoData.instanceName = vnf.name;
}else{
data = {
vnfName: vnf.name,
@@ -304,7 +305,22 @@
data.relatedInstanceList.push({relatedInstance: relatedInstance});
});
- }
+ if(workflowType=="VNF Scale Out") {
+ //push vnf to related as well as the service instance
+ var relatedInstance = {
+ instanceId: vnf.id,
+ modelInfo: {
+ modelCustomizationName: vnf.availableVersions[0].modelInfo.modelCustomizationName,
+ modelInvariantId: vnf.availableVersions[0].modelInfo.modelInvariantId,
+ modelName: vnf.availableVersions[0].modelInfo.modelName,
+ modelType: vnf.availableVersions[0].modelInfo.modelType,
+ modelVersion: vnf.availableVersions[0].modelInfo.modelVersion,
+ modelVersionId: vnf.availableVersions[0].modelInfo.modelVersionId
+ }
+ };
+ data.relatedInstanceList.push({relatedInstance: relatedInstance});
+ }
+ }
}catch(err){
$log.error('SchedulerCtrl::extractChangeManagementCallbackDataStr error: ' + err);
}
@@ -334,9 +350,16 @@
//no scheduling support
var dataToSo = extractChangeManagementCallbackDataStr(vm.changeManagement);
if(dataToSo) {
- //TODO: foreach
- var vnfName = vm.changeManagement.vnfNames[0].name;
- changeManagementService.postChangeManagementNow(dataToSo, vnfName);
+
+ if(vm.changeManagement.workflow==="VNF Scale Out") {
+ dataToSo = JSON.parse(dataToSo);
+ dataToSo = {requestDetails: dataToSo.requestDetails[0]};
+ changeManagementService.postChangeManagementScaleOutNow(dataToSo, vm.changeManagement.vnfNames[0]["service-instance-node"][0].properties["service-instance-id"], vm.changeManagement.vnfNames[0].id);
+ }else{
+ //TODO: foreach
+ var vnfName = vm.changeManagement.vnfNames[0].name;
+ changeManagementService.postChangeManagementNow(dataToSo, vnfName);
+ }
}
}
};
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/change-management.service.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/change-management.service.js
index f170c4182..03e41b2c1 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/change-management.service.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/change-management.service.js
@@ -87,5 +87,16 @@
return {data: []};
});
};
+
+ this.postChangeManagementScaleOutNow = function (requestData, serviceInstanceId, vnfId) {
+ var url = "mso/mso_create_vfmodule_instance/"+serviceInstanceId+"/vnfs/"+vnfId;
+ return $http.post(url, requestData)
+ .success(function (response) {
+ return {data: response};
+ })
+ .catch(function (err) {
+ return {data: []};
+ });
+ };
}
})();