diff options
Diffstat (limited to 'ms/blueprintsprocessor/functions/restconf-executor')
4 files changed, 23 insertions, 18 deletions
diff --git a/ms/blueprintsprocessor/functions/restconf-executor/pom.xml b/ms/blueprintsprocessor/functions/restconf-executor/pom.xml index dea3a8af3..cee90b6e6 100644 --- a/ms/blueprintsprocessor/functions/restconf-executor/pom.xml +++ b/ms/blueprintsprocessor/functions/restconf-executor/pom.xml @@ -32,21 +32,7 @@ <dependencies> <dependency> <groupId>org.onap.ccsdk.apps.blueprintsprocessor.functions</groupId> - <artifactId>python-executor</artifactId> - </dependency> - <dependency> - <groupId>org.onap.ccsdk.apps.controllerblueprints</groupId> - <artifactId>blueprint-scripts</artifactId> - </dependency> - - <!--Testing dependencies--> - <dependency> - <groupId>org.jetbrains.kotlin</groupId> - <artifactId>kotlin-test-junit</artifactId> - </dependency> - <dependency> - <groupId>io.mockk</groupId> - <artifactId>mockk</artifactId> + <artifactId>resource-resolution</artifactId> </dependency> </dependencies> 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 e91b95ff2..9bcc23b64 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 @@ -18,6 +18,7 @@ package org.onap.ccsdk.apps.blueprintsprocessor.functions.restconf.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.rest.service.BluePrintRestLibPropertyService import org.onap.ccsdk.apps.blueprintsprocessor.services.execution.AbstractComponentFunction import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintConstants @@ -35,7 +36,8 @@ import org.springframework.stereotype.Component open class ComponentRestconfExecutor(private var applicationContext: ApplicationContext, private val blueprintJythonService: BlueprintJythonService, private val bluePrintScriptsService: BluePrintScriptsService, - private var bluePrintRestLibPropertyService: BluePrintRestLibPropertyService) : + private var bluePrintRestLibPropertyService: BluePrintRestLibPropertyService, + private var resourceResolutionService: ResourceResolutionService) : AbstractComponentFunction() { private val log = LoggerFactory.getLogger(ComponentRestconfExecutor::class.java) @@ -68,6 +70,7 @@ open class ComponentRestconfExecutor(private var applicationContext: Application // Set the Rest Lib Property Service scriptComponent.bluePrintRestLibPropertyService = bluePrintRestLibPropertyService + scriptComponent.resourceResolutionService = resourceResolutionService 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 7b3615fe3..d9362af83 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 @@ -13,9 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +@file:Suppress("unused") package org.onap.ccsdk.apps.blueprintsprocessor.functions.restconf.executor +import org.onap.ccsdk.apps.blueprintsprocessor.functions.resource.resolution.ResourceResolutionService 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 @@ -24,10 +25,23 @@ import org.onap.ccsdk.apps.blueprintsprocessor.services.execution.AbstractCompon abstract class RestconfComponentFunction : AbstractComponentFunction() { lateinit var bluePrintRestLibPropertyService: BluePrintRestLibPropertyService + lateinit var resourceResolutionService: ResourceResolutionService fun restClientService(selector: String): BlueprintWebClientService { return bluePrintRestLibPropertyService.blueprintWebClientService(selector) } + 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 resolveAndGenerateMessage(artifactPrefix: String): String { + return resourceResolutionService.resolveResources(bluePrintRuntimeService, nodeTemplateName, + artifactPrefix) + } }
\ No newline at end of file diff --git a/ms/blueprintsprocessor/functions/restconf-executor/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/restconf/executor/ComponentRestconfExecutorTest.kt b/ms/blueprintsprocessor/functions/restconf-executor/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/restconf/executor/ComponentRestconfExecutorTest.kt index 77d469165..31bd4eb70 100644 --- a/ms/blueprintsprocessor/functions/restconf-executor/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/restconf/executor/ComponentRestconfExecutorTest.kt +++ b/ms/blueprintsprocessor/functions/restconf-executor/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/restconf/executor/ComponentRestconfExecutorTest.kt @@ -29,6 +29,7 @@ import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.CommonHeader 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.blueprintsprocessor.rest.service.BluePrintRestLibPropertyService import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintConstants import org.onap.ccsdk.apps.controllerblueprints.core.asJsonNode @@ -46,7 +47,8 @@ import kotlin.test.assertNotNull @RunWith(SpringRunner::class) @ContextConfiguration(classes = [RestconfExecutorConfiguration::class, ComponentRestconfExecutor::class, BlueprintJythonService::class, PythonExecutorProperty::class, BluePrintRestLibPropertyService::class, - BlueprintPropertyConfiguration::class, BluePrintProperties::class, BluePrintScriptsServiceImpl::class]) + BlueprintPropertyConfiguration::class, BluePrintProperties::class, BluePrintScriptsServiceImpl::class, + ResourceResolutionServiceImpl::class]) @TestPropertySource(properties = ["server.port=9111", "blueprintsprocessor.restconfEnabled=true", |