diff options
author | Jozsef Csongvai <jozsef.csongvai@bell.ca> | 2020-03-03 10:08:59 -0500 |
---|---|---|
committer | KAPIL SINGAL <ks220y@att.com> | 2020-03-03 17:26:58 +0000 |
commit | 2fce8bf2891f3ce472f4b06d09d0e987fbc44149 (patch) | |
tree | caae1d72abdf28e575ddc4f3dc923f189119b90d /ms/blueprintsprocessor/functions/resource-resolution/src/main | |
parent | d0e90690108b30b4571a61f987c0d8c7d52df5da (diff) |
Add properties to ResolutionSummary
Also wrapping ResolutionSummary response to ease integration with SDNC.
Issue-ID: CCSDK-2038
Signed-off-by: Jozsef Csongvai <jozsef.csongvai@bell.ca>
Change-Id: Ic1b8959e22ef795065d37664fb60f100af235a90
Diffstat (limited to 'ms/blueprintsprocessor/functions/resource-resolution/src/main')
-rw-r--r-- | ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtils.kt | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtils.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtils.kt index 6922192c6..7bb757b8e 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtils.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtils.kt @@ -42,6 +42,7 @@ import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeServ import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonReactorUtils import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.cds.controllerblueprints.core.utils.PropertyDefinitionUtils.Companion.hasLogProtect +import org.onap.ccsdk.cds.controllerblueprints.resource.dict.DictionaryMetadataEntry import org.onap.ccsdk.cds.controllerblueprints.resource.dict.KeyIdentifier import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResolutionSummary import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment @@ -203,15 +204,22 @@ class ResourceAssignmentUtils { resourceDefinitions: Map<String, ResourceDefinition> ): String { val resolutionSummaryList = resourceAssignments.map { - val payload = resourceDefinitions[it.name] - ?.sources?.get(it.dictionarySource)?.properties?.get("resolved-payload") + val definition = resourceDefinitions[it.name] + val payload = definition?.sources?.get(it.dictionarySource) + ?.properties?.get("resolved-payload") + val metadata = definition?.property?.metadata + ?.map { e -> DictionaryMetadataEntry(e.key, e.value) } + ?.toMutableList() ?: mutableListOf() + val description = definition?.property?.description ResolutionSummary( - it.name, it.property?.value, it.property?.required, - it.property?.type, it.keyIdentifiers, it.dictionaryName, - payload, it.dictionarySource, it.status, it.message + it.name, it.property?.value, it.property?.required, it.property?.type, + it.keyIdentifiers, description, metadata, it.dictionaryName, + it.dictionarySource, payload, it.status, it.message ) } - return JacksonUtils.getJson(resolutionSummaryList, includeNull = true) + // Wrapper needed for integration with SDNC + val data = mapOf("resolution-summary" to resolutionSummaryList) + return JacksonUtils.getJson(data, includeNull = true) } private fun useDefaultValueIfNull( |