diff options
author | 2019-02-17 09:31:35 -0500 | |
---|---|---|
committer | 2019-02-17 16:37:54 +0000 | |
commit | 791e8adde4228c29eb515689397dfb642c8b1969 (patch) | |
tree | 5608100736122dc11e07230491a863de55bfb1df /ms/blueprintsprocessor/functions/netconf-executor/src/main | |
parent | b359a833a6355e110a1be13096e751d86a6c6d15 (diff) |
Netconf resolution service
Change-Id: I0346c88cd11136561426260a206bd7bf07f90dd3
Issue-ID: CCSDK-1086
Signed-off-by: Alexis de Talhouët <adetalhouet89@gmail.com>
Diffstat (limited to 'ms/blueprintsprocessor/functions/netconf-executor/src/main')
2 files changed, 18 insertions, 5 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 c32aa9d51..ecf90a281 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 @@ -20,6 +20,7 @@ package org.onap.ccsdk.apps.blueprintsprocessor.functions.netconf.executor import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ExecutionServiceInput import org.onap.ccsdk.apps.blueprintsprocessor.functions.python.executor.BlueprintJythonService +import org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.ResourceResolutionService import org.onap.ccsdk.apps.blueprintsprocessor.services.execution.AbstractComponentFunction import org.slf4j.LoggerFactory import org.springframework.beans.factory.config.ConfigurableBeanFactory @@ -28,7 +29,8 @@ import org.springframework.stereotype.Component @Component("component-netconf-executor") @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE) -open class ComponentNetconfExecutor(private val blueprintJythonService: BlueprintJythonService) +open class ComponentNetconfExecutor(private val blueprintJythonService: BlueprintJythonService, + private var resourceResolutionService: ResourceResolutionService) : AbstractComponentFunction() { private val log = LoggerFactory.getLogger(ComponentNetconfExecutor::class.java) @@ -41,6 +43,8 @@ open class ComponentNetconfExecutor(private val blueprintJythonService: Blueprin checkNotNull(scriptComponent) { "failed to get netconf script component" } scriptComponent.bluePrintRuntimeService = bluePrintRuntimeService + scriptComponent.resourceResolutionService = resourceResolutionService + scriptComponent.processId = processId scriptComponent.workflowName = workflowName scriptComponent.stepName = stepName 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 c98009fe6..e1160acf5 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 @@ -18,23 +18,32 @@ package org.onap.ccsdk.apps.blueprintsprocessor.functions.netconf.executor 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.ResourceResolutionService import org.onap.ccsdk.apps.blueprintsprocessor.services.execution.AbstractComponentFunction import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils abstract class NetconfComponentFunction : AbstractComponentFunction() { + lateinit var resourceResolutionService: ResourceResolutionService + // Called from python script fun initializeNetconfConnection(requirementName: String): NetconfDevice { val deviceInfo = deviceProperties(requirementName) return NetconfDevice(deviceInfo) } - fun generateMessage(): String { - TODO() + fun generateMessage(artifactName: String): String { + return bluePrintRuntimeService.resolveNodeTemplateArtifact(nodeTemplateName, artifactName) + } + + fun resolveAndGenerateMessage(artifactMapping: String, artifactTemplate: String): String { + return resourceResolutionService.resolveResources(bluePrintRuntimeService, nodeTemplateName, + artifactMapping, artifactTemplate) } - fun resolveAndGenerateMesssage(): String { - TODO() + fun resolveAndGenerateMessage(artifactPrefix: String): String { + return resourceResolutionService.resolveResources(bluePrintRuntimeService, nodeTemplateName, + artifactPrefix) } private fun deviceProperties(requirementName: String): DeviceInfo { |