_.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 - mdl.currentCount > 0;
}else{
mdl.scalable = false;
}
};
var extractVNFModel = function (csarVNF, sdcService, selectionVNF) {
+ /**
+ @param selectionVNF A vnf *instance* selected in "available VNF" drop-down box
+ @param csarVNF A VNF *MODEL* that has an invariantUuid same as selectionVNF (might be
+ a different version; i.e. selectionVNF.modelVersionId <> csarVNF.uuid)
+ @param sdcService The Service *MODEL* which has the related VNF `csarVNF`.
+ */
var versionCsarData = {
vnfInstanceId: "",
vnfName: csarVNF.name,
modelInfo: {
modelType: "vnf",
modelInvariantId: csarVNF.invariantUuid,
- modelVersionId: selectionVNF.modelVersionId,
+ modelVersionId: csarVNF.uuid,
modelName: csarVNF.name,
modelVersion: csarVNF.version,
modelCustomizationName: csarVNF.modelCustomizationName,
instanceId: selectionVNF["service-instance-node"]["0"].properties['service-instance-id'],
modelInfo: {
modelType: "service",
- modelInvariantId: selectionVNF["service-instance-node"]["0"].properties['model-invariant-id'],
- modelVersionId: selectionVNF.modelVersionId,
+ modelInvariantId: sdcService.invariantUuid,
+ modelVersionId: sdcService.uuid,
modelName: sdcService.name,
- modelVersion: sdcService.version,
- modelCustomizationName: selectionVNF["service-instance-node"]["0"].properties['model-customization-name'], //TODO: Missing
- modelCustomizationId: selectionVNF["service-instance-node"]["0"].properties['model-customization-id']
+ modelVersion: sdcService.version
}
}
}
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,
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,
//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);
}
}
};