aboutsummaryrefslogtreecommitdiffstats
path: root/asdc-controller
diff options
context:
space:
mode:
Diffstat (limited to 'asdc-controller')
-rw-r--r--asdc-controller/pom.xml4
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java19
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/util/ASDCNotificationLogging.java31
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/util/YamlEditor.java4
4 files changed, 37 insertions, 21 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/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) {