diff options
author | Pavel Aharoni <pa0916@att.com> | 2017-05-11 19:32:07 +0300 |
---|---|---|
committer | Pavel Aharoni <pa0916@att.com> | 2017-05-11 19:32:07 +0300 |
commit | 8caef088a9e5467cd0cb462acb217edceedac8fe (patch) | |
tree | e47c41688833daf2ac76e53324992be1f15d2e56 /sdc-tosca-parser/src/main/java/org/openecomp/sdc/tosca/parser/api/ISdcCsarHelper.java | |
parent | af2d8ef12f6b75ae837fffdeaf5d152756cec6d6 (diff) |
[SDC-19] VFC to CP props
Change-Id: I217934251fd8eeaf883b60161826306d6b7eaf3c
Signed-off-by: Pavel Aharoni <pa0916@att.com>
Diffstat (limited to 'sdc-tosca-parser/src/main/java/org/openecomp/sdc/tosca/parser/api/ISdcCsarHelper.java')
-rw-r--r-- | sdc-tosca-parser/src/main/java/org/openecomp/sdc/tosca/parser/api/ISdcCsarHelper.java | 57 |
1 files changed, 55 insertions, 2 deletions
diff --git a/sdc-tosca-parser/src/main/java/org/openecomp/sdc/tosca/parser/api/ISdcCsarHelper.java b/sdc-tosca-parser/src/main/java/org/openecomp/sdc/tosca/parser/api/ISdcCsarHelper.java index 7cc9022..e1c1802 100644 --- a/sdc-tosca-parser/src/main/java/org/openecomp/sdc/tosca/parser/api/ISdcCsarHelper.java +++ b/sdc-tosca-parser/src/main/java/org/openecomp/sdc/tosca/parser/api/ISdcCsarHelper.java @@ -20,6 +20,7 @@ package org.openecomp.sdc.tosca.parser.api; import java.util.List; +import java.util.Map; import org.apache.commons.lang3.tuple.Pair; import org.openecomp.sdc.toscaparser.api.Group; @@ -72,7 +73,33 @@ public interface ISdcCsarHelper { * @return the leaf value as String, or null if there's no such property, or it's not a leaf. */ public String getNodeTemplatePropertyLeafValue(NodeTemplate nodeTemplate, String pathToPropertyLeafValue); - + + /** + * Get any property leaf value for node template by full path separated by #.<br> + * For example, for node template with this property:<br><br> + * network_assignments:<br> + ecomp_generated_network_assignment: true<br> + is_shared_network: false<br> + is_external_network: false<br> + ipv4_subnet_default_assignments:<br> + use_ipv4: true<br> + ip_network_address_plan: 1.2.3.4<br> + dhcp_enabled: true<br> + ip_version: 4<br> + cidr_mask: 24<br> + min_subnets_count: 1<br> + ipv6_subnet_default_assignments:<br> + use_ipv6: false<br><br> + + * calling<br> + * getNodeTemplatePropertyLeafValue(nodeTemplate, "network_assignments#ipv6_subnet_default_assignments#use_ipv6")<br> + * will return "false". + * @param nodeTemplate - nodeTemplate where the property should be looked up. + * @param pathToPropertyLeafValue - the full path of the required property. + * @return the leaf value as Object, or null if there's no such property, or it's not a leaf. + */ + public Object getNodeTemplatePropertyAsObject(NodeTemplate nodeTemplate, String pathToPropertyLeafValue); + /** * Get any property leaf value for a group definition by full path separated by #. * Same logic as in {@link #getNodeTemplatePropertyLeafValue(NodeTemplate, String) getNodeTemplatePropertyLeafValue}, only for a group. @@ -82,6 +109,14 @@ public interface ISdcCsarHelper { */ public String getGroupPropertyLeafValue(Group group, String propertyName); + /** + * Get any property leaf value for a group definition by full path separated by #. + * Same logic as in {@link #getNodeTemplatePropertyLeafValue(NodeTemplate, String) getNodeTemplatePropertyLeafValue}, only for a group. + * @param group - group where the property should be looked up. + * @param propertyName - the name of the required property. + * @return the leaf value as Object, or null if there's no such property, or it's not a leaf. + */ + public Object getGroupPropertyAsObject(Group group, String propertyName); /** * Get all VL node templates of the CSAR service. @@ -133,7 +168,16 @@ public interface ISdcCsarHelper { * @return input leaf value for the service. */ public String getServiceInputLeafValueOfDefault(String inputLeafValuePath); - + + /** + * Get input leaf value for the CSAR service, by full path separated by #.<br> + * Same logic as in {@link #getNodeTemplatePropertyLeafValue(NodeTemplate, String) getNodeTemplatePropertyLeafValue}, only for an input full path. + * The expected format is "input_name#default[optionally #rest_of_path]" + * @param inputLeafValuePath by full path separated by #. + * @return input leaf value for the service as Service. + */ + public Object getServiceInputLeafValueOfDefaultAsObject(String inputLeafValuePath); + /** * Get the type name of the CSAR service's substitution mappings element.<br> * @@ -247,6 +291,15 @@ public interface ISdcCsarHelper { */ public List<Input> getServiceInputs(); + public String getConformanceLevel(); + + + /** + * Get the map of CP-related props from + * @param vfc - VFC to look for CP-related props. + * @return map of CP node template name to a map of CP-related properties key-value for this CP. + */ + public Map<String, Map<String, Object>> getCpPropertiesFromVfc(NodeTemplate vfc); } |