aboutsummaryrefslogtreecommitdiffstats
path: root/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Scripts/kotlin/RestconfConfigDeploy.kt
diff options
context:
space:
mode:
Diffstat (limited to 'components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Scripts/kotlin/RestconfConfigDeploy.kt')
-rw-r--r--components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Scripts/kotlin/RestconfConfigDeploy.kt20
1 files changed, 10 insertions, 10 deletions
diff --git a/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Scripts/kotlin/RestconfConfigDeploy.kt b/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Scripts/kotlin/RestconfConfigDeploy.kt
index a2372c9db..264f4f725 100644
--- a/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Scripts/kotlin/RestconfConfigDeploy.kt
+++ b/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Scripts/kotlin/RestconfConfigDeploy.kt
@@ -16,7 +16,6 @@
* ============LICENSE_END=========================================================
*/
-
package cba.pnf.config
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
@@ -32,6 +31,7 @@ import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
import org.onap.ccsdk.cds.controllerblueprints.core.logger
class RestconfConfigDeploy : AbstractScriptComponentFunction() {
+
private val CONFIGLET_TEMPLATE_NAME = "config-assign"
private val CONFIGLET_RESOURCE_PATH = "yang-ext:mount/mynetconf:netconflist"
private val RESTCONF_SERVER_IDENTIFIER = "sdnc"
@@ -53,18 +53,19 @@ class RestconfConfigDeploy : AbstractScriptComponentFunction() {
log.debug("Mounting Device : $deviceID")
restconfMountDevice(webclientService, deviceID, mountPayload, mutableMapOf("Content-Type" to "application/json"))
- //Log the current configuration for the subtree
+ // Log the current configuration for the subtree
val currentConfig: Any = restconfDeviceConfig(webclientService, deviceID, CONFIGLET_RESOURCE_PATH)
log.info("Current configuration subtree : $currentConfig")
- //Apply configlet
- restconfApplyDeviceConfig(webclientService, deviceID, CONFIGLET_RESOURCE_PATH,
- storedContentFromResolvedArtifactNB(resolutionKey, CONFIGLET_TEMPLATE_NAME),
- mutableMapOf("Content-Type" to "application/yang.patch+json"))
-
+ // Apply configlet
+ restconfApplyDeviceConfig(
+ webclientService, deviceID, CONFIGLET_RESOURCE_PATH,
+ storedContentFromResolvedArtifactNB(resolutionKey, CONFIGLET_TEMPLATE_NAME),
+ mutableMapOf("Content-Type" to "application/yang.patch+json")
+ )
} catch (err: Exception) {
log.error("an error occurred while configuring device {}", err)
} finally {
- //Un mount device
+ // Un mount device
restconfUnMountDevice(webclientService, deviceID, "")
}
} catch (bpe: BluePrintProcessorException) {
@@ -72,10 +73,9 @@ class RestconfConfigDeploy : AbstractScriptComponentFunction() {
}
}
-
override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) {
log.info("Recover function called!")
log.info("Execution request : $executionRequest")
log.error("Exception", runtimeException)
}
-} \ No newline at end of file
+}