summaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-tosca-lib/src/main/java
diff options
context:
space:
mode:
authortalio <tali.orenbach@amdocs.com>2017-10-02 13:54:55 +0300
committertalio <tali.orenbach@amdocs.com>2017-10-02 14:28:15 +0300
commit100491b13595ffeb8f847fc25b46192b607118af (patch)
tree33d7d93b64180c49ee83c0e6df12ae8293b06dc5 /openecomp-be/lib/openecomp-tosca-lib/src/main/java
parent9cee73a8b2a2ac82c57d100d5d3aebffec6d2f19 (diff)
Change node template prefix
Add "".compute" to nested compute node types in substitution service templates Issue - Id : SDC-425 Change-Id: I00902576a3adf8d0463ef1352961629663efd96c Signed-off-by: talio <tali.orenbach@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-tosca-lib/src/main/java')
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaNodeType.java2
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java17
2 files changed, 19 insertions, 0 deletions
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaNodeType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaNodeType.java
index 952a9cf9c9..411b7c0e07 100644
--- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaNodeType.java
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaNodeType.java
@@ -94,5 +94,7 @@ public class ToscaNodeType {
public static final String MULTIFLAVOR_VFC_NODE_TYPE = ABSTRACT_NODE_TYPE_PREFIX + "MultiFlavorVFC";
public static final String MULTIDEPLOYMENTFLAVOR_NODE_TYPE = ABSTRACT_NODE_TYPE_PREFIX
+ "MultiDeploymentFlavor.CVFC";
+ public static final String COMPUTE_TYPE_PREFIX = "org.openecomp.resource.vfc.compute.nodes.heat";
+ public static final String VFC_TYPE_PREFIX = "org.openecomp.resource.vfc.nodes.heat";
}
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java
index d223b5f01e..26596b994f 100644
--- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java
@@ -351,6 +351,23 @@ public class DataModelUtil {
mdcDataDebugMessage.debugExitMessage(null, null);
}
+ public static void removeNodeType(ServiceTemplate serviceTemplate,
+ String nodeTypeId){
+ if (serviceTemplate == null) {
+ MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB,
+ LoggerTragetServiceName.ADD_ENTITIES_TO_TOSCA, ErrorLevel.ERROR.name(),
+ LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_ADD_ACTION);
+ throw new CoreException(
+ new InvalidAddActionNullEntityErrorBuilder("Node Type", "Service Template").build());
+ }
+ if (serviceTemplate.getNode_types() == null) {
+ serviceTemplate.setNode_types(new HashMap<>());
+ }
+ serviceTemplate.getNode_types().remove(nodeTypeId);
+
+ mdcDataDebugMessage.debugExitMessage(null, null);
+ }
+
/**
* Add relationship template.
*