From ef03bd490adb4483fc0dd0f8726f33ba6187804a Mon Sep 17 00:00:00 2001 From: Brinda Santh Date: Wed, 24 Jul 2019 20:38:36 -0400 Subject: Fix missing capability cli models. Change-Id: Id5ad2f75cf27b7c09dc95a028997847098cd3d2e Issue-ID: CCSDK-1046 Signed-off-by: Brinda Santh --- .../capability_cli/Scripts/kotlin/CapabilityCli.kt | 35 +++++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) (limited to 'components/model-catalog/blueprint-model/test-blueprint/capability_cli/Scripts/kotlin/CapabilityCli.kt') diff --git a/components/model-catalog/blueprint-model/test-blueprint/capability_cli/Scripts/kotlin/CapabilityCli.kt b/components/model-catalog/blueprint-model/test-blueprint/capability_cli/Scripts/kotlin/CapabilityCli.kt index 270184d34..6b1aae45d 100644 --- a/components/model-catalog/blueprint-model/test-blueprint/capability_cli/Scripts/kotlin/CapabilityCli.kt +++ b/components/model-catalog/blueprint-model/test-blueprint/capability_cli/Scripts/kotlin/CapabilityCli.kt @@ -16,16 +16,43 @@ package cba.scripts.capability.cli -open class Check : CliComponentFunction() { +import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput +import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractScriptComponentFunction +import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ComponentScriptExecutor +import org.onap.ccsdk.cds.blueprintsprocessor.ssh.sshClientService +import org.onap.ccsdk.cds.controllerblueprints.core.* +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService - private val log = LoggerFactory.getLogger(CliComponentFunction::class.java)!! + +open class Check : AbstractScriptComponentFunction() { + + private val log = logger(Check::class) override fun getName(): String { - return "SimpleCliConfigure" + return "Check" } override suspend fun processNB(executionRequest: ExecutionServiceInput) { - log.info("Executing process") + log.info("Executing process : ${executionRequest.payload}") + + val data = executionRequest.payload.at("/check-request/data") + + log.info("Data : ${data.asJsonString()}") + + val checkCommands = mashTemplateNData("command-template", data.asJsonString()) + + log.info("Check Commands :$checkCommands") + + // Get the Device Information from the DSL Model + val deviceInformation = bluePrintRuntimeService.resolveDSLExpression("device-properties") + + log.info("Device Info :$deviceInformation") + + // Get the Client Service + val sshClientService = BluePrintDependencyService.sshClientService(deviceInformation) + + log.info("Client service is ready") + } override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) { -- cgit 1.2.3-korg