aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js
diff options
context:
space:
mode:
Diffstat (limited to 'vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js')
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js38
1 files changed, 18 insertions, 20 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 c55092e4c..3a5a1c7e0 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
@@ -10,7 +10,7 @@
vm.hasScheduler = !!VIDCONFIGURATION.SCHEDULER_PORTAL_URL;
vm.configUpdatePatternError = "Invalid file type. Please select a file with a CSV extension.";
vm.configUpdateContentError = "Invalid file structure.";
-
+
vm.wizardStep = 1;
vm.nextStep = function(){
vm.wizardStep++;
@@ -94,14 +94,14 @@
_.forEach(newVNFName.vfModules, function (mdl, key) {
mdl.scale = false; //defaults to not scale unless user changes it
- if(mdl.properties && mdl.properties.max_vf_module_instances) {
+ if(mdl.properties && mdl.properties.maxCountInstances) {
//how many vf modules of the same customizationId belong to that vnf instance
mdl.currentCount = _.filter(vm.vfModules, function(item){
return modulesAaiIds.indexOf(item.id) > -1 && item.properties["model-customization-id"] === mdl.customizationUuid;
}).length;
- mdl.scalable = mdl.properties.max_vf_module_instances.value - mdl.currentCount > 0;
+ mdl.scalable = mdl.properties.maxCountInstances.value - mdl.currentCount > 0;
}else{
mdl.scalable = false;
}
@@ -193,9 +193,10 @@
var result = {};
result.requestType = changeManagement.workflow;
var workflowType = changeManagement.workflow;
+ var configurationParameters = changeManagement.configurationParameters;
result.requestDetails = [];
_.forEach(changeManagement.vnfNames, function (vnf) {
-
+
try{
var requestInfoData ={};
var requestParametersData ={};
@@ -203,13 +204,13 @@
return !item.scale;
});
if (vnf.availableVersions && vnf.availableVersions.length!=0){
-
+
requestInfoData ={
source: vnf.availableVersions[0].requestInfo.source,
suppressRollback: vnf.availableVersions[0].requestInfo.suppressRollback,
requestorId: vnf.availableVersions[0].requestInfo.requestorId
}
-
+
if(workflowType=='Update'){
requestParametersData = {
usePreload: vnf.availableVersions[0].requestParameters.usePreload
@@ -268,17 +269,22 @@
var data;
if(workflowType=="VNF Scale Out") {
data = {
+ vnfName: vnf.name,
+ vnfInstanceId: vnf.id,
modelInfo: {
modelType: 'vfModule',
modelInvariantId: moduleToScale.invariantUuid,
modelName: moduleToScale.modelCustomizationName,
modelVersion: moduleToScale.version,
+ modelCustomizationName: moduleToScale.modelCustomizationName,
+ modelCustomizationId: moduleToScale.customizationUuid,
modelVersionId: moduleToScale.uuid
},
cloudConfiguration: vnf.cloudConfiguration,
requestInfo: requestInfoData,
relatedInstanceList: [],
- requestParameters:requestParametersData
+ requestParameters:requestParametersData,
+ configurationParameters: JSON.parse(configurationParameters)
};
requestInfoData.instanceName = vnf.name + "_" + (moduleToScale.currentCount + 1);
}else{
@@ -333,6 +339,7 @@
var relatedInstance = {
instanceId: vnf.id,
modelInfo: {
+ modelCustomizationId: vnf.availableVersions[0].modelInfo.modelCustomizationId,
modelCustomizationName: vnf.availableVersions[0].modelInfo.modelCustomizationName,
modelInvariantId: vnf.availableVersions[0].modelInfo.modelInvariantId,
modelName: vnf.availableVersions[0].modelInfo.modelName,
@@ -352,7 +359,6 @@
});
return JSON.stringify(result);
}
-
vm.openModal = function () {
if(vm.hasScheduler) { //scheduling supported
$scope.widgetParameter = ""; // needed by the scheduler?
@@ -370,22 +376,14 @@
widgetData: vm.changeManagement,
widgetParameter: $scope.widgetParameter
};
-
+
window.parent.postMessage(data, VIDCONFIGURATION.SCHEDULER_PORTAL_URL);
} else {
//no scheduling support
var dataToSo = extractChangeManagementCallbackDataStr(vm.changeManagement);
if(dataToSo) {
-
- 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);
- }
+ var vnfName = vm.changeManagement.vnfNames[0].name;
+ changeManagementService.postChangeManagementNow(dataToSo, vnfName);
}
}
};
@@ -649,7 +647,7 @@
vm.isConfigUpdate = function () {
return vm.changeManagement.workflow === COMPONENT.WORKFLOWS.vnfConfigUpdate;
}
-
+
vm.isScaleOut = function () {
return vm.changeManagement.workflow === COMPONENT.WORKFLOWS.vnfScaleOut;
}