summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions/resource-resolution
diff options
context:
space:
mode:
authortragait <rahul.tyagi@est.tech>2019-11-06 11:44:11 +0000
committertragait <rahul.tyagi@est.tech>2019-11-13 14:51:40 +0000
commit6f7a427e53f4e129d84198f4c94036b4fe6b3898 (patch)
tree87238feaa6262bd4c96a910cc0b3df38f0a7905d /ms/blueprintsprocessor/functions/resource-resolution
parent54eb2f2680d4f2447a4d48b612b2b83e37d90754 (diff)
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 <rahul.tyagi@est.tech>
Diffstat (limited to 'ms/blueprintsprocessor/functions/resource-resolution')
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceSourceProperties.kt2
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/RestResourceResolutionProcessor.kt4
2 files changed, 5 insertions, 1 deletions
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<String, String>? = null
@get:JsonProperty("output-key-mapping")
var outputKeyMapping: MutableMap<String, String>? = null
+ @get:JsonProperty("headers")
+ var headers: Map<String, String> = emptyMap()
@get:JsonProperty("key-dependencies")
lateinit var keyDependencies: MutableList<String>
}
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