summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions
diff options
context:
space:
mode:
authorMuthuramalingam, Brinda Santh <brindasanth@in.ibm.com>2019-03-15 12:04:07 -0400
committerMuthuramalingam, Brinda Santh <brindasanth@in.ibm.com>2019-03-15 12:04:07 -0400
commit593e3233ffff0b82a8bdf687ca051666688296a7 (patch)
treee0f6289143e91a66edbf12d9cccfbd915431b98f /ms/blueprintsprocessor/functions
parentb87e937fe030014dcc0a36135d4fb8ba55211440 (diff)
Improve scripting component.
Change-Id: I1e0c319e4117553695fa9161e7ffcd91f605be05 Issue-ID: CCSDK-1137 Signed-off-by: Muthuramalingam, Brinda Santh <brindasanth@in.ibm.com>
Diffstat (limited to 'ms/blueprintsprocessor/functions')
-rw-r--r--ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/netconf/executor/ComponentNetconfExecutor.kt9
-rw-r--r--ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/netconf/executor/NetconfComponentFunction.kt16
-rw-r--r--ms/blueprintsprocessor/functions/restconf-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/restconf/executor/ComponentRestconfExecutor.kt9
-rw-r--r--ms/blueprintsprocessor/functions/restconf-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/restconf/executor/RestconfComponentFunction.kt9
4 files changed, 8 insertions, 35 deletions
diff --git a/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/netconf/executor/ComponentNetconfExecutor.kt b/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/netconf/executor/ComponentNetconfExecutor.kt
index 60f1e4f8..c2ccdafd 100644
--- a/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/netconf/executor/ComponentNetconfExecutor.kt
+++ b/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/netconf/executor/ComponentNetconfExecutor.kt
@@ -64,15 +64,6 @@ open class ComponentNetconfExecutor(private var componentFunctionScriptingServic
checkNotNull(scriptComponent) { "failed to get netconf script component" }
- scriptComponent.bluePrintRuntimeService = bluePrintRuntimeService
- scriptComponent.processId = processId
- scriptComponent.workflowName = workflowName
- scriptComponent.stepName = stepName
- scriptComponent.interfaceName = interfaceName
- scriptComponent.operationName = operationName
- scriptComponent.nodeTemplateName = nodeTemplateName
- scriptComponent.operationInputs = operationInputs
-
scriptComponent.process(executionServiceInput)
}
diff --git a/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/netconf/executor/NetconfComponentFunction.kt b/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/netconf/executor/NetconfComponentFunction.kt
index 05a97c39..fe8ba54d 100644
--- a/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/netconf/executor/NetconfComponentFunction.kt
+++ b/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/netconf/executor/NetconfComponentFunction.kt
@@ -20,13 +20,13 @@ import com.fasterxml.jackson.databind.JsonNode
import org.onap.ccsdk.apps.blueprintsprocessor.functions.netconf.executor.api.DeviceInfo
import org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants
import org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.ResourceResolutionService
-import org.onap.ccsdk.apps.blueprintsprocessor.services.execution.AbstractComponentFunction
+import org.onap.ccsdk.apps.blueprintsprocessor.services.execution.AbstractScriptComponentFunction
import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils
-abstract class NetconfComponentFunction : AbstractComponentFunction() {
+abstract class NetconfComponentFunction : AbstractScriptComponentFunction() {
open fun resourceResolutionService(): ResourceResolutionService =
- functionDependencyInstanceAsType(ResourceResolutionConstants.SERVICE_RESOURCE_RESOLUTION)
+ functionDependencyInstanceAsType(ResourceResolutionConstants.SERVICE_RESOURCE_RESOLUTION)
// Called from python script
fun initializeNetconfConnection(requirementName: String): NetconfDevice {
@@ -38,22 +38,18 @@ abstract class NetconfComponentFunction : AbstractComponentFunction() {
return bluePrintRuntimeService.resolveNodeTemplateArtifact(nodeTemplateName, artifactName)
}
- fun getDynamicProperties(key: String): JsonNode {
- return operationInputs["dynamic-properties"]!!.get(key)
- }
-
fun resolveFromDatabase(resolutionKey: String, artifactName: String): String {
return resourceResolutionService().resolveFromDatabase(bluePrintRuntimeService, artifactName, resolutionKey)
}
fun resolveAndGenerateMessage(artifactMapping: String, artifactTemplate: String): String {
return resourceResolutionService().resolveResources(bluePrintRuntimeService, nodeTemplateName,
- artifactMapping, artifactTemplate)
+ artifactMapping, artifactTemplate)
}
fun resolveAndGenerateMessage(artifactPrefix: String): String {
return resourceResolutionService().resolveResources(bluePrintRuntimeService, nodeTemplateName,
- artifactPrefix, mapOf())
+ artifactPrefix, mapOf())
}
private fun deviceProperties(requirementName: String): DeviceInfo {
@@ -63,7 +59,7 @@ abstract class NetconfComponentFunction : AbstractComponentFunction() {
val requirement = blueprintContext.nodeTemplateRequirement(nodeTemplateName, requirementName)
val capabilityProperties = bluePrintRuntimeService.resolveNodeTemplateCapabilityProperties(requirement
- .node!!, requirement.capability!!)
+ .node!!, requirement.capability!!)
return deviceProperties(capabilityProperties)
}
diff --git a/ms/blueprintsprocessor/functions/restconf-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/restconf/executor/ComponentRestconfExecutor.kt b/ms/blueprintsprocessor/functions/restconf-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/restconf/executor/ComponentRestconfExecutor.kt
index 742fef4b..7166ec27 100644
--- a/ms/blueprintsprocessor/functions/restconf-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/restconf/executor/ComponentRestconfExecutor.kt
+++ b/ms/blueprintsprocessor/functions/restconf-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/restconf/executor/ComponentRestconfExecutor.kt
@@ -64,15 +64,6 @@ open class ComponentRestconfExecutor(private var componentFunctionScriptingServi
checkNotNull(scriptComponent) { "failed to get restconf script component" }
- scriptComponent.bluePrintRuntimeService = bluePrintRuntimeService
- scriptComponent.processId = processId
- scriptComponent.workflowName = workflowName
- scriptComponent.stepName = stepName
- scriptComponent.interfaceName = interfaceName
- scriptComponent.operationName = operationName
- scriptComponent.nodeTemplateName = nodeTemplateName
- scriptComponent.operationInputs = operationInputs
-
scriptComponent.process(executionServiceInput)
}
diff --git a/ms/blueprintsprocessor/functions/restconf-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/restconf/executor/RestconfComponentFunction.kt b/ms/blueprintsprocessor/functions/restconf-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/restconf/executor/RestconfComponentFunction.kt
index c3f2253a..1914616e 100644
--- a/ms/blueprintsprocessor/functions/restconf-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/restconf/executor/RestconfComponentFunction.kt
+++ b/ms/blueprintsprocessor/functions/restconf-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/restconf/executor/RestconfComponentFunction.kt
@@ -17,16 +17,15 @@
package org.onap.ccsdk.apps.blueprintsprocessor.functions.restconf.executor
-import com.fasterxml.jackson.databind.JsonNode
import org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants
import org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.ResourceResolutionService
import org.onap.ccsdk.apps.blueprintsprocessor.rest.RestLibConstants
import org.onap.ccsdk.apps.blueprintsprocessor.rest.service.BluePrintRestLibPropertyService
import org.onap.ccsdk.apps.blueprintsprocessor.rest.service.BlueprintWebClientService
-import org.onap.ccsdk.apps.blueprintsprocessor.services.execution.AbstractComponentFunction
+import org.onap.ccsdk.apps.blueprintsprocessor.services.execution.AbstractScriptComponentFunction
-abstract class RestconfComponentFunction : AbstractComponentFunction() {
+abstract class RestconfComponentFunction : AbstractScriptComponentFunction() {
open fun bluePrintRestLibPropertyService(): BluePrintRestLibPropertyService =
functionDependencyInstanceAsType(RestLibConstants.SERVICE_BLUEPRINT_REST_LIB_PROPERTY)
@@ -39,10 +38,6 @@ abstract class RestconfComponentFunction : AbstractComponentFunction() {
return bluePrintRestLibPropertyService().blueprintWebClientService(selector)
}
- fun getDynamicProperties(key: String): JsonNode {
- return operationInputs["dynamic-properties"]!!.get(key)
- }
-
fun resolveFromDatabase(resolutionKey: String, artifactName: String): String {
return resourceResolutionService().resolveFromDatabase(bluePrintRuntimeService, artifactName, resolutionKey)
}