diff options
Diffstat (limited to 'ms')
21 files changed, 235 insertions, 217 deletions
diff --git a/ms/blueprintsprocessor/application/src/main/docker/distribution.xml b/ms/blueprintsprocessor/application/src/main/docker/distribution.xml index 2ff3739df..aed417581 100755 --- a/ms/blueprintsprocessor/application/src/main/docker/distribution.xml +++ b/ms/blueprintsprocessor/application/src/main/docker/distribution.xml @@ -26,7 +26,7 @@ </formats> <dependencySets> <dependencySet> - <outputDirectory>/opt/app/onap/lib</outputDirectory> + <outputDirectory>opt/app/onap/lib</outputDirectory> <outputFileNameMapping>${artifact.groupId}-${artifact.artifactId}-${artifact.version}${dashClassifier?}.${artifact.extension}</outputFileNameMapping> <excludes> <exclude>org.slf4j:slf4j-simple</exclude> @@ -41,21 +41,24 @@ <include>application.properties</include> <include>logback.xml</include> </includes> - <outputDirectory>/opt/app/onap/config</outputDirectory> + <outputDirectory>opt/app/onap/config</outputDirectory> <useDefaultExcludes>true</useDefaultExcludes> </fileSet> <fileSet> <directory>${project.basedir}/../../../components/model-catalog</directory> - <outputDirectory>/opt/app/onap/model-catalog</outputDirectory> + <outputDirectory>opt/app/onap/model-catalog</outputDirectory> <includes> <include>blueprint-model/service-blueprint/**</include> <include>definition-type/starter-type/**</include> <include>resource-dictionary/starter-dictionary/**</include> </includes> + <excludes> + <exclude>**/target/**</exclude> + </excludes> </fileSet> <fileSet> <directory>${project.basedir}/../../../components/scripts/python</directory> - <outputDirectory>/opt/app/onap/scripts/jython</outputDirectory> + <outputDirectory>opt/app/onap/scripts/jython</outputDirectory> <useDefaultExcludes>true</useDefaultExcludes> </fileSet> </fileSets> diff --git a/ms/blueprintsprocessor/application/src/main/resources/application-dev.properties b/ms/blueprintsprocessor/application/src/main/resources/application-dev.properties index e177c18cf..e40ccba09 100755 --- a/ms/blueprintsprocessor/application/src/main/resources/application-dev.properties +++ b/ms/blueprintsprocessor/application/src/main/resources/application-dev.properties @@ -95,12 +95,6 @@ blueprints.processor.functions.python.executor.modulePaths=./../../../components # SDN-C's ODL Restconf Connection Details blueprintsprocessor.restconfEnabled=true -blueprintsprocessor.restclient.sdncodl.type=basic-auth -blueprintsprocessor.restclient.sdncodl.url=http://localhost:8282/ -blueprintsprocessor.restclient.sdncodl.username=admin -blueprintsprocessor.restclient.sdncodl.password=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U - -# Config Data REST client settings blueprintsprocessor.restclient.sdnc.type=basic-auth blueprintsprocessor.restclient.sdnc.url=http://sdnc:8282 blueprintsprocessor.restclient.sdnc.username=admin @@ -113,13 +107,13 @@ blueprintsprocessor.restclient.aai-data.username=aai@aai.onap.org blueprintsprocessor.restclient.aai-data.password=demo123456! # Executor Options -blueprintprocessor.resourceResolution.enabled=true -blueprintprocessor.netconfExecutor.enabled=true -blueprintprocessor.restConfExecutor.enabled=true +blueprintsprocessor.resourceResolution.enabled=true +blueprintsprocessor.netconfExecutor.enabled=true +blueprintsprocessor.restConfExecutor.enabled=true blueprintsprocessor.cliExecutor.enabled=true ### If enabling remote python executor, set this value to true -### blueprintprocessor.remoteScriptCommand.enabled=true -blueprintprocessor.remoteScriptCommand.enabled=false +### blueprintsprocessor.remoteScriptCommand.enabled=true +blueprintsprocessor.remoteScriptCommand.enabled=false # Kafka-message-lib Configurations blueprintsprocessor.messageconsumer.self-service-api.kafkaEnable=false diff --git a/ms/blueprintsprocessor/application/src/main/resources/application.properties b/ms/blueprintsprocessor/application/src/main/resources/application.properties index 6d8a4fa2b..1378c62c5 100755 --- a/ms/blueprintsprocessor/application/src/main/resources/application.properties +++ b/ms/blueprintsprocessor/application/src/main/resources/application.properties @@ -69,19 +69,12 @@ security.user.name: ccsdkapps endpoints.user.name=ccsdkapps endpoints.user.password=ccsdkapps -# SDN-C's ODL Restconf Connection Details -blueprintsprocessor.restconfEnabled=true -blueprintsprocessor.restclient.sdncodl.type=basic-auth -blueprintsprocessor.restclient.sdncodl.url=http://sdnc:8282/ -blueprintsprocessor.restclient.sdncodl.username=admin -blueprintsprocessor.restclient.sdncodl.password=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U - # Executor Options -blueprintprocessor.resourceResolution.enabled=true -blueprintprocessor.netconfExecutor.enabled=true -blueprintprocessor.restConfExecutor.enabled=true +blueprintsprocessor.resourceResolution.enabled=true +blueprintsprocessor.netconfExecutor.enabled=true +blueprintsprocessor.restConfExecutor.enabled=true blueprintsprocessor.cliExecutor.enabled=true -blueprintprocessor.remoteScriptCommand.enabled=true +blueprintsprocessor.remoteScriptCommand.enabled=true # Command executor blueprintsprocessor.grpcclient.remote-python.type=token-auth @@ -90,6 +83,7 @@ blueprintsprocessor.grpcclient.remote-python.port=50051 blueprintsprocessor.grpcclient.remote-python.token=Basic Y2NzZGthcHBzOmNjc2RrYXBwcw== # Config Data REST client settings +blueprintsprocessor.restconfEnabled=true blueprintsprocessor.restclient.sdnc.type=basic-auth blueprintsprocessor.restclient.sdnc.url=http://sdnc:8282 blueprintsprocessor.restclient.sdnc.username=admin diff --git a/ms/blueprintsprocessor/application/src/test/resources/application-test.properties b/ms/blueprintsprocessor/application/src/test/resources/application-test.properties index 74c8a2380..0f3457454 100644 --- a/ms/blueprintsprocessor/application/src/test/resources/application-test.properties +++ b/ms/blueprintsprocessor/application/src/test/resources/application-test.properties @@ -45,6 +45,6 @@ blueprints.processor.functions.python.executor.modulePaths=\ # Executor Options blueprintsprocessor.cliExecutor.enabled=true -blueprintprocessor.netconfExecutor.enabled=true +blueprintsprocessor.netconfExecutor.enabled=true blueprintsprocessor.restconfEnabled=true diff --git a/ms/blueprintsprocessor/application/src/test/resources/application.properties b/ms/blueprintsprocessor/application/src/test/resources/application.properties index d56e9582c..92d54f6f5 100644 --- a/ms/blueprintsprocessor/application/src/test/resources/application.properties +++ b/ms/blueprintsprocessor/application/src/test/resources/application.properties @@ -62,11 +62,11 @@ security.user.password:{bcrypt}$2a$10$duaUzVUVW0YPQCSIbGEkQOXwafZGwQ/b32/Ys4R1iw security.user.name:ccsdkapps # Executor Options -blueprintprocessor.resourceResolution.enabled=true -blueprintprocessor.netconfExecutor.enabled=true -blueprintprocessor.restConfExecutor.enabled=true +blueprintsprocessor.resourceResolution.enabled=true +blueprintsprocessor.netconfExecutor.enabled=true +blueprintsprocessor.restConfExecutor.enabled=true blueprintsprocessor.cliExecutor.enabled=true -blueprintprocessor.remoteScriptCommand.enabled=false +blueprintsprocessor.remoteScriptCommand.enabled=false # Kafka-message-lib Configuration diff --git a/ms/blueprintsprocessor/functions/ansible-awx-executor/src/test/resources/application-test.properties b/ms/blueprintsprocessor/functions/ansible-awx-executor/src/test/resources/application-test.properties index 2bbe31b3c..8b6bad230 100644 --- a/ms/blueprintsprocessor/functions/ansible-awx-executor/src/test/resources/application-test.properties +++ b/ms/blueprintsprocessor/functions/ansible-awx-executor/src/test/resources/application-test.properties @@ -32,4 +32,4 @@ blueprints.processor.functions.python.executor.executionPath=./../../../../compo blueprints.processor.functions.python.executor.modulePaths=./../../../../components/scripts/python/ccsdk_blueprints # Executor Options -blueprintprocessor.netconfExecutor.enabled=true +blueprintsprocessor.netconfExecutor.enabled=true diff --git a/ms/blueprintsprocessor/functions/config-snapshots/src/test/resources/application-test.properties b/ms/blueprintsprocessor/functions/config-snapshots/src/test/resources/application-test.properties index 74c478a2a..817b8c42f 100644 --- a/ms/blueprintsprocessor/functions/config-snapshots/src/test/resources/application-test.properties +++ b/ms/blueprintsprocessor/functions/config-snapshots/src/test/resources/application-test.properties @@ -29,4 +29,4 @@ blueprints.processor.functions.python.executor.executionPath=./../../../../compo blueprints.processor.functions.python.executor.modulePaths=./../../../../components/scripts/python/ccsdk_blueprints # Executor Options -blueprintprocessor.netconfExecutor.enabled=true +blueprintsprocessor.netconfExecutor.enabled=true diff --git a/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/NetconfExecutorConfiguration.kt b/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/NetconfExecutorConfiguration.kt index 77a2d3ba9..214969346 100644 --- a/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/NetconfExecutorConfiguration.kt +++ b/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/NetconfExecutorConfiguration.kt @@ -24,5 +24,5 @@ import org.springframework.context.annotation.Configuration @Configuration @ComponentScan @EnableConfigurationProperties -@ConditionalOnProperty(name = ["blueprintprocessor.netconfExecutor.enabled"], havingValue = "true") +@ConditionalOnProperty(name = ["blueprintsprocessor.netconfExecutor.enabled"], havingValue = "true") open class NetconfExecutorConfiguration
\ No newline at end of file diff --git a/ms/blueprintsprocessor/functions/netconf-executor/src/test/resources/application-test.properties b/ms/blueprintsprocessor/functions/netconf-executor/src/test/resources/application-test.properties index 2bbe31b3c..8b6bad230 100644 --- a/ms/blueprintsprocessor/functions/netconf-executor/src/test/resources/application-test.properties +++ b/ms/blueprintsprocessor/functions/netconf-executor/src/test/resources/application-test.properties @@ -32,4 +32,4 @@ blueprints.processor.functions.python.executor.executionPath=./../../../../compo blueprints.processor.functions.python.executor.modulePaths=./../../../../components/scripts/python/ccsdk_blueprints # Executor Options -blueprintprocessor.netconfExecutor.enabled=true +blueprintsprocessor.netconfExecutor.enabled=true 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 a23036aaf..ca623aa3b 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 @@ -229,7 +229,7 @@ open class ResourceResolutionServiceImpl(private var applicationContext: Applica blueprintRuntimeService, artifactPrefix, resourceAssignment) - log.info("Resource resolution saved into database successfully : ($resourceAssignment)") + log.info("Resource resolution saved into database successfully : (${resourceAssignment.name})") } // Set errors from RA diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceAssignmentProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceAssignmentProcessor.kt index 2120449ab..0f5d91415 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceAssignmentProcessor.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/DatabaseResourceAssignmentProcessor.kt @@ -91,7 +91,8 @@ open class DatabaseResourceAssignmentProcessor( "failed to get input-key-mappings for $dName under $dSource properties" } - logger.info("$dSource dictionary information : ($sql), ($inputKeyMapping), (${sourceProperties.outputKeyMapping})") + logger.info("DatabaseResource ($dSource) dictionary information: " + + "Query:($sql), input-key-mapping:($inputKeyMapping), output-key-mapping:(${sourceProperties.outputKeyMapping})") val jdbcTemplate = blueprintDBLibService(sourceProperties) val rows = jdbcTemplate.query(sql, populateNamedParameter(inputKeyMapping)) diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/ResourceAssignmentProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/ResourceAssignmentProcessor.kt index c4c308efb..e513170a8 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/ResourceAssignmentProcessor.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/ResourceAssignmentProcessor.kt @@ -52,6 +52,8 @@ abstract class ResourceAssignmentProcessor : BlueprintFunctionNode<ResourceAssig try { val value = raRuntimeService.getInputValue(resourceAssignment.name) if (!value.isNullOrMissing()) { + log.debug("For Resource:(${resourceAssignment.name}) found value:({}) in input-data.", + ResourceAssignmentUtils.getValueToLog(resourceAssignment.property?.metadata, value)) ResourceAssignmentUtils.setResourceDataValue(resourceAssignment, raRuntimeService, value) return true } 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 70da462c4..2b9239f4c 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 @@ -81,7 +81,8 @@ open class RestResourceResolutionProcessor(private val blueprintRestLibPropertyS resolveFromInputKeyMapping(checkNotNull(sourceProperties.urlPath), resolvedInputKeyMapping) val verb = resolveFromInputKeyMapping(nullToEmpty(sourceProperties.verb), resolvedInputKeyMapping) - logger.info("$dSource dictionary information : ($urlPath), ($inputKeyMapping), (${sourceProperties.outputKeyMapping})") + logger.info("RestResource ($dSource) dictionary information: " + + "URL:($urlPath), input-key-mapping:($inputKeyMapping), output-key-mapping:(${sourceProperties.outputKeyMapping})") // Get the Rest Client Service val restClientService = blueprintWebClientService(resourceAssignment, sourceProperties) diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockRestResourceResolutionProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockRestResourceResolutionProcessor.kt index 203b7ea30..e5b559826 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockRestResourceResolutionProcessor.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/mock/MockRestResourceResolutionProcessor.kt @@ -77,7 +77,8 @@ class MockRestResourceResolutionProcessor(private val blueprintRestLibPropertySe resolveFromInputKeyMapping(checkNotNull(sourceProperties.urlPath), resolvedInputKeyMapping) val verb = resolveFromInputKeyMapping(nullToEmpty(sourceProperties.verb), resolvedInputKeyMapping) - logger.info("$dSource dictionary information : ($urlPath), ($inputKeyMapping), (${sourceProperties.outputKeyMapping})") + logger.info("MockRestResource ($dSource) dictionary information: " + + "URL:($urlPath), input-key-mapping:($inputKeyMapping), output-key-mapping:(${sourceProperties.outputKeyMapping})") // Get the Rest Client Service val restClientService = blueprintWebClientService(executionRequest) diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtilsTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtilsTest.kt index 728e1165a..d7a696848 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtilsTest.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtilsTest.kt @@ -131,7 +131,7 @@ class ResourceAssignmentUtilsTest { //then the assignment should produce a valid result val expected = "{\n" + " \"pnf-id\" : \"valid_value\"\n" + "}" - assertEquals(expected, outcome, "unexpected outcome generated") + assertEquals(expected, outcome.replace("\r\n","\n"), "unexpected outcome generated") } @Test @@ -147,7 +147,7 @@ class ResourceAssignmentUtilsTest { //then the assignment should produce a valid result val expected = "{\n" + " \"pnf-id\" : \"\${pnf-id}\"\n" + "}" - assertEquals(expected, outcome, "unexpected outcome generated") + assertEquals(expected, outcome.replace("\r\n","\n"), "unexpected outcome generated") } diff --git a/ms/command-executor/src/main/docker/distribution.xml b/ms/command-executor/src/main/docker/distribution.xml index 1a714b8a7..7a16062cb 100755 --- a/ms/command-executor/src/main/docker/distribution.xml +++ b/ms/command-executor/src/main/docker/distribution.xml @@ -25,7 +25,7 @@ <fileSets> <fileSet> <directory>${project.basedir}/src/main/python</directory> - <outputDirectory>/opt/app/onap/python</outputDirectory> + <outputDirectory>opt/app/onap/python</outputDirectory> </fileSet> </fileSets> </assembly>
\ No newline at end of file diff --git a/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintRuntimeService.kt b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintRuntimeService.kt index ba210df10..f7b512153 100644 --- a/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintRuntimeService.kt +++ b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintRuntimeService.kt @@ -62,9 +62,11 @@ interface BluePrintRuntimeService<T> { fun loadEnvironments(type: String, fileName: String) - fun resolveNodeTemplatePropertyAssignments(nodeTemplateName: String, - propertyDefinitions: MutableMap<String, PropertyDefinition>, - propertyAssignments: MutableMap<String, JsonNode>): MutableMap<String, JsonNode> + fun resolveNodeTemplatePropertyAssignments( + nodeTemplateName: String, + propertyDefinitions: MutableMap<String, PropertyDefinition>, + propertyAssignments: MutableMap<String, JsonNode> + ): MutableMap<String, JsonNode> fun resolvePropertyDefinitions(name: String, propertyDefinitions: MutableMap<String, PropertyDefinition>) : MutableMap<String, JsonNode> @@ -77,11 +79,15 @@ interface BluePrintRuntimeService<T> { fun resolveNodeTemplateCapabilityProperties(nodeTemplateName: String, capabilityName: String): MutableMap<String, JsonNode> - fun resolveNodeTemplateInterfaceOperationInputs(nodeTemplateName: String, interfaceName: String, - operationName: String): MutableMap<String, JsonNode> + fun resolveNodeTemplateInterfaceOperationInputs( + nodeTemplateName: String, interfaceName: String, + operationName: String + ): MutableMap<String, JsonNode> - fun resolveNodeTemplateInterfaceOperationOutputs(nodeTemplateName: String, interfaceName: String, - operationName: String): MutableMap<String, JsonNode> + fun resolveNodeTemplateInterfaceOperationOutputs( + nodeTemplateName: String, interfaceName: String, + operationName: String + ): MutableMap<String, JsonNode> fun resolveNodeTemplateArtifact(nodeTemplateName: String, artifactName: String): String @@ -89,28 +95,38 @@ interface BluePrintRuntimeService<T> { fun resolveDSLExpression(dslPropertyName: String): JsonNode - fun setInputValue(propertyName: String, propertyDefinition: PropertyDefinition, value: JsonNode) + fun setInputValue(propertyName: String, value: JsonNode) - fun setWorkflowInputValue(workflowName: String, propertyName: String, propertyDefinition: PropertyDefinition, - value: JsonNode) + fun setWorkflowInputValue( + workflowName: String, propertyName: String, propertyDefinition: PropertyDefinition, + value: JsonNode + ) fun setNodeTemplatePropertyValue(nodeTemplateName: String, propertyName: String, value: JsonNode) fun setNodeTemplateAttributeValue(nodeTemplateName: String, attributeName: String, value: JsonNode) - fun setNodeTemplateOperationPropertyValue(nodeTemplateName: String, interfaceName: String, - operationName: String, propertyName: String, value: JsonNode) + fun setNodeTemplateOperationPropertyValue( + nodeTemplateName: String, interfaceName: String, + operationName: String, propertyName: String, value: JsonNode + ) - fun setNodeTemplateOperationInputValue(nodeTemplateName: String, interfaceName: String, - operationName: String, propertyName: String, value: JsonNode) + fun setNodeTemplateOperationInputValue( + nodeTemplateName: String, interfaceName: String, + operationName: String, propertyName: String, value: JsonNode + ) - fun setNodeTemplateOperationOutputValue(nodeTemplateName: String, interfaceName: String, - operationName: String, propertyName: String, value: JsonNode) + fun setNodeTemplateOperationOutputValue( + nodeTemplateName: String, interfaceName: String, + operationName: String, propertyName: String, value: JsonNode + ) fun getInputValue(propertyName: String): JsonNode - fun getNodeTemplateOperationOutputValue(nodeTemplateName: String, interfaceName: String, - operationName: String, propertyName: String): JsonNode + fun getNodeTemplateOperationOutputValue( + nodeTemplateName: String, interfaceName: String, + operationName: String, propertyName: String + ): JsonNode fun getNodeTemplatePropertyValue(nodeTemplateName: String, propertyName: String): JsonNode? @@ -130,8 +146,8 @@ interface BluePrintRuntimeService<T> { * * @author Brinda Santh */ -open class DefaultBluePrintRuntimeService(private var id: String, private var bluePrintContext: BluePrintContext) - : BluePrintRuntimeService<MutableMap<String, JsonNode>> { +open class DefaultBluePrintRuntimeService(private var id: String, private var bluePrintContext: BluePrintContext) : + BluePrintRuntimeService<MutableMap<String, JsonNode>> { @Transient private val log = LoggerFactory.getLogger(BluePrintRuntimeService::class.toString()) @@ -145,7 +161,7 @@ open class DefaultBluePrintRuntimeService(private var id: String, private var bl * Load Blueprint Environments Properties */ val absoluteEnvFilePath = bluePrintContext.rootPath.plus(File.separator) - .plus(BluePrintConstants.TOSCA_ENVIRONMENTS_DIR) + .plus(BluePrintConstants.TOSCA_ENVIRONMENTS_DIR) loadEnvironments(BluePrintConstants.PROPERTY_BPP, absoluteEnvFilePath) } @@ -220,9 +236,11 @@ open class DefaultBluePrintRuntimeService(private var id: String, private var bl /** * Resolve any property assignments for the node */ - override fun resolveNodeTemplatePropertyAssignments(nodeTemplateName: String, - propertyDefinitions: MutableMap<String, PropertyDefinition>, - propertyAssignments: MutableMap<String, JsonNode>) + override fun resolveNodeTemplatePropertyAssignments( + nodeTemplateName: String, + propertyDefinitions: MutableMap<String, PropertyDefinition>, + propertyAssignments: MutableMap<String, JsonNode> + ) : MutableMap<String, JsonNode> { val propertyAssignmentValue: MutableMap<String, JsonNode> = hashMapOf() @@ -235,8 +253,8 @@ open class DefaultBluePrintRuntimeService(private var id: String, private var bl if (propertyAssignment != null) { // Resolve the Expressing val propertyAssignmentExpression = PropertyAssignmentService(this) - resolvedValue = propertyAssignmentExpression.resolveAssignmentExpression(nodeTemplateName, - nodeTypePropertyName, propertyAssignment) + resolvedValue = propertyAssignmentExpression.resolveAssignmentExpression( + nodeTemplateName, nodeTypePropertyName, propertyAssignment) } // Set default value if null @@ -258,8 +276,8 @@ open class DefaultBluePrintRuntimeService(private var id: String, private var bl val propertyAssignmentExpression = PropertyAssignmentService(this) val expression = propertyDefinition.value ?: propertyDefinition.defaultValue if (expression != null) { - propertyAssignmentValue[propertyName] = propertyAssignmentExpression.resolveAssignmentExpression(name, - propertyName, expression) + propertyAssignmentValue[propertyName] = + propertyAssignmentExpression.resolveAssignmentExpression(name, propertyName, expression) } } return propertyAssignmentValue @@ -267,13 +285,12 @@ open class DefaultBluePrintRuntimeService(private var id: String, private var bl override fun resolvePropertyAssignments(name: String, propertyAssignments: MutableMap<String, JsonNode>) : MutableMap<String, JsonNode> { - val propertyAssignmentValue: MutableMap<String, JsonNode> = hashMapOf() - propertyAssignments.forEach { propertyName, propertyExpression -> + propertyAssignments.forEach { (propertyName, propertyExpression) -> val propertyAssignmentExpression = PropertyAssignmentService(this) - propertyAssignmentValue[propertyName] = propertyAssignmentExpression.resolveAssignmentExpression(name, - propertyName, propertyExpression) + propertyAssignmentValue[propertyName] = + propertyAssignmentExpression.resolveAssignmentExpression(name, propertyName, propertyExpression) } return propertyAssignmentValue } @@ -286,84 +303,86 @@ open class DefaultBluePrintRuntimeService(private var id: String, private var bl val propertyAssignments: MutableMap<String, JsonNode> = nodeTemplate.properties!! // Get the Node Type Definitions - val nodeTypePropertieDefinitions: MutableMap<String, PropertyDefinition> = bluePrintContext - .nodeTypeChainedProperties(nodeTemplate.type)!! + val nodeTypePropertiesDefinitions: MutableMap<String, PropertyDefinition> = bluePrintContext + .nodeTypeChainedProperties(nodeTemplate.type)!! /** * Resolve the NodeTemplate Property Assignment Values. */ - return resolveNodeTemplatePropertyAssignments(nodeTemplateName, nodeTypePropertieDefinitions, - propertyAssignments) + return resolveNodeTemplatePropertyAssignments(nodeTemplateName, nodeTypePropertiesDefinitions, propertyAssignments) } override fun resolveNodeTemplateCapabilityProperties(nodeTemplateName: String, capabilityName: String): MutableMap<String, JsonNode> { - log.info("resolveNodeTemplateCapabilityProperties for node template($nodeTemplateName) capability " + - "($capabilityName)") + log.info("resolveNodeTemplateCapabilityProperties for node template($nodeTemplateName) capability($capabilityName)") val nodeTemplate: NodeTemplate = bluePrintContext.nodeTemplateByName(nodeTemplateName) val propertyAssignments = nodeTemplate.capabilities?.get(capabilityName)?.properties ?: hashMapOf() val propertyDefinitions = bluePrintContext.nodeTemplateNodeType(nodeTemplateName) - .capabilities?.get(capabilityName)?.properties ?: hashMapOf() + .capabilities?.get(capabilityName)?.properties ?: hashMapOf() /** * Resolve the Capability Property Assignment Values. */ - return resolveNodeTemplatePropertyAssignments(nodeTemplateName, propertyDefinitions, - propertyAssignments) + return resolveNodeTemplatePropertyAssignments(nodeTemplateName, propertyDefinitions, propertyAssignments) } - override fun resolveNodeTemplateInterfaceOperationInputs(nodeTemplateName: String, - interfaceName: String, - operationName: String): MutableMap<String, JsonNode> { - log.info("resolveNodeTemplateInterfaceOperationInputs for node template ($nodeTemplateName),interface name " + - "($interfaceName), operationName($operationName)") + override fun resolveNodeTemplateInterfaceOperationInputs( + nodeTemplateName: String, + interfaceName: String, + operationName: String + ): MutableMap<String, JsonNode> { + log.info("resolveNodeTemplateInterfaceOperationInputs for node template ($nodeTemplateName), " + + "interface name($interfaceName), operationName($operationName)") val propertyAssignments: MutableMap<String, JsonNode> = - bluePrintContext.nodeTemplateInterfaceOperationInputs(nodeTemplateName, interfaceName, operationName) - ?: hashMapOf() + bluePrintContext.nodeTemplateInterfaceOperationInputs(nodeTemplateName, interfaceName, operationName) + ?: hashMapOf() val nodeTypeName = bluePrintContext.nodeTemplateByName(nodeTemplateName).type val nodeTypeInterfaceOperationInputs: MutableMap<String, PropertyDefinition> = - bluePrintContext.nodeTypeInterfaceOperationInputs(nodeTypeName, interfaceName, operationName) - ?: hashMapOf() + bluePrintContext.nodeTypeInterfaceOperationInputs(nodeTypeName, interfaceName, operationName) + ?: hashMapOf() log.info("input definition for node template ($nodeTemplateName), values ($propertyAssignments)") /** * Resolve the Property Input Assignment Values. */ - return resolveNodeTemplatePropertyAssignments(nodeTemplateName, nodeTypeInterfaceOperationInputs, - propertyAssignments) + return resolveNodeTemplatePropertyAssignments(nodeTemplateName, nodeTypeInterfaceOperationInputs, propertyAssignments) } - override fun resolveNodeTemplateInterfaceOperationOutputs(nodeTemplateName: String, - interfaceName: String, - operationName: String): MutableMap<String, JsonNode> { - log.info("resolveNodeTemplateInterfaceOperationOutputs for node template ($nodeTemplateName),interface name " + - "($interfaceName), operationName($operationName)") + override fun resolveNodeTemplateInterfaceOperationOutputs( + nodeTemplateName: String, + interfaceName: String, + operationName: String + ): MutableMap<String, JsonNode> { + log.info( + "resolveNodeTemplateInterfaceOperationOutputs for node template ($nodeTemplateName),interface name " + + "($interfaceName), operationName($operationName)" + ) val propertyAssignments: MutableMap<String, JsonNode> = - bluePrintContext.nodeTemplateInterfaceOperationOutputs(nodeTemplateName, interfaceName, operationName) - ?: hashMapOf() + bluePrintContext.nodeTemplateInterfaceOperationOutputs(nodeTemplateName, interfaceName, operationName) + ?: hashMapOf() val nodeTypeName = bluePrintContext.nodeTemplateByName(nodeTemplateName).type val nodeTypeInterfaceOperationOutputs: MutableMap<String, PropertyDefinition> = - bluePrintContext.nodeTypeInterfaceOperationOutputs(nodeTypeName, interfaceName, operationName) - ?: hashMapOf() + bluePrintContext.nodeTypeInterfaceOperationOutputs(nodeTypeName, interfaceName, operationName) + ?: hashMapOf() /** * Resolve the Property Output Assignment Values. */ - val propertyAssignmentValue = resolveNodeTemplatePropertyAssignments(nodeTemplateName, - nodeTypeInterfaceOperationOutputs, propertyAssignments) + val propertyAssignmentValue = + resolveNodeTemplatePropertyAssignments(nodeTemplateName,nodeTypeInterfaceOperationOutputs, propertyAssignments) // Store operation output values into context - propertyAssignmentValue.forEach { key, value -> + propertyAssignmentValue.forEach { (key, value) -> setNodeTemplateOperationOutputValue(nodeTemplateName, interfaceName, operationName, key, value) } return propertyAssignmentValue @@ -371,19 +390,20 @@ open class DefaultBluePrintRuntimeService(private var id: String, private var bl override fun resolveNodeTemplateArtifact(nodeTemplateName: String, artifactName: String): String { val artifactDefinition: ArtifactDefinition = - resolveNodeTemplateArtifactDefinition(nodeTemplateName, artifactName) + resolveNodeTemplateArtifactDefinition(nodeTemplateName, artifactName) val propertyAssignmentExpression = PropertyAssignmentService(this) return propertyAssignmentExpression.artifactContent(artifactDefinition) } - override fun resolveNodeTemplateArtifactDefinition(nodeTemplateName: String, - artifactName: String): ArtifactDefinition { + override fun resolveNodeTemplateArtifactDefinition( + nodeTemplateName: String, + artifactName: String + ): ArtifactDefinition { val nodeTemplate = bluePrintContext.nodeTemplateByName(nodeTemplateName) return nodeTemplate.artifacts?.get(artifactName) - ?: throw BluePrintProcessorException("failed to get artifact definition($artifactName) from the node " + - "template") - + ?: throw BluePrintProcessorException( + "failed to get artifact definition($artifactName) from the node template") } /** @@ -393,14 +413,14 @@ open class DefaultBluePrintRuntimeService(private var id: String, private var bl override fun resolveDSLExpression(dslPropertyName: String): JsonNode { val propertyAssignments = bluePrintContext.dslPropertiesByName(dslPropertyName) return if (BluePrintExpressionService.checkContainsExpression(propertyAssignments) - && propertyAssignments is ObjectNode) { + && propertyAssignments is ObjectNode) { val rootKeyMap = propertyAssignments.rootFieldsToMap() val propertyAssignmentValue: MutableMap<String, JsonNode> = hashMapOf() - rootKeyMap.forEach { propertyName, propertyValue -> + rootKeyMap.forEach { (propertyName, propertyValue) -> val propertyAssignmentExpression = PropertyAssignmentService(this) propertyAssignmentValue[propertyName] = propertyAssignmentExpression - .resolveAssignmentExpression("DSL", propertyName, propertyValue) + .resolveAssignmentExpression("DSL", propertyName, propertyValue) } propertyAssignmentValue.asJsonNode() } else { @@ -408,120 +428,127 @@ open class DefaultBluePrintRuntimeService(private var id: String, private var bl } } - override fun setInputValue(propertyName: String, propertyDefinition: PropertyDefinition, value: JsonNode) { - val path = StringBuilder(BluePrintConstants.PATH_INPUTS) - .append(BluePrintConstants.PATH_DIVIDER).append(propertyName).toString() + override fun setInputValue(propertyName: String, value: JsonNode) { + val path = """${BluePrintConstants.PATH_INPUTS}${BluePrintConstants.PATH_DIVIDER}${propertyName}""" log.trace("setting input path ({}), values ({})", path, value) put(path, value) } - override fun setWorkflowInputValue(workflowName: String, propertyName: String, - propertyDefinition: PropertyDefinition, value: JsonNode) { + override fun setWorkflowInputValue( + workflowName: String, propertyName: String, + propertyDefinition: PropertyDefinition, value: JsonNode + ) { val path: String = StringBuilder(BluePrintConstants.PATH_NODE_WORKFLOWS) - .append(BluePrintConstants.PATH_DIVIDER).append(workflowName) - .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_INPUTS) - .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_PROPERTIES) - .append(BluePrintConstants.PATH_DIVIDER).append(propertyName).toString() + .append(BluePrintConstants.PATH_DIVIDER).append(workflowName) + .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_INPUTS) + .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_PROPERTIES) + .append(BluePrintConstants.PATH_DIVIDER).append(propertyName).toString() put(path, value) } override fun setNodeTemplatePropertyValue(nodeTemplateName: String, propertyName: String, value: JsonNode) { - val path: String = StringBuilder(BluePrintConstants.PATH_NODE_TEMPLATES) - .append(BluePrintConstants.PATH_DIVIDER).append(nodeTemplateName) - .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_PROPERTIES) - .append(BluePrintConstants.PATH_DIVIDER).append(propertyName).toString() + .append(BluePrintConstants.PATH_DIVIDER).append(nodeTemplateName) + .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_PROPERTIES) + .append(BluePrintConstants.PATH_DIVIDER).append(propertyName).toString() put(path, value) } override fun setNodeTemplateAttributeValue(nodeTemplateName: String, attributeName: String, value: JsonNode) { - val path: String = StringBuilder(BluePrintConstants.PATH_NODE_TEMPLATES) - .append(BluePrintConstants.PATH_DIVIDER).append(nodeTemplateName) - .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_ATTRIBUTES) - .append(BluePrintConstants.PATH_DIVIDER).append(attributeName).toString() + .append(BluePrintConstants.PATH_DIVIDER).append(nodeTemplateName) + .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_ATTRIBUTES) + .append(BluePrintConstants.PATH_DIVIDER).append(attributeName).toString() put(path, value) } - override fun setNodeTemplateOperationPropertyValue(nodeTemplateName: String, interfaceName: String, - operationName: String, propertyName: String, - value: JsonNode) { + override fun setNodeTemplateOperationPropertyValue( + nodeTemplateName: String, interfaceName: String, + operationName: String, propertyName: String, + value: JsonNode + ) { val path: String = StringBuilder(BluePrintConstants.PATH_NODE_TEMPLATES) - .append(BluePrintConstants.PATH_DIVIDER).append(nodeTemplateName) - .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_INTERFACES) - .append(BluePrintConstants.PATH_DIVIDER).append(interfaceName) - .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_OPERATIONS) - .append(BluePrintConstants.PATH_DIVIDER).append(operationName) - .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_PROPERTIES) - .append(BluePrintConstants.PATH_DIVIDER).append(propertyName).toString() + .append(BluePrintConstants.PATH_DIVIDER).append(nodeTemplateName) + .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_INTERFACES) + .append(BluePrintConstants.PATH_DIVIDER).append(interfaceName) + .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_OPERATIONS) + .append(BluePrintConstants.PATH_DIVIDER).append(operationName) + .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_PROPERTIES) + .append(BluePrintConstants.PATH_DIVIDER).append(propertyName).toString() log.trace("setting operation property path ({}), values ({})", path, value) put(path, value) } - override fun setNodeTemplateOperationInputValue(nodeTemplateName: String, interfaceName: String, - operationName: String, propertyName: String, - value: JsonNode) { + override fun setNodeTemplateOperationInputValue( + nodeTemplateName: String, interfaceName: String, + operationName: String, propertyName: String, + value: JsonNode + ) { val path: String = StringBuilder(BluePrintConstants.PATH_NODE_TEMPLATES) - .append(BluePrintConstants.PATH_DIVIDER).append(nodeTemplateName) - .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_INTERFACES) - .append(BluePrintConstants.PATH_DIVIDER).append(interfaceName) - .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_OPERATIONS) - .append(BluePrintConstants.PATH_DIVIDER).append(operationName) - .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_INPUTS) - .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_PROPERTIES) - .append(BluePrintConstants.PATH_DIVIDER).append(propertyName).toString() + .append(BluePrintConstants.PATH_DIVIDER).append(nodeTemplateName) + .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_INTERFACES) + .append(BluePrintConstants.PATH_DIVIDER).append(interfaceName) + .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_OPERATIONS) + .append(BluePrintConstants.PATH_DIVIDER).append(operationName) + .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_INPUTS) + .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_PROPERTIES) + .append(BluePrintConstants.PATH_DIVIDER).append(propertyName).toString() put(path, value) } - override fun setNodeTemplateOperationOutputValue(nodeTemplateName: String, interfaceName: String, - operationName: String, propertyName: String, - value: JsonNode) { + override fun setNodeTemplateOperationOutputValue( + nodeTemplateName: String, interfaceName: String, + operationName: String, propertyName: String, + value: JsonNode + ) { val path: String = StringBuilder(BluePrintConstants.PATH_NODE_TEMPLATES) - .append(BluePrintConstants.PATH_DIVIDER).append(nodeTemplateName) - .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_INTERFACES) - .append(BluePrintConstants.PATH_DIVIDER).append(interfaceName) - .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_OPERATIONS) - .append(BluePrintConstants.PATH_DIVIDER).append(operationName) - .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_OUTPUTS) - .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_PROPERTIES) - .append(BluePrintConstants.PATH_DIVIDER).append(propertyName).toString() + .append(BluePrintConstants.PATH_DIVIDER).append(nodeTemplateName) + .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_INTERFACES) + .append(BluePrintConstants.PATH_DIVIDER).append(interfaceName) + .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_OPERATIONS) + .append(BluePrintConstants.PATH_DIVIDER).append(operationName) + .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_OUTPUTS) + .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_PROPERTIES) + .append(BluePrintConstants.PATH_DIVIDER).append(propertyName).toString() put(path, value) } override fun getInputValue(propertyName: String): JsonNode { val path = StringBuilder(BluePrintConstants.PATH_INPUTS) - .append(BluePrintConstants.PATH_DIVIDER).append(propertyName).toString() + .append(BluePrintConstants.PATH_DIVIDER).append(propertyName).toString() return getJsonNode(path) } - override fun getNodeTemplateOperationOutputValue(nodeTemplateName: String, interfaceName: String, - operationName: String, propertyName: String): JsonNode { + override fun getNodeTemplateOperationOutputValue( + nodeTemplateName: String, interfaceName: String, + operationName: String, propertyName: String + ): JsonNode { val path: String = StringBuilder(BluePrintConstants.PATH_NODE_TEMPLATES) - .append(BluePrintConstants.PATH_DIVIDER).append(nodeTemplateName) - .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_INTERFACES) - .append(BluePrintConstants.PATH_DIVIDER).append(interfaceName) - .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_OPERATIONS) - .append(BluePrintConstants.PATH_DIVIDER).append(operationName) - .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_OUTPUTS) - .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_PROPERTIES) - .append(BluePrintConstants.PATH_DIVIDER).append(propertyName).toString() + .append(BluePrintConstants.PATH_DIVIDER).append(nodeTemplateName) + .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_INTERFACES) + .append(BluePrintConstants.PATH_DIVIDER).append(interfaceName) + .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_OPERATIONS) + .append(BluePrintConstants.PATH_DIVIDER).append(operationName) + .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_OUTPUTS) + .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_PROPERTIES) + .append(BluePrintConstants.PATH_DIVIDER).append(propertyName).toString() return getJsonNode(path) } override fun getNodeTemplatePropertyValue(nodeTemplateName: String, propertyName: String): JsonNode { val path: String = StringBuilder(BluePrintConstants.PATH_NODE_TEMPLATES) - .append(BluePrintConstants.PATH_DIVIDER).append(nodeTemplateName) - .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_PROPERTIES) - .append(BluePrintConstants.PATH_DIVIDER).append(propertyName).toString() + .append(BluePrintConstants.PATH_DIVIDER).append(nodeTemplateName) + .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_PROPERTIES) + .append(BluePrintConstants.PATH_DIVIDER).append(propertyName).toString() return getJsonNode(path) } override fun getNodeTemplateAttributeValue(nodeTemplateName: String, attributeName: String): JsonNode { val path: String = StringBuilder(BluePrintConstants.PATH_NODE_TEMPLATES) - .append(BluePrintConstants.PATH_DIVIDER).append(nodeTemplateName) - .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_ATTRIBUTES) - .append(BluePrintConstants.PATH_DIVIDER).append(attributeName).toString() + .append(BluePrintConstants.PATH_DIVIDER).append(nodeTemplateName) + .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_ATTRIBUTES) + .append(BluePrintConstants.PATH_DIVIDER).append(attributeName).toString() return getJsonNode(path) } @@ -529,38 +556,37 @@ open class DefaultBluePrintRuntimeService(private var id: String, private var bl log.info("assignInputs from input JSON ({})", jsonNode.toString()) bluePrintContext.inputs()?.forEach { propertyName, property -> val valueNode: JsonNode = jsonNode.at(BluePrintConstants.PATH_DIVIDER + propertyName) - ?: NullNode.getInstance() - setInputValue(propertyName, property, valueNode) + ?: property.defaultValue + ?: NullNode.getInstance() + setInputValue(propertyName, valueNode) } } override fun assignWorkflowInputs(workflowName: String, jsonNode: JsonNode) { - log.info("assign workflow {} input value ({})", workflowName, jsonNode.toString()) - + log.info("For workflow ($workflowName) driving input data from (${jsonNode})") val dynamicInputPropertiesName = "$workflowName-properties" - bluePrintContext.workflowByName(workflowName).inputs?.forEach { propertyName, property -> + bluePrintContext.workflowByName(workflowName).inputs?. + forEach { propertyName, property -> if (propertyName != dynamicInputPropertiesName) { - val valueNode: JsonNode = jsonNode - .at(BluePrintConstants.PATH_DIVIDER + propertyName).returnNullIfMissing() + val valueNode: JsonNode = + jsonNode.at(BluePrintConstants.PATH_DIVIDER + propertyName).returnNullIfMissing() ?: property.defaultValue ?: NullNode.getInstance() - setInputValue(propertyName, property, valueNode) + log.trace("Setting input data - attribute:($propertyName) value:($valueNode)") + setInputValue(propertyName, valueNode) } } // Load Dynamic data Types - val workflowDynamicInputs: JsonNode? = jsonNode.get(dynamicInputPropertiesName) - - workflowDynamicInputs?.let { - bluePrintContext.dataTypeByName("dt-$dynamicInputPropertiesName") - ?.properties?.forEach { propertyName, property -> + jsonNode.get(dynamicInputPropertiesName)?.let { + bluePrintContext.dataTypeByName("dt-$dynamicInputPropertiesName")?.properties?. + forEach { propertyName, property -> val valueNode: JsonNode = - workflowDynamicInputs - .at(BluePrintConstants.PATH_DIVIDER + propertyName).returnNullIfMissing() - ?: property.defaultValue - ?: NullNode.getInstance() - setInputValue(propertyName, property, valueNode) - + it.at(BluePrintConstants.PATH_DIVIDER + propertyName).returnNullIfMissing() + ?: property.defaultValue + ?: NullNode.getInstance() + log.trace("Setting input data - attribute:($propertyName) value:($valueNode)") + setInputValue(propertyName, valueNode) } } } @@ -575,9 +601,9 @@ open class DefaultBluePrintRuntimeService(private var id: String, private var bl val jsonNode: ObjectNode = jacksonObjectMapper().createObjectNode() val path: String = StringBuilder(BluePrintConstants.PATH_NODE_TEMPLATES) - .append(BluePrintConstants.PATH_DIVIDER).append(nodeTemplateName) - .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_ATTRIBUTES) - .append(BluePrintConstants.PATH_DIVIDER).toString() + .append(BluePrintConstants.PATH_DIVIDER).append(nodeTemplateName) + .append(BluePrintConstants.PATH_DIVIDER).append(BluePrintConstants.PATH_ATTRIBUTES) + .append(BluePrintConstants.PATH_DIVIDER).toString() store.keys.filter { it.startsWith(path) }.map { diff --git a/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt b/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt index 9103af3fa..bef1c4570 100644 --- a/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt +++ b/ms/controllerblueprints/modules/blueprint-core/src/test/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt @@ -146,8 +146,7 @@ class BluePrintRuntimeServiceTest { val bluePrintRuntimeService = getBluePrintRuntimeService() - bluePrintRuntimeService.setInputValue("rest-user-name", PropertyDefinition(), "sample-username" - .asJsonPrimitive()) + bluePrintRuntimeService.setInputValue("rest-user-name", "sample-username".asJsonPrimitive()) val resolvedJsonNode: JsonNode = bluePrintRuntimeService.resolveDSLExpression("dynamic-rest-source") assertNotNull(resolvedJsonNode, "Failed to populate dsl property values") diff --git a/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/resource/dict/ResourceDefinition.kt b/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/resource/dict/ResourceDefinition.kt index 2966d8b5d..f1e0d2c86 100644 --- a/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/resource/dict/ResourceDefinition.kt +++ b/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/resource/dict/ResourceDefinition.kt @@ -85,16 +85,13 @@ open class ResourceAssignment { override fun toString(): String { return """ - [ + [ name = $name - status = $status - property [ - defaultValue = ${property?.defaultValue} - required = ${property?.required} - metadata = ${property?.metadata} - ] + status = $status + required = ${property?.required} + dependencies = $dependencies dictionaryName = $dictionaryName - dictionarySource = $dictionarySource + dictionarySource = $dictionarySource ] """.trimIndent() } diff --git a/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/resource/dict/utils/BulkResourceSequencingUtils.kt b/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/resource/dict/utils/BulkResourceSequencingUtils.kt index 60fe6a705..cd887bf54 100644 --- a/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/resource/dict/utils/BulkResourceSequencingUtils.kt +++ b/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/resource/dict/utils/BulkResourceSequencingUtils.kt @@ -35,7 +35,7 @@ object BulkResourceSequencingUtils { fun process(resourceAssignments: MutableList<ResourceAssignment>): List<List<ResourceAssignment>> { val resourceAssignmentMap: MutableMap<String, ResourceAssignment> = hashMapOf() val sequenceBatchResourceAssignment = ArrayList<List<ResourceAssignment>>() - log.info("Assignments ({})", resourceAssignments) + log.trace("Assignments ({})", resourceAssignments) // Prepare Map resourceAssignments.forEach { resourceAssignment -> log.trace("Processing Key ({})", resourceAssignment.name) @@ -64,7 +64,7 @@ object BulkResourceSequencingUtils { } val sequencedResourceAssignments: MutableList<ResourceAssignment> = topologySorting.topSort()!! as MutableList<ResourceAssignment> - log.info("Sorted Sequenced Assignments ({})", sequencedResourceAssignments) + log.trace("Sorted Sequenced Assignments ({})", sequencedResourceAssignments) var batchResourceAssignment: MutableList<ResourceAssignment>? = null var batchAssignmentName: MutableList<String>? = null diff --git a/ms/sdclistener/distribution/src/main/docker/distribution.xml b/ms/sdclistener/distribution/src/main/docker/distribution.xml index e9e8eefa5..335973e97 100755 --- a/ms/sdclistener/distribution/src/main/docker/distribution.xml +++ b/ms/sdclistener/distribution/src/main/docker/distribution.xml @@ -25,7 +25,7 @@ </formats> <dependencySets> <dependencySet> - <outputDirectory>/opt/app/onap/lib</outputDirectory> + <outputDirectory>opt/app/onap/lib</outputDirectory> <outputFileNameMapping>${artifact.groupId}-${artifact.artifactId}-${artifact.version}${dashClassifier?}.${artifact.extension}</outputFileNameMapping> <excludes> <exclude>org.slf4j:slf4j-simple</exclude> @@ -40,7 +40,7 @@ <include>application.yml</include> <include>logback.xml</include> </includes> - <outputDirectory>/opt/app/onap/config</outputDirectory> + <outputDirectory>opt/app/onap/config</outputDirectory> <useDefaultExcludes>true</useDefaultExcludes> </fileSet> </fileSets> |