From 6f7a427e53f4e129d84198f4c94036b4fe6b3898 Mon Sep 17 00:00:00 2001 From: tragait Date: Wed, 6 Nov 2019 11:44:11 +0000 Subject: CCSDK-1603:Changes in 'Config via netconf' BP to pull data from AAI This commit includes changes in blueprint for "Configuration over netconf", So that CDS can fetch data from AAI. It has enhancement in UAT test yaml file, so this blueprint can be tested. An enhancement is also included to introduce request headers in the source-rest. Change-Id: I4ff973538249925239b89da4c5720ec63ffe8037 Issue-ID: CCSDK-1603 Signed-off-by: tragait --- .../functions/resource/resolution/ResourceSourceProperties.kt | 2 ++ .../resource/resolution/processor/RestResourceResolutionProcessor.kt | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'ms/blueprintsprocessor/functions/resource-resolution/src') diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceSourceProperties.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceSourceProperties.kt index 604d4d40b..2a0e7a443 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceSourceProperties.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceSourceProperties.kt @@ -63,6 +63,8 @@ open class RestResourceSource : ResourceSourceProperties() { var inputKeyMapping: MutableMap? = null @get:JsonProperty("output-key-mapping") var outputKeyMapping: MutableMap? = null + @get:JsonProperty("headers") + var headers: Map = emptyMap() @get:JsonProperty("key-dependencies") lateinit var keyDependencies: MutableList } diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessor.kt index 2b9239f4c..e9aa2749a 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessor.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessor.kt @@ -83,10 +83,12 @@ open class RestResourceResolutionProcessor(private val blueprintRestLibPropertyS logger.info("RestResource ($dSource) dictionary information: " + "URL:($urlPath), input-key-mapping:($inputKeyMapping), output-key-mapping:(${sourceProperties.outputKeyMapping})") + val requestHeaders = sourceProperties.headers + logger.info("$dSource dictionary information : ($urlPath), ($inputKeyMapping), (${sourceProperties.outputKeyMapping})") // Get the Rest Client Service val restClientService = blueprintWebClientService(resourceAssignment, sourceProperties) - val response = restClientService.exchangeResource(verb, urlPath, payload) + val response = restClientService.exchangeResource(verb, urlPath, payload, requestHeaders.toMap()) val responseStatusCode = response.status val responseBody = response.body val outputKeyMapping = sourceProperties.outputKeyMapping -- cgit 1.2.3-korg