<dependencies>
<dependency>
<groupId>org.onap.ccsdk.apps.blueprintsprocessor.functions</groupId>
- <artifactId>python-executor</artifactId>
+ <artifactId>resource-resolution</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.jettison</groupId>
<artifactId>sshd-core</artifactId>
<version>1.7.0</version>
</dependency>
- <!-- <dependency>
- <groupId>org.bouncycastle</groupId>
- <artifactId>bcprov-jdk15on</artifactId>
- <version>${bouncycastle.version}</version>
- </dependency> -->
- <dependency>
- <groupId>com.jcraft</groupId>
- <artifactId>jsch</artifactId>
- <version>0.1.54</version>
- </dependency>
-
+ <dependency>
+ <groupId>com.jcraft</groupId>
+ <artifactId>jsch</artifactId>
+ <version>0.1.54</version>
+ </dependency>
</dependencies>
-
-
</project>
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
@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)
checkNotNull(scriptComponent) { "failed to get netconf script component" }
scriptComponent.bluePrintRuntimeService = bluePrintRuntimeService
+ scriptComponent.resourceResolutionService = resourceResolutionService
+
scriptComponent.processId = processId
scriptComponent.workflowName = workflowName
scriptComponent.stepName = stepName
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 {
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.python.executor.PythonExecutorProperty
+import org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.ResourceResolutionServiceImpl
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintConstants
import org.onap.ccsdk.apps.controllerblueprints.core.asJsonNode
import org.onap.ccsdk.apps.controllerblueprints.core.putJsonElement
import org.springframework.test.context.junit4.SpringRunner
@RunWith(SpringRunner::class)
-@ContextConfiguration(classes = [BlueprintJythonService::class, PythonExecutorProperty::class, ComponentNetconfExecutor::class, JsonParserService::class])
+@ContextConfiguration(classes = [BlueprintJythonService::class, PythonExecutorProperty::class,
+ ComponentNetconfExecutor::class, JsonParserService::class, ResourceResolutionServiceImpl::class])
@TestPropertySource(properties =
["blueprints.processor.functions.python.executor.modulePaths=./../../../../components/scripts/python/ccsdk_netconf,./../../../../components/scripts/python/ccsdk_blueprints",
"blueprints.processor.functions.python.executor.executionPath=./../../../../components/scripts/python/ccsdk_netconf"])