diff options
author | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2018-08-09 09:32:29 -0400 |
---|---|---|
committer | Marcus Williams <marcus.williams@intel.com> | 2018-08-09 22:34:52 +0000 |
commit | 709352852e50aa92edc9cf80a7d1c0387c532521 (patch) | |
tree | ecdb8b85504808f7c35f76ab6332cbab9f320b3b /asdc-controller/src/main/java/org | |
parent | f690106dbb6f2da96fdaa35541bc5ba152f9d299 (diff) |
GR-API flow, VF Module, SDNC GR API Fixes
Fixes the new GR-API flow
Various fixes in the create VF Module area
Fixes issues parsing the SDNC GR API response
Fixes new resource type in ASDC controller
Fixes AppC mismatch in JSON marshaling
Issue-ID: SO-821
Change-Id: I4ace0d348483ab1303fcfee26c5801674be51466
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'asdc-controller/src/main/java/org')
3 files changed, 14 insertions, 32 deletions
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/ToscaResourceStructure.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/ToscaResourceStructure.java index 565ddf42b5..8353f708a9 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/ToscaResourceStructure.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/ToscaResourceStructure.java @@ -65,7 +65,6 @@ public class ToscaResourceStructure { String envHeatTemplateUUID; String heatFilesUUID; String workloadPerformance; - boolean isVnfAlreadyInstalled = false; String serviceVersion; private boolean isDeployedSuccessfully=false; @@ -314,14 +313,6 @@ public class ToscaResourceStructure { this.toscaCsar = toscaCsar; } - public boolean isVnfAlreadyInstalled() { - return isVnfAlreadyInstalled; - } - - public void setVnfAlreadyInstalled(boolean isVnfAlreadyInstalled) { - this.isVnfAlreadyInstalled = isVnfAlreadyInstalled; - } - public String getVolHeatTemplateUUID() { return volHeatTemplateUUID; } diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java index ea952f6daf..87df2648d1 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java @@ -440,33 +440,13 @@ public class ToscaResourceInstaller { VfModuleCustomization vfModuleCustomization = createVFModuleResource(matchingObject.get(), nodeTemplate, toscaResourceStruct, vfResourceStructure,vfMetadata, vnfResource); vfModuleCustomization.getVfModule().setVnfResources(vnfResource.getVnfResources()); }else - throw (new Exception("Cannot find matching VFModule Customization")); + throw new Exception("Cannot find matching VFModule Customization for VF Module Metadata: " + vfMetadata.getVfModuleModelCustomizationUUID()); } service.getVnfCustomizations().add(vnfResource); } } - protected void processFlexware(ToscaResourceStructure toscaResourceStruct, Service service, NodeTemplate nodeTemplate, - String serviceType) { - if (serviceType != null && serviceType.equalsIgnoreCase("Flexware")) { - - createVnfResource(nodeTemplate, toscaResourceStruct, service); - String modelName = toscaResourceStruct.getVnfResourceCustomization().getVnfResources().getModelName(); - - String modelVersion = BigDecimalVersion.castAndCheckNotificationVersionToString( - toscaResourceStruct.getCatalogVnfResourceCustomization().getVnfResources().getModelVersion()); - // check for duplicate record already in the database - VnfResource vnfResource = vnfRepo.findByModelNameAndModelVersion(modelName, modelVersion); - - if (vnfResource != null) { - toscaResourceStruct.setVnfAlreadyInstalled(true); - } - - vnfCustomizationRepo.saveAndFlush(toscaResourceStruct.getCatalogVnfResourceCustomization()); - } - } - public void processWatchdog(String distributionId, String servideUUID) { WatchdogServiceModVerIdLookup modVerIdLookup = new WatchdogServiceModVerIdLookup(distributionId,servideUUID); watchdogModVerIdLookupRepository.saveAndFlush(modVerIdLookup); @@ -1263,12 +1243,20 @@ public class ToscaResourceInstaller { // Set all Child Templates related to HEAT_VOLUME if(!volumeHeatChildTemplates.isEmpty()){ - vfModule.getVolumeHeatTemplate().setChildTemplates(volumeHeatChildTemplates); + if(vfModule.getVolumeHeatTemplate() != null){ + vfModule.getVolumeHeatTemplate().setChildTemplates(volumeHeatChildTemplates); + }else{ + logger.debug("VolumeHeatTemplate not set in setHeatInformationForVfModule()"); + } } // Set all Child Templates related to HEAT if(!heatChildTemplates.isEmpty()){ - vfModule.getVolumeHeatTemplate().setChildTemplates(heatChildTemplates); + if(vfModule.getModuleHeatTemplate() != null){ + vfModule.getModuleHeatTemplate().setChildTemplates(heatChildTemplates); + }else{ + logger.debug("ModuleHeatTemplate not set in setHeatInformationForVfModule()"); + } } } } diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/util/ASDCNotificationLogging.java b/asdc-controller/src/main/java/org/onap/so/asdc/util/ASDCNotificationLogging.java index ef5b889d09..13af95a8fc 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/util/ASDCNotificationLogging.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/util/ASDCNotificationLogging.java @@ -212,6 +212,9 @@ public class ASDCNotificationLogging { buffer.append("Model Name:"); buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME))); buffer.append(System.lineSeparator()); + buffer.append("Model UUID:"); + buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID))); + buffer.append(System.lineSeparator()); buffer.append("Description:"); buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION))); buffer.append(System.lineSeparator()); |