diff options
author | Shnaider, Marina (ms7589) <ms7589@intl.att.com> | 2018-08-08 17:47:32 +0300 |
---|---|---|
committer | Avi Gaffa <avi.gaffa@amdocs.com> | 2018-08-12 07:19:36 +0000 |
commit | aa7e0f9134195fe89bb96b3971d7821df217ff32 (patch) | |
tree | ce20341ba1a32c839765bf5dfb072bb169a365ff /openecomp-be/lib/openecomp-tosca-lib/src/main | |
parent | c15ef65197789965734fb3aa90e9ea50bda05045 (diff) |
SRIOV for SDNF
Adding Fabric Configuration capability to the VFC/ compute
Change-Id: Ia518c56b75ec5355af94c28ac0b6bcfe11bc0d1e
Issue-ID: SDC-1601
Signed-off-by: Shnaider, Marina (ms7589) <ms7589@intl.att.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-tosca-lib/src/main')
2 files changed, 25 insertions, 1 deletions
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaCapabilityType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaCapabilityType.java index 9ef0a8de93..9037270000 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaCapabilityType.java +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaCapabilityType.java @@ -50,7 +50,6 @@ public class ToscaCapabilityType { public static final String METRIC_CEILOMETER = CAPABILITY_PREFIX + "metric.Ceilometer"; public static final String METRIC_SNMP_TRAP = CAPABILITY_PREFIX + "metric.SnmpTrap"; public static final String METRIC_SNMP_POLLING = CAPABILITY_PREFIX + "metric.SnmpPolling"; - public static final String FABRIC_CONFIGURATION = CAPABILITY_PREFIX + "FabricConfiguration"; } 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 ac2f5da44a..64b0006acd 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 @@ -215,6 +215,31 @@ public class DataModelUtil { if (MapUtils.isEmpty(nodeType.getCapabilities())) { nodeType.setCapabilities(new HashMap<>()); } + + for (Map.Entry<String, CapabilityDefinition> entry : capabilities.entrySet()) { + nodeType.getCapabilities().put(entry.getKey(), entry.getValue()); + } + } + + /** + * Set capabilities def to node type. + * + * @param nodeType the node type + * @param capabilities the capability definitions + */ + public static void setNodeTypeCapabilitiesDef(NodeType nodeType, Map<String, CapabilityDefinition> capabilities) { + if (MapUtils.isEmpty(capabilities) || capabilities.entrySet().isEmpty()) { + return; + } + + if (nodeType == null) { + throw new CoreException(new InvalidAddActionNullEntityErrorBuilder("Capability Definition", NODE_TYPE) + .build()); + } + + if (MapUtils.isEmpty(nodeType.getCapabilities())) { + nodeType.setCapabilities(new HashMap<>()); + } if (capabilities.size() > 0) { nodeType.setCapabilities(new HashMap<>()); } |