diff options
Diffstat (limited to 'heat/vFW_CNF_CDS/templates/cba/Scripts/kotlin/ConfigDeploy.kt')
-rw-r--r-- | heat/vFW_CNF_CDS/templates/cba/Scripts/kotlin/ConfigDeploy.kt | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/heat/vFW_CNF_CDS/templates/cba/Scripts/kotlin/ConfigDeploy.kt b/heat/vFW_CNF_CDS/templates/cba/Scripts/kotlin/ConfigDeploy.kt index c4849601..861cdf66 100644 --- a/heat/vFW_CNF_CDS/templates/cba/Scripts/kotlin/ConfigDeploy.kt +++ b/heat/vFW_CNF_CDS/templates/cba/Scripts/kotlin/ConfigDeploy.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Aarna Networks, Inc. + * Copyright © 2021 Orange * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,44 +16,33 @@ package org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts -import com.fasterxml.jackson.databind.node.ObjectNode import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.storedContentFromResolvedArtifactNB -import org.onap.ccsdk.cds.blueprintsprocessor.rest.BasicAuthRestClientProperties -import org.onap.ccsdk.cds.blueprintsprocessor.rest.RestClientProperties -import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BasicAuthRestClientService -import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractScriptComponentFunction -import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.slf4j.LoggerFactory -import org.springframework.http.HttpMethod -import org.springframework.web.client.RestTemplate open class ConfigDeploy : AbstractScriptComponentFunction() { private val log = LoggerFactory.getLogger(ConfigDeploy::class.java)!! - override suspend fun processNB(executionRequest: ExecutionServiceInput) { - - /* - * Resolution key will come as part of config-deploy request payload. - */ + override fun getName(): String { + return "ConfigDeploy" + } + override suspend fun processNB(executionRequest: ExecutionServiceInput) { val resolution_key = getDynamicProperties("resolution-key").asText() - log.info("Got the resolution_key: $resolution_key from config-deploy going to retrive the data from DB") + log.info("Got the resolution_key: $resolution_key from config-deploy going to retrieve the data from DB") + val prefix = "config-deploy" // used in the config-assign resolution - // Read the config-assing data using the resolution key + prefix name for the template - // We can select the given configuration using the resolution_key - val prefix = "cnf" val payload = storedContentFromResolvedArtifactNB(resolution_key, prefix) log.info("cnf configuration data from DB : \n$payload\n") println("Run config-deploy") println("$payload") - } override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) { log.info("Executing Recovery") + this.addError("${runtimeException.message}") } } |