Formatting Code base with ktlint
[ccsdk/cds.git] / ms / blueprintsprocessor / functions / cli-executor / src / main / kotlin / internal / scripts / InternalSimpleCli.kt
index 4c1d92a..b3708a0 100644 (file)
 package internal.scripts
 
 import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
+import org.onap.ccsdk.cds.blueprintsprocessor.functions.cli.executor.cliDeviceInfo
+import org.onap.ccsdk.cds.blueprintsprocessor.functions.cli.executor.getSshClientService
 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.asJsonPrimitive
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService
 import org.slf4j.LoggerFactory
 
 open class TestCliScriptFunction : AbstractScriptComponentFunction() {
@@ -43,7 +43,6 @@ open class TestCliScriptFunction : AbstractScriptComponentFunction() {
     }
 }
 
-
 open class Check : AbstractScriptComponentFunction() {
 
     private val log = LoggerFactory.getLogger(AbstractScriptComponentFunction::class.java)!!
@@ -54,10 +53,10 @@ open class Check : AbstractScriptComponentFunction() {
 
     override suspend fun processNB(executionRequest: ExecutionServiceInput) {
         // Get the Device Information from the DSL Model
-        val deviceInformation = bluePrintRuntimeService.resolveDSLExpression("device-properties")
+        val deviceInformation = cliDeviceInfo("device-properties")
 
         // Get the Client Service
-        val sshClientService = BluePrintDependencyService.sshClientService(deviceInformation)
+        val sshClientService = getSshClientService(deviceInformation)
 
         sshClientService.startSessionNB()
 
@@ -71,7 +70,7 @@ open class Check : AbstractScriptComponentFunction() {
         sshClientService.closeSessionNB()
 
         // Set the Response Data
-        setAttribute(ComponentScriptExecutor.RESPONSE_DATA, responseLog.asJsonPrimitive())
+        setAttribute(ComponentScriptExecutor.ATTRIBUTE_RESPONSE_DATA, responseLog.asJsonPrimitive())
 
         log.info("Executing process")
     }