summaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/java/org/onap
diff options
context:
space:
mode:
authorEylon Malin <eylon.malin@intl.att.com>2019-08-07 20:12:00 +0300
committerEylon Malin <eylon.malin@intl.att.com>2019-08-07 20:12:00 +0300
commit34f413dcc03e5ca582b694463196b7e21ca72bf9 (patch)
tree2ea57a3ba8b2497c1ab4e809b92d1bc13acad08e /vid-app-common/src/main/java/org/onap
parent91ae6f75df40611e09b43bdb45476ea864e8e7fd (diff)
support more resource types in ServiceModelInflator
Issue-ID: VID-378 Signed-off-by: Eylon Malin <eylon.malin@intl.att.com> Change-Id: I80ce2b81202ea08491f65fc47390f826b2b02d20
Diffstat (limited to 'vid-app-common/src/main/java/org/onap')
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/asdc/parser/ServiceModelInflator.kt10
1 files changed, 10 insertions, 0 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/parser/ServiceModelInflator.kt b/vid-app-common/src/main/java/org/onap/vid/asdc/parser/ServiceModelInflator.kt
index f8cffabde..cdd2550a8 100644
--- a/vid-app-common/src/main/java/org/onap/vid/asdc/parser/ServiceModelInflator.kt
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/parser/ServiceModelInflator.kt
@@ -33,6 +33,8 @@ class ServiceModelInflator {
.plus(inflate(model.networks))
.plus(inflate(model.vnfs))
.plus(inflate(model.vnfGroups))
+ .plus(inflate(model.vrfs))
+ .plus(inflate(model.collectionResources))
}
private fun inflate(instances: Map<String, *>): Map<String, Names> {
@@ -45,6 +47,11 @@ class ServiceModelInflator {
.plus(inflate(vnf.volumeGroups))
}
+ private fun inflate(modelKey: String, cr: CR): Map<String, Names> {
+ return mapOf(cr.uuid to Names(null, modelKey))
+ .plus(inflate(cr.networksCollection))
+ }
+
private fun inflate(modelKey: String, instance: Any?): Map<String, Names> {
return when (instance) {
is Network -> mapOf(instance.uuid to Names(instance.modelCustomizationName, modelKey))
@@ -52,6 +59,9 @@ class ServiceModelInflator {
is VolumeGroup -> mapOf(instance.uuid to Names(instance.modelCustomizationName, modelKey))
is ResourceGroup -> mapOf(instance.uuid to Names(instance.modelCustomizationName, modelKey))
is VNF -> inflate(modelKey, instance)
+ is CR -> inflate(modelKey, instance)
+ is NetworkCollection -> mapOf(instance.uuid to Names(null, modelKey))
+ is Node -> mapOf(instance.uuid to Names(null, modelKey))
else -> {
// sink