diff options
Diffstat (limited to 'asdc-controller')
5 files changed, 42 insertions, 26 deletions
diff --git a/asdc-controller/pom.xml b/asdc-controller/pom.xml index b5cb596ea0..9ea397701c 100644 --- a/asdc-controller/pom.xml +++ b/asdc-controller/pom.xml @@ -196,12 +196,12 @@ <dependency> <groupId>org.onap.sdc.sdc-tosca</groupId> <artifactId>sdc-tosca</artifactId> - <version>1.4.1</version> + <version>1.4.4</version> </dependency> <dependency> <groupId>org.onap.sdc.jtosca</groupId> <artifactId>jtosca</artifactId> - <version>1.4.1</version> + <version>1.4.4</version> </dependency> <dependency> <groupId>org.onap.so</groupId> diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java index 7ead6cbb7f..91505918a8 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java @@ -26,7 +26,6 @@ import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.UnsupportedEncodingException; -import java.util.ArrayList; import java.util.List; import org.onap.sdc.api.IDistributionClient; @@ -46,7 +45,6 @@ import org.onap.so.asdc.client.exceptions.ASDCParametersException; import org.onap.so.asdc.client.exceptions.ArtifactInstallerException; import org.onap.so.asdc.installer.IVfResourceInstaller; import org.onap.so.asdc.installer.ToscaResourceStructure; -import org.onap.so.asdc.installer.VfModuleStructure; import org.onap.so.asdc.installer.VfResourceStructure; import org.onap.so.asdc.installer.bpmn.BpmnInstaller; import org.onap.so.asdc.installer.heat.ToscaResourceInstaller; @@ -596,7 +594,7 @@ public class ASDCController { distributionStatus = wd.getOverallDistributionStatus(iNotif.getDistributionID()); Thread.sleep(watchDogTimeout / 10); }catch(Exception e){ - LOGGER.debug ("Exception in Watchdog Loop " + e.getMessage()); + LOGGER.debug ("Exception in Watchdog Loop " + e); Thread.sleep(watchDogTimeout / 10); } @@ -628,7 +626,7 @@ public class ASDCController { LOGGER.debug ("A&AI Updated succefully with Distribution Status!"); } catch(Exception e) { - LOGGER.debug ("Exception in Watchdog executePatchAAI(): " + e.getMessage()); + LOGGER.debug ("Exception in Watchdog executePatchAAI(): " + e); watchdogError = "Error calling A&AI " + e.getMessage(); if(e.getCause() != null) { LOGGER.debug ("Exception caused by: " + e.getCause().getMessage()); @@ -660,7 +658,7 @@ public class ASDCController { LOGGER.debug ("A&AI Updated succefully with Distribution Status of " + DistributionStatusEnum.DISTRIBUTION_COMPLETE_ERROR.name()); } catch(Exception aaiException) { - LOGGER.debug ("Exception in executePatchAAI(): " + aaiException.getMessage()); + LOGGER.debug ("Exception in executePatchAAI(): " + aaiException); if(aaiException.getCause() != null) { LOGGER.debug ("Exception caused by: " + aaiException.getCause().getMessage()); } @@ -708,6 +706,7 @@ public class ASDCController { } catch(ArtifactInstallerException e){ deploySuccessful = false; errorMessage = e.getMessage(); + LOGGER.debug ("Exception in processResourceNotification(): " + e); } } else { // Services with resources @@ -744,6 +743,7 @@ public class ASDCController { } catch(ArtifactInstallerException e){ deploySuccessful = false; errorMessage = e.getMessage(); + LOGGER.debug ("Exception in processResourceNotification(): " + e); } } 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 970cb0bf50..f77a48a1f8 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 @@ -488,21 +488,24 @@ public class ToscaResourceInstaller { .getSdcCsarHelper().getVfModulesByVf(vfCustomizationUUID); IVfModuleData vfMetadata = vfModuleStructure.getVfModuleMetadata(); - logger.debug("Comparing VFModuleMetadata CustomizationUUID : " + vfMetadata.getVfModuleModelCustomizationUUID()); + logger.debug("Comparing Vf_Modules_Metadata CustomizationUUID : " + vfMetadata.getVfModuleModelCustomizationUUID()); Optional<org.onap.sdc.toscaparser.api.Group> matchingObject = vfGroups.stream() .peek(group -> logger.debug("To Csar Group VFModuleModelCustomizationUUID " + group.getMetadata().getValue("vfModuleModelCustomizationUUID"))) - .filter(group -> group.getMetadata().getValue("vfModuleModelCustomizationUUID").equals(vfMetadata.getVfModuleModelCustomizationUUID())). - findFirst(); + .filter(group -> group.getMetadata().getValue("vfModuleModelCustomizationUUID").equals(vfMetadata.getVfModuleModelCustomizationUUID())) + .findFirst(); if(matchingObject.isPresent()){ VfModuleCustomization vfModuleCustomization = createVFModuleResource(matchingObject.get(), nodeTemplate, toscaResourceStruct, vfResourceStructure,vfMetadata, vnfResource, service, existingCvnfcSet, existingVnfcSet); vfModuleCustomization.getVfModule().setVnfResources(vnfResource.getVnfResources()); }else - throw new Exception("Cannot find matching VFModule Customization for VF Module Metadata: " + vfMetadata.getVfModuleModelCustomizationUUID()); + throw new Exception("Cannot find matching VFModule Customization in Csar for Vf_Modules_Metadata: " + vfMetadata.getVfModuleModelCustomizationUUID()); } service.getVnfCustomizations().add(vnfResource); + } else{ + logger.debug("Notification VF ResourceCustomizationUUID: " + vfNotificationResource.getResourceCustomizationUUID() + " doesn't match " + + "Tosca VF Customization UUID: " + vfCustomizationUUID); } } } @@ -1150,7 +1153,7 @@ public class ToscaResourceInstaller { vfcInstanceGroup.setModelInvariantUUID(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)); vfcInstanceGroup.setModelUUID(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_UUID)); vfcInstanceGroup.setModelVersion(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)); - vfcInstanceGroup.setToscaNodeType(group.getType()); + vfcInstanceGroup.setToscaNodeType(group.getType()); vfcInstanceGroup.setRole("SUB-INTERFACE"); // Set Role vfcInstanceGroup.setType(InstanceGroupType.VNFC); // Set type @@ -1201,7 +1204,7 @@ public class ToscaResourceInstaller { if(vfModule==null) vfModule=createVfModule(group, toscaResourceStructure, vfModuleData, vfMetadata); - vfModuleCustomization = createVfModuleCustomzation(group, toscaResourceStructure, vfModule, vfModuleData); + vfModuleCustomization = createVfModuleCustomization(group, toscaResourceStructure, vfModule, vfModuleData); setHeatInformationForVfModule(toscaResourceStructure, vfResourceStructure, vfModule, vfModuleCustomization, vfMetadata); vfModuleCustomization.setVfModule(vfModule); @@ -1416,7 +1419,7 @@ public class ToscaResourceInstaller { return vfModule; } - protected VfModuleCustomization createVfModuleCustomzation(Group group, + protected VfModuleCustomization createVfModuleCustomization(Group group, ToscaResourceStructure toscaResourceStructure, VfModule vfModule, IVfModuleData vfModuleData) { VfModuleCustomization vfModuleCustomization = new VfModuleCustomization(); @@ -1691,6 +1694,8 @@ public class ToscaResourceInstaller { testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES))); vnfResource.setAicVersionMin( testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_MININSTANCES))); + vnfResource.setCategory(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY)); + vnfResource.setSubCategory(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_SUBCATEGORY)); return vnfResource; } 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 ab9c359b7f..9df9ffc7af 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 @@ -203,11 +203,11 @@ public class ASDCNotificationLogging { List<NodeTemplate> vfNodeTemplatesList = toscaResourceStructure.getSdcCsarHelper().getServiceVfList(); for (NodeTemplate vfNodeTemplate : vfNodeTemplatesList) { - + + buffer.append(System.lineSeparator()); buffer.append(System.lineSeparator()); buffer.append("VNF Properties:"); - buffer.append(System.lineSeparator()); - + buffer.append(System.lineSeparator()); buffer.append("Model Name:"); buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME))); buffer.append(System.lineSeparator()); @@ -262,6 +262,7 @@ public class ASDCNotificationLogging { for (Group group : groupList) { Metadata instanceMetadata = group.getMetadata(); + buffer.append(System.lineSeparator()); buffer.append(System.lineSeparator()); buffer.append("VNFC Instance Group Properties:"); buffer.append(System.lineSeparator()); @@ -277,18 +278,19 @@ public class ASDCNotificationLogging { buffer.append(System.lineSeparator()); buffer.append("InvariantUuid:"); buffer.append(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)); - buffer.append(System.lineSeparator()); + buffer.append(System.lineSeparator()); } } - + List<Group> vfGroups = toscaResourceStructure.getSdcCsarHelper().getVfModulesByVf(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID))); for(Group group : vfGroups){ Metadata vfMetadata = group.getMetadata(); + buffer.append(System.lineSeparator()); buffer.append(System.lineSeparator()); buffer.append("VF Module Properties:"); buffer.append(System.lineSeparator()); @@ -306,13 +308,14 @@ public class ASDCNotificationLogging { buffer.append(System.lineSeparator()); buffer.append("Description:"); buffer.append(testNull(toscaResourceStructure.getSdcCsarHelper().getMetadataPropertyValue(vfMetadata, SdcPropertyNames.PROPERTY_NAME_DESCRIPTION))); - buffer.append(System.lineSeparator()); + buffer.append(System.lineSeparator()); } List<NodeTemplate> cvfcList = toscaResourceStructure.getSdcCsarHelper().getNodeTemplateBySdcType(vfNodeTemplate, SdcTypes.CVFC); for(NodeTemplate cvfcTemplate : cvfcList) { + buffer.append(System.lineSeparator()); buffer.append(System.lineSeparator()); buffer.append("CVNFC Properties:"); buffer.append(System.lineSeparator()); @@ -339,6 +342,7 @@ public class ASDCNotificationLogging { List<NodeTemplate> vfcList = toscaResourceStructure.getSdcCsarHelper().getNodeTemplateBySdcType(cvfcTemplate, SdcTypes.VFC); for(NodeTemplate vfcTemplate : vfcList) { + buffer.append(System.lineSeparator()); buffer.append(System.lineSeparator()); buffer.append("VNFC Properties:"); buffer.append(System.lineSeparator()); @@ -370,13 +374,13 @@ public class ASDCNotificationLogging { List<NodeTemplate> nodeTemplatesVLList = toscaResourceStructure.getSdcCsarHelper().getServiceVlList(); if(nodeTemplatesVLList != null){ - - buffer.append(System.lineSeparator()); - buffer.append("NETWORK Level Properties:"); - buffer.append(System.lineSeparator()); - + for(NodeTemplate vlNode : nodeTemplatesVLList){ + buffer.append(System.lineSeparator()); + buffer.append(System.lineSeparator()); + buffer.append("NETWORK Level Properties:"); + buffer.append(System.lineSeparator()); buffer.append("Model Name:"); buffer.append(testNull(vlNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME))); buffer.append(System.lineSeparator()); @@ -414,6 +418,7 @@ public class ASDCNotificationLogging { if (networkCollectionList != null) { for (NodeTemplate crNode : networkCollectionList) { + buffer.append(System.lineSeparator()); buffer.append("Model Name:"); buffer.append(crNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)); buffer.append(System.lineSeparator()); @@ -448,6 +453,7 @@ public class ASDCNotificationLogging { Metadata vlMetadata = vlNodeTemplate.getMetaData(); + buffer.append(System.lineSeparator()); buffer.append(System.lineSeparator()); buffer.append("Network CR VL Properties:"); buffer.append(System.lineSeparator()); @@ -481,7 +487,8 @@ public class ASDCNotificationLogging { if(groupList != null){ for (Group group : groupList) { Metadata instanceMetadata = group.getMetadata(); - buffer.append(System.lineSeparator()); + buffer.append(System.lineSeparator()); + buffer.append(System.lineSeparator()); buffer.append("Network Instance Group Properties:"); buffer.append(System.lineSeparator()); diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/util/YamlEditor.java b/asdc-controller/src/main/java/org/onap/so/asdc/util/YamlEditor.java index 32f512b0f0..3418ee3295 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/util/YamlEditor.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/util/YamlEditor.java @@ -50,6 +50,10 @@ public class YamlEditor { public YamlEditor (byte[] body) { init (body); } + + public YamlEditor (Yaml yaml) { + this.yaml = yaml; + } @SuppressWarnings("unchecked") protected synchronized void init (byte[] body) { |