aboutsummaryrefslogtreecommitdiffstats
path: root/asdc-controller
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2019-04-03 12:42:24 +0000
committerGerrit Code Review <gerrit@onap.org>2019-04-03 12:42:24 +0000
commitd83dc6b52eb6379970e1fd75ab985c067ab60dc4 (patch)
tree18135b19cc53e60583e02b1af21bcc2814a8dfb4 /asdc-controller
parent3312a682e0aabe2d81fcd4c5ea6090ec255f8ccf (diff)
parentfccb6eccf467f254a7b3df8a0c96ed7f6d38779e (diff)
Merge "skip post instantiation configuration"
Diffstat (limited to 'asdc-controller')
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java19
-rw-r--r--asdc-controller/src/test/resources/schema.sql2
2 files changed, 20 insertions, 1 deletions
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 9f914c586e..04e3782bbe 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
@@ -174,6 +174,7 @@ public class ToscaResourceInstaller {
private static String CUSTOMIZATION_UUID = "customizationUUID";
+ protected static final String SKIP_POST_INST_CONF = "skip_post_instantiation_configuration";
@Autowired
protected ServiceRepository serviceRepo;
@@ -887,13 +888,24 @@ public class ToscaResourceInstaller {
pnfResourceCustomization.setMultiStageDesign(getStringValue(properties.get(MULTI_STAGE_DESIGN)));
pnfResourceCustomization.setBlueprintName(getStringValue(properties.get(SDNC_MODEL_NAME)));
pnfResourceCustomization.setBlueprintVersion(getStringValue(properties.get(SDNC_MODEL_VERSION)));
-
+ pnfResourceCustomization.setSkipPostInstConf(getBooleanValue(properties.get(SKIP_POST_INST_CONF)));
pnfResourceCustomization.setPnfResources(pnfResource);
return pnfResourceCustomization;
}
/**
+ * Get value from {@link Property} and cast to boolean value. Return true if property is null.
+ */
+ private boolean getBooleanValue(Property property) {
+ if (null == property) {
+ return true;
+ }
+ Object value = property.getValue();
+ return new Boolean(String.valueOf(value));
+ }
+
+ /**
* Get value from {@link Property} and cast to String value. Return empty String if property is null value.
*/
private String getStringValue(Property property) {
@@ -2151,6 +2163,11 @@ public class ToscaResourceInstaller {
vnfResourceCustomization.setBlueprintVersion(testNull(toscaResourceStructure.getSdcCsarHelper()
.getNodeTemplatePropertyLeafValue(vfNodeTemplate, SDNC_MODEL_VERSION)));
+ String skipPostInstConfText = toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(vfNodeTemplate, SKIP_POST_INST_CONF);
+ if (skipPostInstConfText != null){
+ vnfResourceCustomization.setSkipPostInstConf(Boolean.parseBoolean(skipPostInstConfText));
+ }
+
vnfResourceCustomization.setVnfResources(vnfResource);
vnfResourceCustomization.setAvailabilityZoneMaxCount(Integer.getInteger(
vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_AVAILABILITYZONECOUNT)));
diff --git a/asdc-controller/src/test/resources/schema.sql b/asdc-controller/src/test/resources/schema.sql
index ec8e25dd13..2db2dfb5bf 100644
--- a/asdc-controller/src/test/resources/schema.sql
+++ b/asdc-controller/src/test/resources/schema.sql
@@ -1114,6 +1114,7 @@ CREATE TABLE `vnf_resource_customization` (
`RESOURCE_INPUT` varchar(20000) DEFAULT NULL,
`CDS_BLUEPRINT_NAME` varchar(200) default null,
`CDS_BLUEPRINT_VERSION` varchar(20) default null,
+ `SKIP_POST_INSTANTIATION_CONFIGURATION` boolean default true,
`CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`VNF_RESOURCE_MODEL_UUID` varchar(200) NOT NULL,
`SERVICE_MODEL_UUID` varchar(200) NOT NULL,
@@ -1195,6 +1196,7 @@ CREATE TABLE IF NOT EXISTS `pnf_resource_customization` (
`RESOURCE_INPUT` varchar(2000) DEFAULT NULL,
`CDS_BLUEPRINT_NAME` varchar(200) DEFAULT NULL,
`CDS_BLUEPRINT_VERSION` varchar(20) DEFAULT NULL,
+ `SKIP_POST_INSTANTIATION_CONFIGURATION` boolean default true,
PRIMARY KEY (`MODEL_CUSTOMIZATION_UUID`),
KEY `fk_pnf_resource_customization__pnf_resource1_idx` (`PNF_RESOURCE_MODEL_UUID`),
CONSTRAINT `fk_pnf_resource_customization__pnf_resource1` FOREIGN KEY (`PNF_RESOURCE_MODEL_UUID`) REFERENCES `pnf_resource` (`MODEL_UUID`) ON DELETE CASCADE ON UPDATE CASCADE