diff options
author | Jozsef Csongvai <jozsef.csongvai@bell.ca> | 2020-01-21 11:27:14 -0500 |
---|---|---|
committer | Jozsef Csongvai <jozsef.csongvai@bell.ca> | 2020-02-21 10:42:19 -0500 |
commit | ebcc45b8c8703cadc49cf3a0b888545845ccb9e6 (patch) | |
tree | 83ea2525f5eee56e47d6a2650677ee11eebf0e86 /ms/blueprintsprocessor/modules/blueprints/blueprint-core | |
parent | 9e3c594bc3cf74ab5748c14bcde81dec7f062fa0 (diff) |
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 <jozsef.csongvai@bell.ca>
Diffstat (limited to 'ms/blueprintsprocessor/modules/blueprints/blueprint-core')
3 files changed, 10 insertions, 9 deletions
diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/BluePrintConstants.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/BluePrintConstants.kt index 20aef3498..5002810c2 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/BluePrintConstants.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/BluePrintConstants.kt @@ -218,9 +218,6 @@ object BluePrintConstants { const val DEFAULT_STEP_OPERATION = "process" const val DEFAULT_STEP_INTERFACE = "ComponentInterface" - const val ARTIFACT_VELOCITY_TYPE_NAME = "artifact-template-velocity" - const val ARTIFACT_JINJA_TYPE_NAME = "artifact-template-jinja" - const val MODEL_TYPE_ARTIFACT_TEMPLATE_VELOCITY = "artifact-template-velocity" const val MODEL_TYPE_ARTIFACT_TEMPLATE_JINJA = "artifact-template-jinja" const val MODEL_TYPE_ARTIFACT_MAPPING_RESOURCE = "artifact-mapping-resource" diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintTemplateService.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintTemplateService.kt index db733bda1..51a6e10ee 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintTemplateService.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintTemplateService.kt @@ -40,7 +40,7 @@ class BluePrintTemplateService(private val bluePrintLoadConfiguration: BluePrint val template = bluePrintRuntimeService.resolveNodeTemplateArtifact(nodeTemplateName, artifactName) return when (templateType) { - BluePrintConstants.ARTIFACT_JINJA_TYPE_NAME -> { + BluePrintConstants.MODEL_TYPE_ARTIFACT_TEMPLATE_JINJA -> { BluePrintJinjaTemplateService.generateContent( template, jsonData, @@ -51,13 +51,13 @@ class BluePrintTemplateService(private val bluePrintLoadConfiguration: BluePrint bluePrintRuntimeService.bluePrintContext().version() ) } - BluePrintConstants.ARTIFACT_VELOCITY_TYPE_NAME -> { + BluePrintConstants.MODEL_TYPE_ARTIFACT_TEMPLATE_VELOCITY -> { BluePrintVelocityTemplateService.generateContent(template, jsonData, ignoreJsonNull, additionalContext) } else -> { throw BluePrintProcessorException( - "Unknown Artifact type, expecting ${BluePrintConstants.ARTIFACT_JINJA_TYPE_NAME}" + - "or ${BluePrintConstants.ARTIFACT_VELOCITY_TYPE_NAME}" + "Unknown Artifact type, expecting ${BluePrintConstants.MODEL_TYPE_ARTIFACT_TEMPLATE_JINJA}" + + "or ${BluePrintConstants.MODEL_TYPE_ARTIFACT_TEMPLATE_VELOCITY}" ) } } diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/JacksonUtils.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/JacksonUtils.kt index 3db1f84cd..573fc17d2 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/JacksonUtils.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/JacksonUtils.kt @@ -133,9 +133,13 @@ class JacksonUtils { return getJson(wrapperMap, pretty) } - fun getJson(any: kotlin.Any, pretty: Boolean = false): String { + fun getJson(any: kotlin.Any, pretty: Boolean = false, includeNull: Boolean = false): String { val objectMapper = jacksonObjectMapper() - objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL) + if (includeNull) { + objectMapper.setSerializationInclusion(JsonInclude.Include.ALWAYS) + } else { + objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL) + } if (pretty) { objectMapper.enable(SerializationFeature.INDENT_OUTPUT) } |