diff options
author | Alexis de Talhouët <adetalhouet89@gmail.com> | 2019-08-09 16:24:39 -0400 |
---|---|---|
committer | Alexis de Talhouët <adetalhouet89@gmail.com> | 2019-08-12 12:16:09 +0000 |
commit | be528653236bb3adf3711070ddfcc3206951aa76 (patch) | |
tree | 81d6861b59460c3cebfc4d9757a1c626ccc168c9 /ms/blueprintsprocessor/functions | |
parent | 56f989b82d6065a8aad01b28469aed16f7663e5c (diff) |
Resource resolution should return a string
When being called by SDNC, expected response format is a String, not
a Json, then within SDNC we call jsonToTCtx by passing the String as
input.
When we receive the Json instead of a string, that function throw an
exception because it expects a String.
Also, SDNC marshall directly within the SLI context the Json object,
but the path isn't the one being looked for.
Finally, resource resolution, by its definition, as per as its model,
should set the returned value as a string, not a json.
Change-Id: Iffae3128507069c2546e179c17e50fb16e43f310
Issue-ID: CCSDK-1606
Signed-off-by: Alexis de Talhouët <adetalhouet89@gmail.com>
Diffstat (limited to 'ms/blueprintsprocessor/functions')
-rw-r--r-- | ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt index b9b710390..6514df249 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt @@ -45,7 +45,7 @@ interface ResourceResolutionService { resolutionKey: String): String suspend fun resolveResources(bluePrintRuntimeService: BluePrintRuntimeService<*>, nodeTemplateName: String, - artifactNames: List<String>, properties: Map<String, Any>): MutableMap<String, JsonNode> + artifactNames: List<String>, properties: Map<String, Any>): MutableMap<String, String> suspend fun resolveResources(bluePrintRuntimeService: BluePrintRuntimeService<*>, nodeTemplateName: String, artifactPrefix: String, properties: Map<String, Any>): String @@ -83,17 +83,17 @@ open class ResourceResolutionServiceImpl(private var applicationContext: Applica override suspend fun resolveResources(bluePrintRuntimeService: BluePrintRuntimeService<*>, nodeTemplateName: String, artifactNames: List<String>, - properties: Map<String, Any>): MutableMap<String, JsonNode> { + properties: Map<String, Any>): MutableMap<String, String> { val resourceAssignmentRuntimeService = ResourceAssignmentUtils.transformToRARuntimeService(bluePrintRuntimeService, artifactNames.toString()) - val resolvedParams: MutableMap<String, JsonNode> = hashMapOf() + val resolvedParams: MutableMap<String, String> = hashMapOf() artifactNames.forEach { artifactName -> val resolvedContent = resolveResources(resourceAssignmentRuntimeService, nodeTemplateName, artifactName, properties) - resolvedParams[artifactName] = resolvedContent.asJsonType() + resolvedParams[artifactName] = resolvedContent } return resolvedParams } |