summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions/restconf-executor/src
diff options
context:
space:
mode:
Diffstat (limited to 'ms/blueprintsprocessor/functions/restconf-executor/src')
-rw-r--r--ms/blueprintsprocessor/functions/restconf-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/restconf/executor/ComponentRestconfExecutor.kt5
-rw-r--r--ms/blueprintsprocessor/functions/restconf-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/restconf/executor/RestconfComponentFunction.kt16
-rw-r--r--ms/blueprintsprocessor/functions/restconf-executor/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/restconf/executor/ComponentRestconfExecutorTest.kt4
3 files changed, 22 insertions, 3 deletions
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",