Fix for scalar-unit type value. 16/96716/5
authoraribeiro <anderson.ribeiro@est.tech>
Tue, 1 Oct 2019 15:47:26 +0000 (16:47 +0100)
committerOfir Sonsino <ofir.sonsino@intl.att.com>
Tue, 19 Nov 2019 07:48:02 +0000 (07:48 +0000)
Issue-ID: SDC-323
Change-Id: I7f19a7356e1cd34deca0a168b3cb707ef657b9cb
Signed-off-by: aribeiro <anderson.ribeiro@est.tech>
85 files changed:
catalog-model/src/main/java/org/openecomp/sdc/be/model/heat/HeatParameterType.java
catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/converters/HeatNumberConverter.java
catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/validators/HeatNumberValidator.java
common/onap-tosca-datatype/pom.xml
common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/PropertyType.java
common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/ScalarUnitValidator.java [new file with mode: 0644]
openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/DefinedHeatParameterTypes.java
openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/ToscaScalarUnitFrequency.java [new file with mode: 0644]
openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/ToscaScalarUnitSize.java [new file with mode: 0644]
openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/ToscaScalarUnitTime.java [new file with mode: 0644]
openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/ToscaScalarUnitTypes.java [new file with mode: 0644]
openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/ToscaScalarUnitTypesTest.java [new file with mode: 0644]
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/TranslationService.java
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationCinderVolumeImpl.java
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaParameterConverter.java
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/multiple_resource_groups/expectedoutputfiles/mvs.nested.heatServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedundervolume/expectedoutputfiles/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedundervolume/expectedoutputfiles/ocgmgr_nested_volumeServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedundervolume/inputs/ocgapp_01_volume.env
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedundervolume/inputs/ocgapp_02_volume.env
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedundervolume/inputs/ocgapp_03_volume.env
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedundervolume/inputs/ocgapp_04_volume.env
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/resource_group_with_dynamic_count/expectedoutputfiles/mvs.nested.heatServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/parameters/nestedWithAssociatedHeat/expectedoutputfiles/nestedServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/parameters/single/expectedoutputfiles/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/expectedoutputfiles/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Contrail_VirtualNetwork/inputs/vmme_small.yml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/resources/OS_Nova_Server/expectedoutputfiles/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/allHeatsAreBase/expectedOutput/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/expectedOutput/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/multiHeat/referencedHeatResources/expectedOutput/eca_oamServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/baseResourceTranslation/expectedoutputfiles/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/cinder_volume_translation/expectedoutputfiles/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/fulltest/catalogInstances/computewithtwosameporttypes/out/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/fulltest/nestedSingleCompute/duplicateReqs/out/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/fulltest/nestedSingleCompute/multipleReferencesToSameNestedFilesWithSameComputeType/out/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/fulltest/nestedSingleCompute/myTest/out/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/fulltest/scalingInstances/oneComputeTypeOnePortNodeConnectedOut/out/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/fulltest/singleSubstitution/computeWithDiffPortTypeNodeConnectedOut/out/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/fulltest/singleSubstitution/computeWithSamePortTypeNodeConnectedOut/out/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/fulltest/singleSubstitution/generalVf/out/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/fulltest/singleSubstitution/inputOutputParamType/out/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/getAttr/getAttrUnsupportedAttr/expectedoutputfiles/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/inputfiles/hot-nimbus-oam-volumes_v1.0.env
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/hot-nimbus-oam-volumes_v1.0/out/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innerHeatVolNestedMultiLevel/expectedoutputfiles/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/innernestedconnection/expectedoutputfiles/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/multinotconnected/expectedoutputfiles/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedMultiLevels/expectedoutputfiles/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestedconnection/expectedoutputfiles/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/nestednotconnected/expectedoutputfiles/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharedAddOn/expectedoutputfiles/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharedNestedMultiLevels/expectedoutputfiles/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestedconnection/expectedoutputfiles/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumeconnection/sharednestednotconnected/expectedoutputfiles/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumemulticonnection/expectedoutputfiles/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/novatovolumesharednestedconnection/expectedoutputfiles/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityRulesToPortGetResource/out/FEAdd_On_Module_QRouterTemplateServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityRulesToPortGetResource/out/FEAdd_On_Module_vLBAgentTemplateServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityRulesToPortGetResource/out/FEAdd_On_Module_vLBTemplateServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/securityrulestoportconnection/securityRulesToPortGetResource/out/FEAdd_On_Module_vProbeTemplateServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/unifiedComposition/cleanMainSt/consolidation/in/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/unifiedComposition/cleanMainSt/consolidation/out/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/unifiedComposition/creSubstitutionServiceTemplate/NoOutParamDuplicatePortType/in/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/unifiedComposition/creSubstitutionServiceTemplate/WithIndex/in/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/unifiedComposition/createAbstractSubstitute/oneComputeMultiplePortsDiffType/in/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/unifiedComposition/createAbstractSubstitute/oneComputeMultiplePortsDiffType/out/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/unifiedComposition/createAbstractSubstitute/oneComputeMultiplePortsSameType/in/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/unifiedComposition/createAbstractSubstitute/oneComputeMultiplePortsSameType/out/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/unifiedComposition/createAbstractSubstitute/twoComputesMultiplePorts/in/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/unifiedComposition/createAbstractSubstitute/twoComputesMultiplePorts/out/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/unifiedComposition/updOutputGetAttrIn/consolidation/in/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/unifiedComposition/updOutputGetAttrIn/consolidation/out/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/unifiedComposition/updOutputGetAttrIn/noConsolidation/in/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/unifiedComposition/updOutputGetAttrIn/noConsolidation/out/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/unifiedComposition/updVolumes/consolidation/in/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/unifiedComposition/updVolumes/consolidation/out/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/unifiedComposition/updVolumes/noConsolidation/in/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/unifiedComposition/updVolumes/noConsolidation/out/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vmme_small/expectedoutputfiles/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_attach/nested_with_inner_vol/out/nestedServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_attach/volume_and_attach_one_file/expectedoutputfiles/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_attach/volume_file_nested_in_main_file_in_manifest/expectedoutputfiles/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/vol_attach/volume_file_parallel_to_main_file/expectedoutputfiles/MainServiceTemplate.yaml
openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/PropertyTypeTest.java

index f5f4d9f..503cf61 100644 (file)
 
 package org.openecomp.sdc.be.model.heat;
 
-import org.openecomp.sdc.be.model.tosca.converters.*;
-import org.openecomp.sdc.be.model.tosca.validators.*;
-
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import org.openecomp.sdc.be.model.tosca.converters.HeatBooleanConverter;
+import org.openecomp.sdc.be.model.tosca.converters.HeatCommaDelimitedListConverter;
+import org.openecomp.sdc.be.model.tosca.converters.HeatJsonConverter;
+import org.openecomp.sdc.be.model.tosca.converters.HeatNumberConverter;
+import org.openecomp.sdc.be.model.tosca.converters.HeatStringConverter;
+import org.openecomp.sdc.be.model.tosca.converters.PropertyValueConverter;
+import org.openecomp.sdc.be.model.tosca.validators.HeatBooleanValidator;
+import org.openecomp.sdc.be.model.tosca.validators.HeatCommaDelimitedListValidator;
+import org.openecomp.sdc.be.model.tosca.validators.HeatNumberValidator;
+import org.openecomp.sdc.be.model.tosca.validators.HeatStringValidator;
+import org.openecomp.sdc.be.model.tosca.validators.PropertyTypeValidator;
+
+
+@AllArgsConstructor
+@Getter
 public enum HeatParameterType {
 
     STRING("string", HeatStringValidator.getInstance(), HeatStringConverter.getInstance()),
@@ -40,42 +54,12 @@ public enum HeatParameterType {
     private PropertyTypeValidator validator;
     private PropertyValueConverter converter;
 
-    HeatParameterType(String type, PropertyTypeValidator validator, PropertyValueConverter converter) {
-        this.type = type;
-        this.validator = validator;
-        this.converter = converter;
-    }
-
-    public String getType() {
-        return type;
-    }
-
-    public void setType(String type) {
-        this.type = type;
-    }
-
-    public PropertyTypeValidator getValidator() {
-        return validator;
-    }
-
-    public void setValidator(PropertyTypeValidator validator) {
-        this.validator = validator;
-    }
-
-    public PropertyValueConverter getConverter() {
-        return converter;
-    }
-
-    public void setConverter(PropertyValueConverter converter) {
-        this.converter = converter;
-    }
-
-    public static HeatParameterType isValidType(String typeName) {
+    public static HeatParameterType isValidType(final String typeName) {
         if (typeName == null) {
             return null;
         }
 
-        for (HeatParameterType type : HeatParameterType.values()) {
+        for (final HeatParameterType type : HeatParameterType.values()) {
             if (type.getType().equals(typeName)) {
                 return type;
             }
index 187793e..b2237d0 100644 (file)
@@ -20,6 +20,7 @@
 
 package org.openecomp.sdc.be.model.tosca.converters;
 
+import org.onap.sdc.tosca.datatypes.model.ScalarUnitValidator;
 import org.openecomp.sdc.be.model.DataTypeDefinition;
 
 import java.math.BigDecimal;
@@ -33,17 +34,23 @@ public class HeatNumberConverter implements PropertyValueConverter {
         return numberConverter;
     }
 
+    private final ScalarUnitValidator scalarUnitValidator = ScalarUnitValidator.getInstance();
+
+
     private HeatNumberConverter() {
 
     }
 
     @Override
     public String convert(String original, String innerType, Map<String, DataTypeDefinition> dataTypes) {
-
         if (original == null || original.isEmpty()) {
             return null;
         }
 
+        if (scalarUnitValidator.isScalarUnit(original)) {
+            return original;
+        }
+
         return new BigDecimal(original).toPlainString();
     }
 
index 0ae3f74..ec281c0 100644 (file)
 
 package org.openecomp.sdc.be.model.tosca.validators;
 
-import org.openecomp.sdc.be.model.DataTypeDefinition;
-
 import java.util.Map;
+import org.onap.sdc.tosca.datatypes.model.ScalarUnitValidator;
+import org.openecomp.sdc.be.model.DataTypeDefinition;
 
 public class HeatNumberValidator implements PropertyTypeValidator {
 
     private static HeatNumberValidator numberValidator = new HeatNumberValidator();
 
-    private static FloatValidator floatValidator = FloatValidator.getInstance();
-    private static IntegerValidator integerValidator = IntegerValidator.getInstance();
+    private final FloatValidator floatValidator = FloatValidator.getInstance();
+    private final IntegerValidator integerValidator = IntegerValidator.getInstance();
+    private final ScalarUnitValidator scalarUnitValidator = ScalarUnitValidator.getInstance();
 
     public static HeatNumberValidator getInstance() {
         return numberValidator;
     }
 
     private HeatNumberValidator() {
-
     }
 
     @Override
-    public boolean isValid(String value, String innerType, Map<String, DataTypeDefinition> allDataTypes) {
+    public boolean isValid(final String value,
+                           final String innerType,
+                           final Map<String, DataTypeDefinition> allDataTypes) {
 
         if (value == null || value.isEmpty()) {
             return true;
@@ -51,11 +53,15 @@ public class HeatNumberValidator implements PropertyTypeValidator {
             valid = floatValidator.isValid(value, null, allDataTypes);
         }
 
+        if(!valid) {
+            valid = scalarUnitValidator.isScalarUnit(value);
+        }
+
         return valid;
     }
 
     @Override
-    public boolean isValid(String value, String innerType) {
+    public boolean isValid(final String value, final String innerType) {
         return isValid(value, innerType, null);
     }
 }
index bd46d62..c99be32 100644 (file)
                        <artifactId>slf4j-api</artifactId>
                        <version>${slf4j.version}</version>
                </dependency>
+               <dependency>
+                       <groupId>org.apache.commons</groupId>
+                       <artifactId>commons-lang3</artifactId>
+                       <version>${lang3.version}</version>
+                       <scope>provided</scope>
+               </dependency>
                <dependency>
                        <groupId>com.google.code.bean-matchers</groupId>
                        <artifactId>bean-matchers</artifactId>
index facdb2a..1b91ca9 100644 (file)
  */
 
 package org.onap.sdc.tosca.datatypes.model;
-import java.util.*;
 
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@AllArgsConstructor
+@Getter
 public enum PropertyType {
 
   STRING("string"),
@@ -28,27 +37,21 @@ public enum PropertyType {
   MAP("map"),
   LIST("list"),
   SCALAR_UNIT_SIZE("scalar-unit.size"),
+  SCALAR_UNIT_TIME("scalar-unit.time"),
   SCALAR_UNIT_FREQUENCY("scalar-unit.frequency");
 
-  private static final Map<String, PropertyType> M_MAP =
-      Collections.unmodifiableMap(initializeMapping());
-  private static final Set<String> SIMPLE_PROPERTY_TYPES =
-      Collections.unmodifiableSet(initializeSimplePropertyTypes());
+  private static final Map<String, PropertyType> M_MAP = Collections.unmodifiableMap(initializeMapping());
+  private static final Set<String> SIMPLE_PROPERTY_TYPES = Collections.unmodifiableSet(initializeSimplePropertyTypes());
   private String displayName;
 
-  PropertyType(String displayName) {
-
-    this.displayName = displayName;
-  }
-
   /**
    * Initilize property type display name mapping.
    * @return Map
    */
   public static Map<String, PropertyType> initializeMapping() {
-    Map<String, PropertyType> typeMap = new HashMap<>();
-    for (PropertyType v : PropertyType.values()) {
-      typeMap.put(v.displayName, v);
+    final Map<String, PropertyType> typeMap = new HashMap<>();
+    for (final PropertyType propertyType : PropertyType.values()) {
+      typeMap.put(propertyType.displayName, propertyType);
     }
     return typeMap;
   }
@@ -58,7 +61,7 @@ public enum PropertyType {
    * @param displayName
    * @return PropertyType
    */
-  public static PropertyType getPropertyTypeByDisplayName(String displayName) {
+  public static PropertyType getPropertyTypeByDisplayName(final String displayName) {
     if (M_MAP.containsKey(displayName)) {
       return M_MAP.get(displayName);
     }
@@ -66,12 +69,14 @@ public enum PropertyType {
   }
 
   private static Set<String> initializeSimplePropertyTypes() {
-    final int setSize = 4;
-    Set<String> simplePropertyTypes = new HashSet<>(setSize);
+    final Set<String> simplePropertyTypes = new HashSet<>();
     simplePropertyTypes.add(STRING.getDisplayName().toLowerCase());
     simplePropertyTypes.add(INTEGER.getDisplayName().toLowerCase());
     simplePropertyTypes.add(FLOAT.getDisplayName().toLowerCase());
     simplePropertyTypes.add(BOOLEAN.getDisplayName().toLowerCase());
+    simplePropertyTypes.add(SCALAR_UNIT_SIZE.getDisplayName().toLowerCase());
+    simplePropertyTypes.add(SCALAR_UNIT_TIME.getDisplayName().toLowerCase());
+    simplePropertyTypes.add(SCALAR_UNIT_FREQUENCY.getDisplayName().toLowerCase());
     return simplePropertyTypes;
   }
 
@@ -79,8 +84,4 @@ public enum PropertyType {
     return SIMPLE_PROPERTY_TYPES;
   }
 
-  public String getDisplayName() {
-    return displayName;
-  }
-
 }
diff --git a/common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/ScalarUnitValidator.java b/common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/ScalarUnitValidator.java
new file mode 100644 (file)
index 0000000..d7e538e
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation
+ *  ================================================================================
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.onap.sdc.tosca.datatypes.model;
+
+import java.util.Arrays;
+import java.util.regex.Pattern;
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * This Class is responsible for validating if a given value is a valid Tosca Scalar Unit Type.
+ */
+public class ScalarUnitValidator {
+
+    private static ScalarUnitValidator scalarUnitValidator = new ScalarUnitValidator();
+
+    /**
+     *  Tosca Scalar Unit Types structure.
+     */
+    private final Pattern pattern = Pattern.compile("\\d+\\s*[a-zA-Z]{1,3}");
+
+    private ScalarUnitValidator() {
+    }
+
+    public static ScalarUnitValidator getInstance() {
+        return scalarUnitValidator;
+    }
+
+    /**
+     * Validates if the given String matches with the Tosca Scalar Unit Types structure.
+     *
+     * @param value String to be validated.
+     * @return an {@Boolean}
+     */
+    public boolean isScalarUnit(final String value) {
+        if (value == null || value.isEmpty()) {
+            return true;
+        }
+
+        return pattern.matcher(value).matches();
+    }
+
+    /**
+     * Validates if the given String has a Recognized Tosca unit.
+     *
+     * @param value String to be validated
+     * @param enumClass Enum that represents a Tosca Scalar Unit Type.
+     * @param <E>
+     * @return an Enum that represents the Tosca Scalar Unit Type.
+     */
+    public <E extends Enum<E>> boolean isValueScalarUnit(final Object value, final Class<E> enumClass) {
+        final String stringToValidate = String.valueOf(value);
+        return isScalarUnit(stringToValidate) && Arrays.stream(StringUtils.split(stringToValidate))
+            .anyMatch(strValue -> Arrays.stream(enumClass.getEnumConstants())
+                .anyMatch(scalarUnit ->
+                    scalarUnit.name().equalsIgnoreCase(strValue) || strValue.endsWith(scalarUnit.name())));
+    }
+}
index 6009172..4205f0b 100644 (file)
@@ -24,10 +24,14 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-
+import lombok.AllArgsConstructor;
+import lombok.Getter;
 import org.apache.commons.lang.math.NumberUtils;
 import org.apache.commons.lang3.ClassUtils;
+import org.onap.sdc.tosca.datatypes.model.ScalarUnitValidator;
 
+@AllArgsConstructor
+@Getter
 public enum DefinedHeatParameterTypes {
     NUMBER("number"),
     STRING("string"),
@@ -35,22 +39,19 @@ public enum DefinedHeatParameterTypes {
     JSON("json"),
     BOOLEAN("boolean");
 
+    private static ScalarUnitValidator scalarUnitValidator = ScalarUnitValidator.getInstance();
     private static Map<String, DefinedHeatParameterTypes> stringToDefinedType;
 
     static {
         stringToDefinedType = new HashMap<>();
-        for (DefinedHeatParameterTypes definedHeatParameterType : DefinedHeatParameterTypes.values()) {
+        for (final DefinedHeatParameterTypes definedHeatParameterType : DefinedHeatParameterTypes.values()) {
             stringToDefinedType.put(definedHeatParameterType.type, definedHeatParameterType);
         }
     }
 
     private String type;
 
-    DefinedHeatParameterTypes(String type) {
-        this.type = type;
-    }
-
-    public static DefinedHeatParameterTypes findByHeatResource(String type) {
+    public static DefinedHeatParameterTypes findByHeatResource(final String type) {
         return stringToDefinedType.get(type);
     }
 
@@ -61,12 +62,17 @@ public enum DefinedHeatParameterTypes {
      * @param parameterType the parameter type
      * @return the boolean
      */
-    public static boolean isValueIsFromGivenType(Object value, String parameterType) {
-        DefinedHeatParameterTypes definedType = findByHeatResource(parameterType);
+    public static boolean isValueIsFromGivenType(final Object value, final String parameterType) {
+        final DefinedHeatParameterTypes definedType = findByHeatResource(parameterType);
 
         if (Objects.nonNull(definedType)) {
             switch (definedType) {
                 case NUMBER:
+                    if (scalarUnitValidator.isValueScalarUnit(value, ToscaScalarUnitSize.class) ||
+                        scalarUnitValidator.isValueScalarUnit(value, ToscaScalarUnitTime.class) ||
+                        scalarUnitValidator.isValueScalarUnit(value, ToscaScalarUnitFrequency.class)) {
+                        return isValueString(value);
+                    }
                     return NumberUtils.isNumber(String.valueOf(value));
 
                 case BOOLEAN:
@@ -87,35 +93,28 @@ public enum DefinedHeatParameterTypes {
         return false;
     }
 
-    public static boolean isNovaServerEnvValueIsFromRightType(Object value) {
+    public static boolean isNovaServerEnvValueIsFromRightType(final Object value) {
         return isValueIsFromGivenType(value, COMMA_DELIMITED_LIST.getType())
                 || isValueIsFromGivenType(value, STRING.getType());
     }
 
-    private static boolean isValueCommaDelimitedList(Object value) {
+    private static boolean isValueCommaDelimitedList(final Object value) {
         return value instanceof List
                 || String.valueOf(value).contains(",")
                 || isValueIsFromGivenType(value, DefinedHeatParameterTypes.STRING.type);
     }
 
-    private static boolean isValueString(Object value) {
+    private static boolean isValueString(final Object value) {
         return value instanceof String
                 || ClassUtils.isPrimitiveOrWrapper(value.getClass());
     }
 
-    private static boolean isValueJson(Object value) {
+    private static boolean isValueJson(final Object value) {
         return (value instanceof Map) || (value instanceof List);
     }
 
-    public static boolean isEmptyValueInEnv(Object value) {
+    public static boolean isEmptyValueInEnv(final Object value) {
         return Objects.isNull(value);
     }
 
-    public String getType() {
-        return type;
-    }
-
-    public void setType(String type) {
-        this.type = type;
-    }
 }
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/ToscaScalarUnitFrequency.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/ToscaScalarUnitFrequency.java
new file mode 100644 (file)
index 0000000..8ec2465
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation
+ *  ================================================================================
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.datatypes;
+
+/**
+ * This enum is responsible for defining properties that have scalar values measured in units per second.
+ */
+public enum ToscaScalarUnitFrequency {
+
+    HZ, KHZ, MHZ, GHZ
+
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/ToscaScalarUnitSize.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/ToscaScalarUnitSize.java
new file mode 100644 (file)
index 0000000..12f6a17
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation
+ *  ================================================================================
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.datatypes;
+
+/**
+ * This enum is responsible for defining properties that have scalar values measured in size units.
+ */
+public enum ToscaScalarUnitSize {
+
+    B, KB, KIB, MB, MIB, GB, GIB, TB, TIB
+
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/ToscaScalarUnitTime.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/ToscaScalarUnitTime.java
new file mode 100644 (file)
index 0000000..0a41a63
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation
+ *  ================================================================================
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.datatypes;
+
+
+/**
+ * This enum is responsible for defining properties that have scalar values measured in size units.
+ */
+public enum ToscaScalarUnitTime {
+
+    D, H, M, S, MS, US, NS
+
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/ToscaScalarUnitTypes.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/ToscaScalarUnitTypes.java
new file mode 100644 (file)
index 0000000..05cc97c
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation
+ *  ================================================================================
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.datatypes;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * This enum is responsible for defining all Tosca Scalar Unit types Supported.
+ */
+@Getter
+@AllArgsConstructor
+public enum ToscaScalarUnitTypes {
+
+    SCALAR_UNIT_SIZE("scalar-unit.size"),
+    SCALAR_UNIT_TIME("scalar-unit.time"),
+    SCALAR_UNIT_FREQUENCY("scalar-unit.frequency");
+
+    private String type;
+}
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/ToscaScalarUnitTypesTest.java b/openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/ToscaScalarUnitTypesTest.java
new file mode 100644 (file)
index 0000000..0b83e9b
--- /dev/null
@@ -0,0 +1,98 @@
+/*
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation
+ *  ================================================================================
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.datatypes.model;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.onap.sdc.tosca.datatypes.model.ScalarUnitValidator;
+import org.openecomp.sdc.heat.datatypes.DefinedHeatParameterTypes;
+import org.openecomp.sdc.heat.datatypes.ToscaScalarUnitFrequency;
+import org.openecomp.sdc.heat.datatypes.ToscaScalarUnitSize;
+import org.openecomp.sdc.heat.datatypes.ToscaScalarUnitTime;
+
+public class ToscaScalarUnitTypesTest {
+
+    private String inputValue;
+    private static ScalarUnitValidator scalarUnitValidator = ScalarUnitValidator.getInstance();
+
+    @Test
+    public void shouldReturnTrueForScalarUnitSize() {
+        inputValue = "100 " + ToscaScalarUnitSize.GB.name();
+        Assert.assertTrue(DefinedHeatParameterTypes.isValueIsFromGivenType(inputValue,
+            DefinedHeatParameterTypes.NUMBER.getType()));
+
+        Assert.assertTrue(scalarUnitValidator.isValueScalarUnit(inputValue, ToscaScalarUnitSize.class));
+    }
+
+    @Test
+    public void shouldReturnTrueForScalarUnitSizeWithSpace() {
+        inputValue = "10              " + ToscaScalarUnitSize.GB.name();
+        Assert.assertTrue(DefinedHeatParameterTypes.isValueIsFromGivenType(inputValue,
+            DefinedHeatParameterTypes.NUMBER.getType()));
+
+        Assert.assertTrue(scalarUnitValidator.isValueScalarUnit(inputValue, ToscaScalarUnitSize.class));
+    }
+
+    @Test
+    public void shouldReturnTrueForScalarUnitSizeWithoutSpace() {
+        inputValue = "200" + ToscaScalarUnitSize.GB.name();
+        Assert.assertTrue(DefinedHeatParameterTypes.isValueIsFromGivenType(inputValue,
+            DefinedHeatParameterTypes.NUMBER.getType()));
+
+        Assert.assertTrue(scalarUnitValidator.isValueScalarUnit(inputValue, ToscaScalarUnitSize.class));
+    }
+
+    @Test
+    public void shouldReturnTrueForScalarUnitTime() {
+        inputValue = "5000 " + ToscaScalarUnitTime.S.name();
+        Assert.assertTrue(DefinedHeatParameterTypes.isValueIsFromGivenType(
+            inputValue, DefinedHeatParameterTypes.NUMBER.getType()));
+
+        Assert.assertTrue(scalarUnitValidator.isValueScalarUnit(inputValue, ToscaScalarUnitTime.class));
+    }
+
+    @Test
+    public void shouldReturnTrueForScalarUnitFrequency() {
+        inputValue = "60 " + ToscaScalarUnitFrequency.GHZ.name();
+        Assert.assertTrue(DefinedHeatParameterTypes.isValueIsFromGivenType(
+            inputValue, DefinedHeatParameterTypes.NUMBER.getType()));
+
+        Assert.assertTrue(scalarUnitValidator.isValueScalarUnit(inputValue, ToscaScalarUnitFrequency.class));
+    }
+
+    @Test
+    public void shouldReturnFalse() {
+        inputValue = "one hundred " + ToscaScalarUnitSize.GB.name();
+        Assert.assertFalse(DefinedHeatParameterTypes.isValueIsFromGivenType(
+            inputValue, DefinedHeatParameterTypes.NUMBER.getType()));
+
+        Assert.assertFalse(scalarUnitValidator.isValueScalarUnit(inputValue, ToscaScalarUnitSize.class));
+    }
+
+    @Test
+    public void shouldReturnFalseForMatcher() {
+        inputValue = "100 abc";
+        Assert.assertFalse(DefinedHeatParameterTypes.isValueIsFromGivenType(
+            inputValue, DefinedHeatParameterTypes.NUMBER.getType()));
+
+        Assert.assertFalse(scalarUnitValidator.isValueScalarUnit(inputValue, ToscaScalarUnitSize.class));
+    }
+
+}
index 866f78c..339d6ff 100644 (file)
@@ -232,12 +232,12 @@ public class TranslationService {
             return;
         }
 
+        final Environment heatEnvFile = getHeatEnvFile(heatFileData, context);
+        final Map<String, Object> parameters = heatEnvFile.getParameters();
         Map<String, ParameterDefinition> parameterDefinitionMap =
                 TranslatorHeatToToscaParameterConverter
                         .parameterConverter(serviceTemplate, heatOrchestrationTemplate.getParameters(),
-                                heatOrchestrationTemplate, heatFileName, heatFileData.getParentFile(), context);
-        Environment heatEnvFile = getHeatEnvFile(heatFileData, context);
-        Map<String, Object> parameters = heatEnvFile.getParameters();
+                                heatOrchestrationTemplate, heatFileName, heatFileData.getParentFile(), context, parameters);
         Object parameterValue;
         if (parameters != null) {
             for (Map.Entry<String, ParameterDefinition> entry : parameterDefinitionMap.entrySet()) {
index 84d36f7..a69c26c 100644 (file)
@@ -16,6 +16,7 @@
 
 package org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation;
 
+import java.util.Map;
 import org.onap.sdc.tosca.datatypes.model.NodeTemplate;
 import org.openecomp.sdc.heat.datatypes.HeatBoolean;
 import org.openecomp.sdc.heat.services.HeatConstants;
@@ -25,16 +26,14 @@ import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo;
 import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil;
 import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter;
 
-import java.util.Map;
-
 
 public class ResourceTranslationCinderVolumeImpl extends ResourceTranslationBase {
 
     private static final String VOLUME_SIZE_PROPERTY_NAME = "size";
 
     @Override
-    public void translate(TranslateTo translateTo) {
-        NodeTemplate nodeTemplate = new NodeTemplate();
+    public void translate(final TranslateTo translateTo) {
+        final NodeTemplate nodeTemplate = new NodeTemplate();
         nodeTemplate.setType(ToscaNodeType.CINDER_VOLUME);
         nodeTemplate.setProperties(TranslatorHeatToToscaPropertyConverter
                 .getToscaPropertiesSimpleConversion(translateTo.getServiceTemplate(),
@@ -43,9 +42,9 @@ public class ResourceTranslationCinderVolumeImpl extends ResourceTranslationBase
                         translateTo.getHeatOrchestrationTemplate(), translateTo.getResource().getType(),
                         nodeTemplate, translateTo.getContext()));
         handleSizeProperty(nodeTemplate.getProperties());
-        String toscaReadOnlyPropName =
+        final String toscaReadOnlyPropName =
                 HeatToToscaUtil.getToscaPropertyName(translateTo, HeatConstants.READ_ONLY_PROPERTY_NAME);
-        Object readOnlyPropVal = nodeTemplate.getProperties().get(toscaReadOnlyPropName);
+        final Object readOnlyPropVal = nodeTemplate.getProperties().get(toscaReadOnlyPropName);
         if (readOnlyPropVal != null && !(readOnlyPropVal instanceof Map)) {
             nodeTemplate.getProperties().put(toscaReadOnlyPropName, HeatBoolean.eval(readOnlyPropVal));
         }
@@ -54,18 +53,11 @@ public class ResourceTranslationCinderVolumeImpl extends ResourceTranslationBase
     }
 
 
-    private void handleSizeProperty(Map<String, Object> nodeTemplateProperties) {
-        Object size = nodeTemplateProperties.get(VOLUME_SIZE_PROPERTY_NAME);
+    private void handleSizeProperty(final Map<String, Object> nodeTemplateProperties) {
+        final Object size = nodeTemplateProperties.get(VOLUME_SIZE_PROPERTY_NAME);
         if (size == null) {
             return;
         }
-        if (size instanceof Map) {
-            Map<String, Object> propMap = (Map) size;
-            Map.Entry<String, Object> entry = propMap.entrySet().iterator().next();
-            String val = "(" + entry.getKey() + " : " + entry.getValue() + ") * 1024";
-            nodeTemplateProperties.put(VOLUME_SIZE_PROPERTY_NAME, val);
-        } else {
-            nodeTemplateProperties.put(VOLUME_SIZE_PROPERTY_NAME, size + "*1024");
-        }
+        nodeTemplateProperties.put(VOLUME_SIZE_PROPERTY_NAME, size);
     }
 }
index d4dc1ac..386b2e1 100644 (file)
@@ -23,14 +23,23 @@ import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Optional;
-
 import org.apache.commons.collections4.MapUtils;
-import org.onap.sdc.tosca.datatypes.model.*;
+import org.apache.commons.lang3.StringUtils;
+import org.onap.sdc.tosca.datatypes.model.Constraint;
+import org.onap.sdc.tosca.datatypes.model.EntrySchema;
+import org.onap.sdc.tosca.datatypes.model.ParameterDefinition;
+import org.onap.sdc.tosca.datatypes.model.ScalarUnitValidator;
+import org.onap.sdc.tosca.datatypes.model.ServiceTemplate;
 import org.onap.sdc.tosca.datatypes.model.heatextend.AnnotationDefinition;
 import org.onap.sdc.tosca.datatypes.model.heatextend.ParameterDefinitionExt;
 import org.openecomp.core.utilities.file.FileUtils;
-
+import org.openecomp.sdc.heat.datatypes.DefinedHeatParameterTypes;
+import org.openecomp.sdc.heat.datatypes.ToscaScalarUnitFrequency;
+import org.openecomp.sdc.heat.datatypes.ToscaScalarUnitSize;
+import org.openecomp.sdc.heat.datatypes.ToscaScalarUnitTime;
+import org.openecomp.sdc.heat.datatypes.ToscaScalarUnitTypes;
 import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate;
 import org.openecomp.sdc.heat.datatypes.model.Output;
 import org.openecomp.sdc.heat.datatypes.model.Parameter;
@@ -78,15 +87,17 @@ public class TranslatorHeatToToscaParameterConverter {
    * @return the map
    */
   public static Map<String, ParameterDefinition> parameterConverter(ServiceTemplate serviceTemplate,
-      Map<String, Parameter> parameters, HeatOrchestrationTemplate heatOrchestrationTemplate,
-      String heatFileName, String parentHeatFileName, TranslationContext context) {
+                                                                    Map<String, Parameter> parameters,
+                                                                    HeatOrchestrationTemplate heatOrchestrationTemplate,
+                                                                    String heatFileName, String parentHeatFileName,
+                                                                    TranslationContext context,
+                                                                    Map<String, Object> heatEnvParameters) {
     Map<String, ParameterDefinition> parameterDefinitionMap = new HashMap<>();
     for (Map.Entry<String, Parameter> entry : parameters.entrySet()) {
       String heatParamName = entry.getKey();
       parameterDefinitionMap.put(heatParamName,
-          getToscaParameter(serviceTemplate,heatParamName, entry.getValue(),
-              heatOrchestrationTemplate,
-              heatFileName, parentHeatFileName, context));
+          getToscaParameter(serviceTemplate,heatParamName, entry.getValue(), heatOrchestrationTemplate, heatFileName,
+              parentHeatFileName, context, heatEnvParameters));
     }
     return parameterDefinitionMap;
   }
@@ -100,9 +111,9 @@ public class TranslatorHeatToToscaParameterConverter {
    * @param context                   the context
    * @return the map
    */
-  public static Map<String, ParameterDefinition> parameterOutputConverter(ServiceTemplate
-                                                                              serviceTemplate,
-      Map<String, Output> parameters, HeatOrchestrationTemplate heatOrchestrationTemplate,
+  public static Map<String, ParameterDefinition> parameterOutputConverter(ServiceTemplate serviceTemplate,
+                                                                          Map<String, Output> parameters,
+                                                                          HeatOrchestrationTemplate heatOrchestrationTemplate,
       String heatFileName, TranslationContext context) {
     Map<String, ParameterDefinition> parameterDefinitionMap = new HashMap<>();
     for (Map.Entry<String, Output> entry : parameters.entrySet()) {
@@ -125,16 +136,16 @@ public class TranslatorHeatToToscaParameterConverter {
    * @return the tosca parameter
    */
   private static ParameterDefinitionExt getToscaParameter(ServiceTemplate serviceTemplate,
-                                                         String heatParameterName,
-                                                         Parameter heatParameter,
-                                                         HeatOrchestrationTemplate
-                                                             heatOrchestrationTemplate,
-                                                         String heatFileName,
-                                                         String parentHeatFileName,
-                                                         TranslationContext context) {
+                                                          String heatParameterName,
+                                                          Parameter heatParameter,
+                                                          HeatOrchestrationTemplate heatOrchestrationTemplate,
+                                                          String heatFileName,
+                                                          String parentHeatFileName,
+                                                          TranslationContext context,
+                                                          Map<String, Object> heatEnvParameters) {
 
     ParameterDefinitionExt toscaParameter = new ParameterDefinitionExt();
-    toscaParameter.setType(getToscaParameterType(heatParameter.getType()));
+    toscaParameter.setType(getToscaParameterType(heatParameter.getType(), heatEnvParameters));
     toscaParameter.setEntry_schema(getToscaParameterEntrySchema(toscaParameter.getType()));
     toscaParameter.setLabel(heatParameter.getLabel());
     toscaParameter.setDescription(heatParameter.getDescription());
@@ -330,7 +341,32 @@ public class TranslatorHeatToToscaParameterConverter {
     return entrySchema;
   }
 
-  protected static String getToscaParameterType(String heatParameterType) {
+  protected static String getToscaParameterType(final String heatParameterType,
+                                                final Map<String, Object> heatEnvParameters) {
+    if (heatEnvParameters != null && DefinedHeatParameterTypes.NUMBER.getType().equals(heatParameterType)) {
+      if (getScalarUnitType(heatEnvParameters, ToscaScalarUnitSize.class) != null) {
+        return ToscaScalarUnitTypes.SCALAR_UNIT_SIZE.getType();
+      } else if (getScalarUnitType(heatEnvParameters, ToscaScalarUnitTime.class) != null) {
+        return ToscaScalarUnitTypes.SCALAR_UNIT_TIME.getType();
+      } else if (getScalarUnitType(heatEnvParameters, ToscaScalarUnitFrequency.class) != null) {
+        return ToscaScalarUnitTypes.SCALAR_UNIT_FREQUENCY.getType();
+      }
+    }
+
     return parameterTypeMapping.get(heatParameterType);
   }
+
+  private static <E extends Enum<E>> String getScalarUnitType(final Map<String, Object> heatEnvParameters,
+                                                              final Class<E> enumClass) {
+    final ScalarUnitValidator scalarUnitValidator = ScalarUnitValidator.getInstance();
+    if (Arrays.stream(enumClass.getEnumConstants()).anyMatch(unitType ->
+            heatEnvParameters.values().stream().filter(Objects::nonNull)
+                .anyMatch(parameterValue -> scalarUnitValidator.isScalarUnit(parameterValue.toString()) &&
+                    Arrays.stream(StringUtils.split(parameterValue.toString()))
+                        .anyMatch(strParamValue -> strParamValue.equalsIgnoreCase(unitType.name()))))) {
+      return enumClass.getTypeName();
+    }
+    return null;
+  }
+
 }
index 793a9e4..e543936 100644 (file)
@@ -128,7 +128,7 @@ topology_template:
             - availability_zone_0
         image:
           get_input: bootimage
-        size: 35*1024
+        size: 35
         name:
           str_replace:
             template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-boot-volume
@@ -192,7 +192,7 @@ topology_template:
           - get_input: indx
           - get_input:
             - availability_zone_0
-        size: 265*1024
+        size: 265
         name:
           str_replace:
             template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-data-volume
index aadea7b..32a260b 100644 (file)
@@ -328,9 +328,9 @@ topology_template:
             - ocgapp_04
             source_type: HEAT
             param_name: ocgapp_volume_size_3
-      type: float
+      type: scalar-unit.size
       description: the size of the Cinder volume
-      default: 400
+      default: 400 MB
       constraints:
       - in_range:
         - 100
@@ -388,9 +388,9 @@ topology_template:
             - ocgapp_03
             source_type: HEAT
             param_name: ocgapp_volume_size_2
-      type: float
+      type: scalar-unit.size
       description: the size of the Cinder volume
-      default: 400
+      default: 400 MB
       constraints:
       - in_range:
         - 100
@@ -407,9 +407,9 @@ topology_template:
             - ocgapp_02
             source_type: HEAT
             param_name: ocgapp_volume_size_1
-      type: float
+      type: scalar-unit.size
       description: the size of the Cinder volume
-      default: 400
+      default: 400 MB
       constraints:
       - in_range:
         - 100
@@ -426,9 +426,9 @@ topology_template:
             - ocgapp_01
             source_type: HEAT
             param_name: ocgapp_volume_size_0
-      type: float
+      type: scalar-unit.size
       description: the size of the Cinder volume
-      default: 400
+      default: 400 MB
       constraints:
       - in_range:
         - 100
@@ -1784,7 +1784,8 @@ topology_template:
       properties:
         volume_type:
           get_input: ocgapp_volume_type_1
-        size: '(get_input : ocgapp_volume_size_1) * 1024'
+        size:
+          get_input: ocgapp_volume_size_1
         name:
           str_replace:
             template: VF_NAME_STACK_NAME_volume_1
@@ -1798,7 +1799,8 @@ topology_template:
       properties:
         volume_type:
           get_input: ocgapp_volume_type_0
-        size: '(get_input : ocgapp_volume_size_0) * 1024'
+        size:
+          get_input: ocgapp_volume_size_0
         name:
           str_replace:
             template: VF_NAME_STACK_NAME_volume_1
@@ -1812,7 +1814,8 @@ topology_template:
       properties:
         volume_type:
           get_input: ocgapp_volume_type_3
-        size: '(get_input : ocgapp_volume_size_3) * 1024'
+        size:
+          get_input: ocgapp_volume_size_3
         name:
           str_replace:
             template: VF_NAME_STACK_NAME_volume_3
@@ -1857,7 +1860,8 @@ topology_template:
       properties:
         volume_type:
           get_input: ocgapp_volume_type_2
-        size: '(get_input : ocgapp_volume_size_2) * 1024'
+        size:
+          get_input: ocgapp_volume_size_2
         name:
           str_replace:
             template: VF_NAME_STACK_NAME_volume_2
index 793a9e4..e543936 100644 (file)
@@ -128,7 +128,7 @@ topology_template:
             - availability_zone_0
         image:
           get_input: bootimage
-        size: 35*1024
+        size: 35
         name:
           str_replace:
             template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-boot-volume
@@ -192,7 +192,7 @@ topology_template:
           - get_input: indx
           - get_input:
             - availability_zone_0
-        size: 265*1024
+        size: 265
         name:
           str_replace:
             template: Z$CLOUD_ZONE_ID$VF_NAME$VF_INSTANCE_NUM$VF_COMPONENT$VM_INSTANCE_NUM-data-volume
index 2758226..5fb69e7 100644 (file)
@@ -1183,7 +1183,7 @@ topology_template:
             - vmme_small
             source_type: HEAT
             param_name: volume_size
-      type: string
+      type: float
       description: volume
     fsb2-image:
       hidden: false
@@ -1612,7 +1612,7 @@ topology_template:
           get_input: FSB_1_image
         volume_type:
           get_input: volume_type
-        size: 3*1024
+        size: 3
         name:
           get_input: FSB1_volume_name
     testConvertGetParamFunctions:
@@ -1637,7 +1637,8 @@ topology_template:
           get_input: FSB_2_image
         volume_type:
           get_input: volume_type
-        size: '(get_input : volume_size) * 1024'
+        size:
+          get_input: volume_size
         name:
           get_input: FSB2_volume_name
     FSB1_OAM:
index 50b4130..8293f5c 100644 (file)
@@ -2871,7 +2871,8 @@ topology_template:
       properties:
         volume_type:
           get_input: MMSC_volume_type
-        size: '(get_input : mmsc_cinder_volume_size) * 1024'
+        size:
+          get_input: mmsc_cinder_volume_size
     lb2_eca_traffic_port:
       type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
       properties:
@@ -3008,13 +3009,15 @@ topology_template:
       properties:
         volume_type:
           get_input: MMSC_volume_type
-        size: '(get_input : mmsc_cinder_volume_size) * 1024'
+        size:
+          get_input: mmsc_cinder_volume_size
     cmaui1_volume:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     nems_traffic_net:
       type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
       properties:
@@ -3346,7 +3349,8 @@ topology_template:
       properties:
         volume_type:
           get_input: ARB_volume_type
-        size: '(get_input : arb_volume_size) * 1024'
+        size:
+          get_input: arb_volume_size
     eca_trx12_port_1:
       type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
       properties:
@@ -3724,7 +3728,8 @@ topology_template:
       properties:
         volume_type:
           get_input: MMSC_volume_type
-        size: '(get_input : mmsc_cinder_volume_size) * 1024'
+        size:
+          get_input: mmsc_cinder_volume_size
     eca_trx7_port_2:
       type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
       properties:
@@ -3866,7 +3871,8 @@ topology_template:
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     eca_trx3_port_1:
       type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
       properties:
@@ -3958,7 +3964,8 @@ topology_template:
       properties:
         volume_type:
           get_input: MMSC_volume_type
-        size: '(get_input : mmsc_cinder_volume_size) * 1024'
+        size:
+          get_input: mmsc_cinder_volume_size
     nems_imap_net:
       type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
       properties:
@@ -4224,7 +4231,8 @@ topology_template:
       properties:
         volume_type:
           get_input: NEMS_FE_volume_type
-        size: '(get_input : nems_volume_size) * 1024'
+        size:
+          get_input: nems_volume_size
     server_nems_be1:
       type: org.openecomp.resource.vfc.nodes.heat.nems_be
       properties:
@@ -4272,7 +4280,8 @@ topology_template:
       properties:
         volume_type:
           get_input: ECA_OAM_volume_type
-        size: '(get_input : oam_volume_size) * 1024'
+        size:
+          get_input: oam_volume_size
     server_nems_fe2:
       type: org.openecomp.resource.vfc.nodes.heat.nems_fe
       properties:
@@ -4300,7 +4309,8 @@ topology_template:
       properties:
         volume_type:
           get_input: ECA_OAM_volume_type
-        size: '(get_input : oam_volume_size) * 1024'
+        size:
+          get_input: oam_volume_size
     lb2_cor_direct_port:
       type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
       properties:
@@ -5107,7 +5117,8 @@ topology_template:
       properties:
         volume_type:
           get_input: NEMS_BE_volume_type
-        size: '(get_input : nems_be_volume_size) * 1024'
+        size:
+          get_input: nems_be_volume_size
     server_mmsc4:
       type: org.openecomp.resource.vfc.nodes.heat.mmsc
       properties:
@@ -5666,7 +5677,8 @@ topology_template:
       properties:
         volume_type:
           get_input: NEMS_FE_volume_type
-        size: '(get_input : nems_volume_size) * 1024'
+        size:
+          get_input: nems_volume_size
     eca_trx10_port_2:
       type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
       properties:
@@ -6368,7 +6380,8 @@ topology_template:
       properties:
         volume_type:
           get_input: MMSC_volume_type
-        size: '(get_input : mmsc_cinder_volume_size) * 1024'
+        size:
+          get_input: mmsc_cinder_volume_size
   relationship_templates:
     mmsc1_volume_attachment:
       type: org.openecomp.relationships.VolumeAttachesTo
index cdc13a0..cd3491a 100644 (file)
@@ -2595,7 +2595,8 @@ topology_template:
       properties:
         volume_type:
           get_input: MMSC_volume_type
-        size: '(get_input : mmsc_cinder_volume_size) * 1024'
+        size:
+          get_input: mmsc_cinder_volume_size
     lb2_eca_traffic_port:
       type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
       properties:
@@ -2704,13 +2705,15 @@ topology_template:
       properties:
         volume_type:
           get_input: MMSC_volume_type
-        size: '(get_input : mmsc_cinder_volume_size) * 1024'
+        size:
+          get_input: mmsc_cinder_volume_size
     cmaui1_volume:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     nems_traffic_net:
       type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
       properties:
@@ -3365,7 +3368,8 @@ topology_template:
       properties:
         volume_type:
           get_input: MMSC_volume_type
-        size: '(get_input : mmsc_cinder_volume_size) * 1024'
+        size:
+          get_input: mmsc_cinder_volume_size
     eca_trx7_port_2:
       type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
       properties:
@@ -3509,7 +3513,8 @@ topology_template:
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     eca_trx3_port_1:
       type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
       properties:
@@ -3601,7 +3606,8 @@ topology_template:
       properties:
         volume_type:
           get_input: MMSC_volume_type
-        size: '(get_input : mmsc_cinder_volume_size) * 1024'
+        size:
+          get_input: mmsc_cinder_volume_size
     nems_imap_net:
       type: org.openecomp.resource.vl.nodes.heat.network.contrail.VirtualNetwork
       properties:
@@ -3867,7 +3873,8 @@ topology_template:
       properties:
         volume_type:
           get_input: NEMS_FE_volume_type
-        size: '(get_input : nems_volume_size) * 1024'
+        size:
+          get_input: nems_volume_size
     server_nems_be1:
       type: org.openecomp.resource.vfc.nodes.heat.nems_be
       properties:
@@ -4682,7 +4689,8 @@ topology_template:
       properties:
         volume_type:
           get_input: NEMS_BE_volume_type
-        size: '(get_input : nems_be_volume_size) * 1024'
+        size:
+          get_input: nems_be_volume_size
     server_mmsc4:
       type: org.openecomp.resource.vfc.nodes.heat.mmsc
       properties:
@@ -5208,7 +5216,8 @@ topology_template:
       properties:
         volume_type:
           get_input: NEMS_FE_volume_type
-        size: '(get_input : nems_volume_size) * 1024'
+        size:
+          get_input: nems_volume_size
     eca_trx10_port_2:
       type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
       properties:
@@ -5889,7 +5898,8 @@ topology_template:
       properties:
         volume_type:
           get_input: MMSC_volume_type
-        size: '(get_input : mmsc_cinder_volume_size) * 1024'
+        size:
+          get_input: mmsc_cinder_volume_size
   relationship_templates:
     nems1_fe_volume_attachment:
       type: org.openecomp.relationships.VolumeAttachesTo
index 9b69834..44f1693 100644 (file)
@@ -298,7 +298,8 @@ topology_template:
       properties:
         volume_type:
           get_input: ARB_volume_type
-        size: '(get_input : arb_volume_size) * 1024'
+        size:
+          get_input: arb_volume_size
     oam1_instance:
       type: org.openecomp.resource.vfc.nodes.heat.eca
       properties:
@@ -325,13 +326,15 @@ topology_template:
       properties:
         volume_type:
           get_input: ECA_OAM_volume_type
-        size: '(get_input : oam_volume_size) * 1024'
+        size:
+          get_input: oam_volume_size
     oam1_volume:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: ECA_OAM_volume_type
-        size: '(get_input : oam_volume_size) * 1024'
+        size:
+          get_input: oam_volume_size
     oam1_int_port:
       type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
       properties:
index 2bef1f9..d56cf15 100644 (file)
@@ -112,7 +112,7 @@ topology_template:
           get_input: FSB_1_image
         volume_type:
           get_input: volume_type
-        size: 3*1024
+        size: 3
         read_only:
           get_input: stam
         name:
@@ -124,7 +124,8 @@ topology_template:
           get_input: FSB_2_image
         volume_type:
           get_input: volume_type
-        size: '(get_input : volume_size) * 1024'
+        size:
+          get_input: volume_size
         read_only: true
         name:
           get_input: FSB2_volume_name
@@ -135,7 +136,7 @@ topology_template:
           get_input: FSB_1_image
         volume_type:
           get_input: volume_type
-        size: 3*1024
+        size: 3
         read_only: true
         name:
           get_input: FSB1_volume_name
@@ -146,7 +147,8 @@ topology_template:
           get_input: FSB_2_image
         volume_type:
           get_input: volume_type
-        size: '(get_input : volume_size) * 1024'
+        size:
+          get_input: volume_size
         read_only: true
         name:
           get_input: FSB2_volume_name
index 40695ff..96272db 100644 (file)
@@ -813,7 +813,8 @@ topology_template:
     plt_volume_shared_0:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
-        size: '(get_input : plt_servicedata2_volume_size_0) * 1024'
+        size:
+          get_input: plt_servicedata2_volume_size_0
         name:
           str_replace:
             template: $vnf_name-plt_volume_shared_0
@@ -850,7 +851,8 @@ topology_template:
     app_volume_1:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
-        size: '(get_input : app_volume_size_0) * 1024'
+        size:
+          get_input: app_volume_size_0
         name:
           str_replace:
             template: $vnf_name-app_volume_1
@@ -860,7 +862,8 @@ topology_template:
     app_volume_2:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
-        size: '(get_input : app_volume_size_0) * 1024'
+        size:
+          get_input: app_volume_size_0
         name:
           str_replace:
             template: $vnf_name-app_volume_2
@@ -870,7 +873,8 @@ topology_template:
     app_volume_0:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
-        size: '(get_input : app_volume_size_0) * 1024'
+        size:
+          get_input: app_volume_size_0
         name:
           str_replace:
             template: $vnf_name-app_volume_0
@@ -880,7 +884,8 @@ topology_template:
     plt_volume_1:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
-        size: '(get_input : plt_servicedata1_volume_size_0) * 1024'
+        size:
+          get_input: plt_servicedata1_volume_size_0
         name:
           str_replace:
             template: $vnf_name-plt_volume_1
@@ -890,7 +895,8 @@ topology_template:
     plt_volume_0:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
-        size: '(get_input : plt_servicedata1_volume_size_0) * 1024'
+        size:
+          get_input: plt_servicedata1_volume_size_0
         name:
           str_replace:
             template: $vnf_name-plt_volume_0
index cd6075a..3cdf6fb 100644 (file)
@@ -2469,7 +2469,8 @@ topology_template:
       properties:
         availability_zone:
           get_input: availability_zone_0
-        size: '(get_input : oam_volume_size_0) * 1024'
+        size:
+          get_input: oam_volume_size_0
         name:
           str_replace:
             template: $VNF$DELoam$DELvolume$DEL0
@@ -2743,7 +2744,8 @@ topology_template:
       properties:
         availability_zone:
           get_input: availability_zone_1
-        size: '(get_input : oam_volume_size_0) * 1024'
+        size:
+          get_input: oam_volume_size_0
         name:
           str_replace:
             template: $VNF$DELoam$DELvolume$DEL1
@@ -2867,7 +2869,8 @@ topology_template:
       properties:
         availability_zone:
           get_input: availability_zone_0
-        size: '(get_input : cif_volume_size_0) * 1024'
+        size:
+          get_input: cif_volume_size_0
         name:
           str_replace:
             template: $VNF$DELcif$DELvolume$DEL0
@@ -2881,7 +2884,8 @@ topology_template:
       properties:
         availability_zone:
           get_input: availability_zone_1
-        size: '(get_input : cif_volume_size_0) * 1024'
+        size:
+          get_input: cif_volume_size_0
         name:
           str_replace:
             template: $VNF$DELcif$DELvolume$DEL1
index 323bbb3..ab51fae 100644 (file)
@@ -2069,7 +2069,8 @@ topology_template:
             get_input: vnf_name
           vf_module_name:
             get_input: vf_module_name
-        size: '(get_input : vson_dbc_volume_size_0) * 1024'
+        size:
+          get_input: vson_dbc_volume_size_0
         name:
           get_input: vson_dbc_volume_name_0
         description: vSON DB Config cinder volume.
@@ -2085,7 +2086,8 @@ topology_template:
             get_input: vnf_name
           vf_module_name:
             get_input: vf_module_name
-        size: '(get_input : vson_mdr_volume_size_0) * 1024'
+        size:
+          get_input: vson_mdr_volume_size_0
         name:
           get_input: vson_mdr_volume_name_0
         description: |
@@ -2102,7 +2104,8 @@ topology_template:
             get_input: vnf_name
           vf_module_name:
             get_input: vf_module_name
-        size: '(get_input : vson_mgt_volume_size_0) * 1024'
+        size:
+          get_input: vson_mgt_volume_size_0
         name:
           get_input: vson_mgt_volume_name_0
         description: |
@@ -2119,7 +2122,8 @@ topology_template:
             get_input: vnf_name
           vf_module_name:
             get_input: vf_module_name
-        size: '(get_input : vson_mon_volume_size_0) * 1024'
+        size:
+          get_input: vson_mon_volume_size_0
         name:
           get_input: vson_mon_volume_name_0
         description: |
@@ -2134,7 +2138,8 @@ topology_template:
             get_input: vnf_name
           vf_module_name:
             get_input: vf_module_name
-        size: '(get_input : vson_cll_volume_size_2) * 1024'
+        size:
+          get_input: vson_cll_volume_size_2
         name:
           str_replace:
             template: VNF_NAME_cll_volume_2
@@ -2152,7 +2157,8 @@ topology_template:
             get_input: vnf_name
           vf_module_name:
             get_input: vf_module_name
-        size: '(get_input : vson_cll_volume_size_0) * 1024'
+        size:
+          get_input: vson_cll_volume_size_0
         name:
           str_replace:
             template: VNF_NAME_cll_volume_0
@@ -2170,7 +2176,8 @@ topology_template:
             get_input: vnf_name
           vf_module_name:
             get_input: vf_module_name
-        size: '(get_input : vson_cll_volume_size_1) * 1024'
+        size:
+          get_input: vson_cll_volume_size_1
         name:
           str_replace:
             template: VNF_NAME_cll_volume_1
@@ -2311,7 +2318,8 @@ topology_template:
             get_input: vnf_name
           vf_module_name:
             get_input: vf_module_name
-        size: '(get_input : vson_dbs_volume_size_1) * 1024'
+        size:
+          get_input: vson_dbs_volume_size_1
         name:
           get_input: vson_dbs_volume_name_1
         description: Cinder volume for the second vSON DBS VM instance.
@@ -2393,7 +2401,8 @@ topology_template:
             get_input: vnf_name
           vf_module_name:
             get_input: vf_module_name
-        size: '(get_input : vson_dbs_volume_size_0) * 1024'
+        size:
+          get_input: vson_dbs_volume_size_0
         name:
           get_input: vson_dbs_volume_name_0
         description: Cinder volume for the first vSON DBS VM instance.
@@ -2472,7 +2481,8 @@ topology_template:
             get_input: vnf_name
           vf_module_name:
             get_input: vf_module_name
-        size: '(get_input : vson_dcl_volume_size_2) * 1024'
+        size:
+          get_input: vson_dcl_volume_size_2
         name:
           str_replace:
             template: VNF_NAME_dcl_volume_2
@@ -2490,7 +2500,8 @@ topology_template:
             get_input: vnf_name
           vf_module_name:
             get_input: vf_module_name
-        size: '(get_input : vson_dcl_volume_size_0) * 1024'
+        size:
+          get_input: vson_dcl_volume_size_0
         name:
           str_replace:
             template: VNF_NAME_dcl_volume_0
@@ -2508,7 +2519,8 @@ topology_template:
             get_input: vnf_name
           vf_module_name:
             get_input: vf_module_name
-        size: '(get_input : vson_dcl_volume_size_1) * 1024'
+        size:
+          get_input: vson_dcl_volume_size_1
         name:
           str_replace:
             template: VNF_NAME_dcl_volume_1
@@ -2885,7 +2897,8 @@ topology_template:
             get_input: vnf_name
           vf_module_name:
             get_input: vf_module_name
-        size: '(get_input : vson_dbg_volume_size_0) * 1024'
+        size:
+          get_input: vson_dbg_volume_size_0
         name:
           get_input: vson_dbg_volume_name_0
         description: vSON DB Global cinder volume.
@@ -3042,7 +3055,8 @@ topology_template:
             get_input: vnf_name
           vf_module_name:
             get_input: vf_module_name
-        size: '(get_input : vson_app_volume_size_0) * 1024'
+        size:
+          get_input: vson_app_volume_size_0
         name:
           get_input: vson_app_volume_name_0
         description: vSON APP cinder volume.
index e89a0c7..cd877d4 100644 (file)
@@ -1517,7 +1517,8 @@ topology_template:
       properties:
         availability_zone:
           get_input: availability_zone_0
-        size: '(get_input : oam_volume_size_0) * 1024'
+        size:
+          get_input: oam_volume_size_0
         name:
           str_replace:
             template: $VNF$DELoam$DELvolume$DEL0
@@ -1801,7 +1802,8 @@ topology_template:
       properties:
         availability_zone:
           get_input: availability_zone_1
-        size: '(get_input : oam_volume_size_0) * 1024'
+        size:
+          get_input: oam_volume_size_0
         name:
           str_replace:
             template: $VNF$DELoam$DELvolume$DEL1
@@ -1922,7 +1924,8 @@ topology_template:
       properties:
         availability_zone:
           get_input: availability_zone_0
-        size: '(get_input : cif_volume_size_0) * 1024'
+        size:
+          get_input: cif_volume_size_0
         name:
           str_replace:
             template: $VNF$DELcif$DELvolume$DEL0
@@ -1936,7 +1939,8 @@ topology_template:
       properties:
         availability_zone:
           get_input: availability_zone_1
-        size: '(get_input : cif_volume_size_0) * 1024'
+        size:
+          get_input: cif_volume_size_0
         name:
           str_replace:
             template: $VNF$DELcif$DELvolume$DEL1
index 25470e4..c450f05 100644 (file)
@@ -609,7 +609,8 @@ topology_template:
           get_input: FSB_1_image
         volume_type:
           get_input: volume_type
-        size: '(get_input : volume_size) * 1024'
+        size:
+          get_input: volume_size
         name:
           get_input: FSB1_volume_name
     FSB2_volume:
@@ -619,7 +620,8 @@ topology_template:
           get_input: FSB_2_image
         volume_type:
           get_input: volume_type
-        size: '(get_input : volume_size) * 1024'
+        size:
+          get_input: volume_size
         name:
           get_input: FSB2_volume_name
     abstract_VLC2:
index efc5e3c..7bb68e8 100644 (file)
@@ -320,7 +320,7 @@ topology_template:
           - allowed_address_pair
           - 0
           - mac
-        size: 50*1024
+        size: 50
         name:
           get_attribute:
           - abstract_pd_server
@@ -376,7 +376,10 @@ topology_template:
           get_attribute:
           - abstract_pd_server
           - pd_server_pd01_port_0_port_security_enabled
-        size: '(get_attribute : [pd01_port_0, network]) * 1024'
+        size:
+          get_attribute:
+          - abstract_pd_server
+          - pd_server_pd01_port_0_network
         read_only:
           get_attribute:
           - abstract_pd_server
index e0c3cb4..32750b6 100644 (file)
@@ -81,9 +81,9 @@ topology_template:
             - hot-nimbus-oam_v1.0
             source_type: HEAT
             param_name: pcrf_oam_vol_size
-      type: float
+      type: scalar-unit.size
       description: the size of the Cinder volume
-      default: 500
+      default: 500 GB
     pcrf_oam_vol_name_2:
       label: OAM volume name 2
       hidden: false
@@ -1053,7 +1053,8 @@ topology_template:
       properties:
         volume_type:
           get_input: pcrf_oam_volume_silver-1
-        size: '(get_input : pcrf_oam_vol_size) * 1024'
+        size:
+          get_input: pcrf_oam_vol_size
         name:
           get_input: pcrf_oam_vol_name_1
     server_pcrf_oam_001:
@@ -1339,7 +1340,8 @@ topology_template:
       properties:
         volume_type:
           get_input: pcrf_pcm_volume_silver
-        size: '(get_input : pcrf_pcm_vol_size) * 1024'
+        size:
+          get_input: pcrf_pcm_vol_size
         name:
           get_input: pcrf_pcm_vol_name_1
     server_pcrf_ppd_001:
@@ -1761,7 +1763,8 @@ topology_template:
       properties:
         volume_type:
           get_input: pcrf_oam_volume_silver-2
-        size: '(get_input : pcrf_oam_vol_size) * 1024'
+        size:
+          get_input: pcrf_oam_vol_size
         name:
           get_input: pcrf_oam_vol_name_2
     server_pcrf_psm_009:
index d2d5a92..5008055 100644 (file)
@@ -149,7 +149,8 @@ topology_template:
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     test_resourceGroup:
       type: org.openecomp.resource.abstract.nodes.heat.nested3
       directives:
@@ -180,7 +181,8 @@ topology_template:
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
   groups:
     main_group:
       type: org.openecomp.groups.heat.HeatStack
index 0c89037..6a251dc 100644 (file)
@@ -294,13 +294,15 @@ topology_template:
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     cmaui_volume2:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
   groups:
     main_group:
       type: org.openecomp.groups.heat.HeatStack
index fe9c34a..911181e 100644 (file)
@@ -408,7 +408,8 @@ topology_template:
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     server_cmaui21:
       type: org.openecomp.resource.vfc.nodes.heat.cmaui
       properties:
@@ -431,7 +432,8 @@ topology_template:
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     cmaui_port_1:
       type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
       properties:
index a6843e3..547e925 100644 (file)
@@ -133,7 +133,8 @@ topology_template:
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     test_resourceGroup:
       type: org.openecomp.resource.abstract.nodes.heat.nested3
       directives:
@@ -163,7 +164,8 @@ topology_template:
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     test_nova:
       type: org.openecomp.resource.vfc.nodes.heat.jsa
       properties:
index a82686f..c99bf33 100644 (file)
@@ -343,13 +343,15 @@ topology_template:
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     cmaui_volume2:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     cmaui_port_1:
       type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
       properties:
index 1bd7482..f3b6ea2 100644 (file)
@@ -177,7 +177,8 @@ topology_template:
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     test_resourceGroup:
       type: org.openecomp.resource.abstract.nodes.heat.nested3
       directives:
@@ -208,7 +209,8 @@ topology_template:
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     test_nova:
       type: org.openecomp.resource.vfc.nodes.heat.jsa
       properties:
index b0b26f5..26072b7 100644 (file)
@@ -70,13 +70,15 @@ topology_template:
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     test_vol2:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     test_nested:
       type: org.openecomp.resource.abstract.nodes.heat.nested
       directives:
index eaed82b..9be18df 100644 (file)
@@ -168,13 +168,15 @@ topology_template:
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     test_vol2:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     server_cmaui:
       type: org.openecomp.resource.vfc.nodes.heat.cmaui
       properties:
index 00c7996..747459e 100644 (file)
@@ -263,13 +263,15 @@ topology_template:
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     cmaui_volume2:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     cmaui_port_1:
       type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port
       properties:
index 5b3b793..8b172f8 100644 (file)
@@ -52,13 +52,15 @@ topology_template:
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     test_vol2:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     test_nested:
       type: org.openecomp.resource.abstract.nodes.heat.nested
       directives:
index 82b8920..25ae877 100644 (file)
@@ -160,7 +160,8 @@ topology_template:
       properties:
         volume_type:
           get_input: qrouter_volume_type_1
-        size: '(get_input : qrouter_volume_size_1) * 1024'
+        size:
+          get_input: qrouter_volume_size_1
         description:
           get_input: qrouter_volume_name_1
     qrouter_volume_0:
@@ -168,7 +169,8 @@ topology_template:
       properties:
         volume_type:
           get_input: qrouter_volume_type_0
-        size: '(get_input : qrouter_volume_size_0) * 1024'
+        size:
+          get_input: qrouter_volume_size_0
         description:
           get_input: qrouter_volume_name_0
     qrouter_volume_2:
@@ -176,7 +178,8 @@ topology_template:
       properties:
         volume_type:
           get_input: qrouter_volume_type_2
-        size: '(get_input : qrouter_volume_size_2) * 1024'
+        size:
+          get_input: qrouter_volume_size_2
         description:
           get_input: qrouter_volume_name_2
     QRouter1:
index 13f0630..8a5534d 100644 (file)
@@ -320,7 +320,8 @@ topology_template:
       properties:
         volume_type:
           get_input: vLBAgent_volume_type_0
-        size: '(get_input : vLBAgent_volume_size_0) * 1024'
+        size:
+          get_input: vLBAgent_volume_size_0
         description:
           get_input: vLBAgent_volume_name_0
     vLBAgent_volume_1:
@@ -328,7 +329,8 @@ topology_template:
       properties:
         volume_type:
           get_input: vLBAgent_volume_type_1
-        size: '(get_input : vLBAgent_volume_size_1) * 1024'
+        size:
+          get_input: vLBAgent_volume_size_1
         description:
           get_input: vLBAgent_volume_name_1
     oam_private_net_network_port_3:
@@ -358,7 +360,8 @@ topology_template:
       properties:
         volume_type:
           get_input: vLBAgent_volume_type_2
-        size: '(get_input : vLBAgent_volume_size_2) * 1024'
+        size:
+          get_input: vLBAgent_volume_size_2
         description:
           get_input: vLBAgent_volume_name_2
     packet_internal_network_port:
index af4eef1..06ecef3 100644 (file)
@@ -215,19 +215,22 @@ topology_template:
       properties:
         volume_type:
           get_input: vLB_volume_type_1
-        size: '(get_input : vLB_volume_size_1) * 1024'
+        size:
+          get_input: vLB_volume_size_1
     vLB_volume_0:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: vLB_volume_type_0
-        size: '(get_input : vLB_volume_size_0) * 1024'
+        size:
+          get_input: vLB_volume_size_0
     vLB_volume_2:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: vLB_volume_type_2
-        size: '(get_input : vLB_volume_size_2) * 1024'
+        size:
+          get_input: vLB_volume_size_2
     vLBInstance:
       type: org.openecomp.resource.vfc.nodes.heat.vLB
       properties:
index 2aaf8e5..25a3300 100644 (file)
@@ -303,7 +303,8 @@ topology_template:
       properties:
         volume_type:
           get_input: vprobe_volume_type_2
-        size: '(get_input : vprobe_volume_size_2) * 1024'
+        size:
+          get_input: vprobe_volume_size_2
         description:
           get_input: vprobe_volume_name_2
     vprobe_volume_1:
@@ -311,7 +312,8 @@ topology_template:
       properties:
         volume_type:
           get_input: vprobe_volume_type_1
-        size: '(get_input : vprobe_volume_size_1) * 1024'
+        size:
+          get_input: vprobe_volume_size_1
         description:
           get_input: vprobe_volume_name_1
     vprobe_volume_0:
@@ -319,7 +321,8 @@ topology_template:
       properties:
         volume_type:
           get_input: vprobe_volume_type_0
-        size: '(get_input : vprobe_volume_size_0) * 1024'
+        size:
+          get_input: vprobe_volume_size_0
         description:
           get_input: vprobe_volume_name_0
     oam_private_net_network_port_1:
index d24e318..d87db43 100644 (file)
@@ -297,13 +297,15 @@ topology_template:
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     cmaui_volume2:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
   groups:
     ep-jsa_net_group:
       type: org.openecomp.groups.heat.HeatStack
index c673099..913354d 100644 (file)
@@ -131,13 +131,15 @@ topology_template:
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     cmaui_volume2:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     FSB1:
       type: org.openecomp.resource.abstract.nodes.FSB1
       directives:
index 0673c7c..a2f0ef7 100644 (file)
@@ -408,13 +408,15 @@ topology_template:
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     cmaui_volume2:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
   groups:
     ep-jsa_net_group:
       type: org.openecomp.groups.heat.HeatStack
index 9d12634..e43cf1f 100644 (file)
@@ -397,13 +397,15 @@ topology_template:
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     cmaui_volume2:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
   groups:
     ep-jsa_net_group:
       type: org.openecomp.groups.heat.HeatStack
index 9960d9b..d7a5393 100644 (file)
@@ -166,13 +166,15 @@ topology_template:
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     cmaui_volume2:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
   groups:
     ep-jsa_net_group:
       type: org.openecomp.groups.heat.HeatStack
index 609d952..e55f75a 100644 (file)
@@ -167,13 +167,15 @@ topology_template:
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     cmaui_volume2:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     abstract_FSB:
       type: org.openecomp.resource.abstract.nodes.FSB
       directives:
index af1fd69..a597559 100644 (file)
@@ -144,13 +144,15 @@ topology_template:
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     cmaui_volume2:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
   groups:
     ep-jsa_net_group:
       type: org.openecomp.groups.heat.HeatStack
index 6305a7c..774f718 100644 (file)
@@ -146,13 +146,15 @@ topology_template:
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     cmaui_volume2:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     abstract_FSB:
       type: org.openecomp.resource.abstract.nodes.FSB
       directives:
index 017dd97..d59f213 100644 (file)
@@ -215,25 +215,29 @@ topology_template:
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     cmaui_volume2:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     cmaui_volume3:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     cmaui_volume4:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
   groups:
     ep-jsa_net_group:
       type: org.openecomp.groups.heat.HeatStack
index dc3eca3..ffc6566 100644 (file)
@@ -216,25 +216,29 @@ topology_template:
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     cmaui_volume2:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     cmaui_volume3:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     cmaui_volume4:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     abstract_FSB:
       type: org.openecomp.resource.abstract.nodes.FSB
       directives:
index 8de7a78..1be19f4 100644 (file)
@@ -297,13 +297,15 @@ topology_template:
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     cmaui_volume2:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
   groups:
     ep-jsa_net_group:
       type: org.openecomp.groups.heat.HeatStack
index 8dd35a7..ff21190 100644 (file)
@@ -297,13 +297,15 @@ topology_template:
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     cmaui_volume2:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
   groups:
     ep-jsa_net_group:
       type: org.openecomp.groups.heat.HeatStack
index a2ef5b3..a23e8b1 100644 (file)
@@ -230,13 +230,15 @@ topology_template:
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     cmaui_volume2:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
   groups:
     ep-jsa_net_group:
       type: org.openecomp.groups.heat.HeatStack
index 7ace2d3..e44a435 100644 (file)
@@ -230,13 +230,15 @@ topology_template:
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     cmaui_volume2:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
   groups:
     ep-jsa_net_group:
       type: org.openecomp.groups.heat.HeatStack
index 810968f..16206a9 100644 (file)
@@ -247,25 +247,29 @@ topology_template:
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     cmaui_volume2:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     cmaui_volume3:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     cmaui_volume4:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     packet_mirror_network:
       type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
       properties:
index 808ff56..a3c6e38 100644 (file)
@@ -248,25 +248,29 @@ topology_template:
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     cmaui_volume2:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     cmaui_volume3:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     cmaui_volume4:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     packet_mirror_network:
       type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
       properties:
index 91eb314..4cc791a 100644 (file)
@@ -175,13 +175,15 @@ topology_template:
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     cmaui_volume2:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     packet_mirror_network:
       type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
       properties:
index bb7a1a5..2750a99 100644 (file)
@@ -176,13 +176,15 @@ topology_template:
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     cmaui_volume2:
       type: org.openecomp.resource.vfc.nodes.heat.cinder.Volume
       properties:
         volume_type:
           get_input: CMAUI_volume_type
-        size: '(get_input : cmaui_cinder_volume_size) * 1024'
+        size:
+          get_input: cmaui_cinder_volume_size
     packet_mirror_network:
       type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net
       properties:
index 44df0e1..0623b12 100644 (file)
@@ -1598,7 +1598,8 @@ topology_template:
           get_input: FSB_1_image
         volume_type:
           get_input: volume_type
-        size: '(get_input : volume_size) * 1024'
+        size:
+          get_input: volume_size
         name:
           get_input: FSB1_volume_name
     FSB1_OAM:
@@ -1631,7 +1632,8 @@ topology_template:
           get_input: FSB_2_image
         volume_type:
           get_input: volume_type
-        size: '(get_input : volume_size) * 1024'
+        size:
+          get_input: volume_size
         name:
           get_input: FSB2_volume_name
     Internal1-net:
index b8b6d8d..4cb511b 100644 (file)
@@ -34,7 +34,6 @@ public class PropertyTypeTest {
   @Test
   public void shouldReturnApproppriatePropertyTypeWhenDisplayNameExist() {
     String s = "scalar-unit.size";
-    Assert
-        .assertEquals(PropertyType.getPropertyTypeByDisplayName(s), PropertyType.SCALAR_UNIT_SIZE);
+    Assert.assertEquals(PropertyType.getPropertyTypeByDisplayName(s), PropertyType.SCALAR_UNIT_SIZE);
   }
 }