From 34f413dcc03e5ca582b694463196b7e21ca72bf9 Mon Sep 17 00:00:00 2001 From: Eylon Malin Date: Wed, 7 Aug 2019 20:12:00 +0300 Subject: support more resource types in ServiceModelInflator Issue-ID: VID-378 Signed-off-by: Eylon Malin Change-Id: I80ce2b81202ea08491f65fc47390f826b2b02d20 --- .../main/java/org/onap/vid/asdc/parser/ServiceModelInflator.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'vid-app-common/src/main') 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): Map { @@ -45,6 +47,11 @@ class ServiceModelInflator { .plus(inflate(vnf.volumeGroups)) } + private fun inflate(modelKey: String, cr: CR): Map { + return mapOf(cr.uuid to Names(null, modelKey)) + .plus(inflate(cr.networksCollection)) + } + private fun inflate(modelKey: String, instance: Any?): Map { 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 -- cgit 1.2.3-korg