From ebcc45b8c8703cadc49cf3a0b888545845ccb9e6 Mon Sep 17 00:00:00 2001 From: Jozsef Csongvai Date: Tue, 21 Jan 2020 11:27:14 -0500 Subject: Eliminate Template Requirement Enables resource assignment without the use of a template. If no template is defined by the CBA, the default output is a kev-value map. If operation input: resolution-summary is set to true, output will be a list of ResolutionSummary. Issue-ID: CCSDK-2038 Change-Id: I5f6bcefcacec6e83cffac1134b13690b500a7563 Signed-off-by: Jozsef Csongvai --- .../resource/dict/ResourceDefinition.kt | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'ms/blueprintsprocessor/modules/blueprints/resource-dict') diff --git a/ms/blueprintsprocessor/modules/blueprints/resource-dict/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/resource/dict/ResourceDefinition.kt b/ms/blueprintsprocessor/modules/blueprints/resource-dict/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/resource/dict/ResourceDefinition.kt index 4ed98ddd0..f34099ea8 100644 --- a/ms/blueprintsprocessor/modules/blueprints/resource-dict/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/resource/dict/ResourceDefinition.kt +++ b/ms/blueprintsprocessor/modules/blueprints/resource-dict/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/resource/dict/ResourceDefinition.kt @@ -19,6 +19,7 @@ package org.onap.ccsdk.cds.controllerblueprints.resource.dict import com.fasterxml.jackson.annotation.JsonFormat import com.fasterxml.jackson.annotation.JsonProperty +import com.fasterxml.jackson.databind.JsonNode import org.onap.ccsdk.cds.controllerblueprints.core.data.NodeTemplate import org.onap.ccsdk.cds.controllerblueprints.core.data.PropertyDefinition import java.io.Serializable @@ -87,6 +88,9 @@ open class ResourceAssignment { @JsonProperty("updated-by") var updatedBy: String? = null + /** input & output key-mapping with their resolved values **/ + var keyIdentifiers: MutableList = mutableListOf() + override fun toString(): String { return """ [ @@ -101,6 +105,29 @@ open class ResourceAssignment { } } +data class KeyIdentifier(val name: String, val value: JsonNode) + +/** + * Data class for exposing summary of resource resolution + */ +data class ResolutionSummary( + val name: String, + val value: JsonNode?, + val required: Boolean?, + val type: String?, + @JsonProperty("key-identifiers") + val keyIdentifiers: MutableList, + @JsonProperty("dictionary-name") + val dictionaryName: String?, + @JsonProperty("request-payload") + val requestPayload: JsonNode?, + @JsonProperty("dictionary-source") + val dictionarySource: String?, + @JsonProperty("status") + val status: String?, + @JsonProperty("message") + val message: String? +) /** * Interface for Source Definitions (ex Input Source, * Default Source, Database Source, Rest Sources, etc) -- cgit 1.2.3-korg