summaryrefslogtreecommitdiffstats
path: root/cds-regression-test/cba/resource-resolution
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2021-01-21 14:17:58 +0000
committerGerrit Code Review <gerrit@onap.org>2021-01-21 14:17:58 +0000
commit2a26e7f038190ef736a73443ee56169fea6815a9 (patch)
tree4822f88f7fc70277f6559c198ee7cb4277d4eaeb /cds-regression-test/cba/resource-resolution
parent8908c43db11c2eecc2b6e730a5c99f6ec3091a95 (diff)
parente92fce768cb792f11920f45fdbb38b3af69e212f (diff)
Merge "Update to latest version"honolulu
Diffstat (limited to 'cds-regression-test/cba/resource-resolution')
-rw-r--r--cds-regression-test/cba/resource-resolution/Definitions/resource-resolution.json99
-rw-r--r--cds-regression-test/cba/resource-resolution/Scripts/kotlin/ResolvProperties.kt49
-rw-r--r--cds-regression-test/cba/resource-resolution/Scripts/python/ResolvProperties.py40
-rw-r--r--cds-regression-test/cba/resource-resolution/TOSCA-Metadata/TOSCA.meta8
-rw-r--r--cds-regression-test/cba/resource-resolution/Templates/hello-world-jinja-mapping.json115
-rw-r--r--cds-regression-test/cba/resource-resolution/Templates/hello-world-template.jinja19
-rw-r--r--cds-regression-test/cba/resource-resolution/Templates/hello-world-template.vtl16
-rw-r--r--cds-regression-test/cba/resource-resolution/Templates/hello-world-velocity-mapping.json105
8 files changed, 0 insertions, 451 deletions
diff --git a/cds-regression-test/cba/resource-resolution/Definitions/resource-resolution.json b/cds-regression-test/cba/resource-resolution/Definitions/resource-resolution.json
deleted file mode 100644
index af804a2..0000000
--- a/cds-regression-test/cba/resource-resolution/Definitions/resource-resolution.json
+++ /dev/null
@@ -1,99 +0,0 @@
-{
- "metadata": {
- "template_author": "Selffish",
- "author-email": "test@bell.ca",
- "template_name": "RT-resource-resolution",
- "template_version": "1.0.0",
- "template_tags": "Bell, CBA, test"
- },
- "dsl_definitions": {
- "rest-endpoint": {
- "type": "token-auth",
- "url": "http://cds-regression-mockserver",
- "token": "NoTokenRequired"
- },
- "db-endpoint": {
- "type": "maria-db",
- "url": "jdbc:mysql://cds-db:3306/sdnctl",
- "username": "sdnctl",
- "password": "sdnctl"
- }
- },
- "topology_template": {
- "workflows": {
- "resource-resolution": {
- "steps": {
- "helloworld": {
- "description": "Component resource resolution regression test",
- "target": "resource-resolution"
- }
- },
- "inputs": {
- "resolution-key": {
- "required": true,
- "type": "string"
- },
- "template-prefix": {
- "required": true,
- "type": "list",
- "entry_schema": {
- "type": "string"
- }
- }
- },
- "outputs": {
- "meshed-template": {
- "type": "json",
- "value": {
- "get_attribute": [
- "resource-resolution",
- "assignment-params"
- ]
- }
- }
- }
- }
- },
- "node_templates": {
- "resource-resolution": {
- "type": "component-resource-resolution",
- "interfaces": {
- "ResourceResolutionComponent": {
- "operations": {
- "process": {
- "inputs": {
- "artifact-prefix-names": {
- "get_input": "template-prefix"
- },
- "store-result": true,
- "force-resolution": true,
- "resolution-key": {
- "get_input": "resolution-key"
- }
- }
- }
- }
- }
- },
- "artifacts": {
- "helloworld-velocity-template": {
- "type": "artifact-template-velocity",
- "file": "Templates/hello-world-template.vtl"
- },
- "helloworld-velocity-mapping": {
- "type": "artifact-mapping-resource",
- "file": "Templates/hello-world-velocity-mapping.json"
- },
- "helloworld-jinja-template": {
- "type": "artifact-template-jinja",
- "file": "Templates/hello-world-template.jinja"
- },
- "helloworld-jinja-mapping": {
- "type": "artifact-mapping-resource",
- "file": "Templates/hello-world-jinja-mapping.json"
- }
- }
- }
- }
- }
-}
diff --git a/cds-regression-test/cba/resource-resolution/Scripts/kotlin/ResolvProperties.kt b/cds-regression-test/cba/resource-resolution/Scripts/kotlin/ResolvProperties.kt
deleted file mode 100644
index 5dd8a86..0000000
--- a/cds-regression-test/cba/resource-resolution/Scripts/kotlin/ResolvProperties.kt
+++ /dev/null
@@ -1,49 +0,0 @@
-package cba.cds.RT
-
-import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.processor.ResourceAssignmentProcessor
-import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils
-import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
-import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment
-import org.slf4j.LoggerFactory
-
-open class ResolvPropertiesKt() : ResourceAssignmentProcessor() {
-
- private val log = LoggerFactory.getLogger(ResolvPropertiesKt::class.java)!!
-
- override fun getName(): String {
- return "ResolvPropertiesKt"
- }
-
- override suspend fun processNB(resourceAssignment: ResourceAssignment) {
-
- var retValue = "undefined"
- val resourceAssignmentNames = listOf<String>("j_kotlin","v_kotlin")
-
- try {
- if(resourceAssignment.name == "from_suspend_function") {
- retValue = getResolvedValue(resourceAssignment)
- }
- if(resourceAssignmentNames.contains(resourceAssignment.name)) {
- retValue = "ok"
- }
- ResourceAssignmentUtils.setResourceDataValue(resourceAssignment, raRuntimeService, retValue)
-
- } catch (e: Exception) {
- log.error(e.message, e)
- ResourceAssignmentUtils.setResourceDataValue(resourceAssignment, raRuntimeService, "ERROR")
-
- throw BluePrintProcessorException("Failed in template key ($resourceAssignment) assignments, cause: ${e.message}", e)
- }
- }
-
- /*
- * CCSDK-2150 : https://jira.onap.org/browse/CCSDK-2150
- */
- suspend fun getResolvedValue(resourceAssignment: ResourceAssignment): String {
- return "ok"
- }
-
- override suspend fun recoverNB(runtimeException: RuntimeException, resourceAssignment: ResourceAssignment) {
- raRuntimeService.getBluePrintError().addError("Failed in ResolvPropertiesKt-ResourceAssignmentProcessor : ${runtimeException.message}")
- }
-}
diff --git a/cds-regression-test/cba/resource-resolution/Scripts/python/ResolvProperties.py b/cds-regression-test/cba/resource-resolution/Scripts/python/ResolvProperties.py
deleted file mode 100644
index 4397a67..0000000
--- a/cds-regression-test/cba/resource-resolution/Scripts/python/ResolvProperties.py
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright (c) 2019 IBM, Bell Canada.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-from abstract_ra_processor import AbstractRAProcessor
-from blueprint_constants import *
-
-class ResolvProperties(AbstractRAProcessor):
-
- def process(self, resource_assignment):
-
- resource_assignment_names = ["v_python","j_python"]
- script_value = "undefined"
-
- try:
- if resource_assignment.name in resource_assignment_names :
- script_value = "ok"
- # set value for resource getting currently resolved
- self.set_resource_data_value(resource_assignment, script_value)
- # except JavaException as err:
- # print("Java Exception in the script {}", err)
- # self.set_resource_data_value(resource_assignment, "ERROR")
- except Exception as err:
- print("Python Exception in the script {}", err)
- # self.set_resource_data_value(resource_assignment, "ERROR")
- return None
-
- def recover(self, runtime_exception):
- print("Exception in the script {}", runtime_exception)
- # print self.addError(runtime_exception.cause.message)
- return None
diff --git a/cds-regression-test/cba/resource-resolution/TOSCA-Metadata/TOSCA.meta b/cds-regression-test/cba/resource-resolution/TOSCA-Metadata/TOSCA.meta
deleted file mode 100644
index bb9b59a..0000000
--- a/cds-regression-test/cba/resource-resolution/TOSCA-Metadata/TOSCA.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-TOSCA-Meta-File-Version: 1.0.0
-CSAR-Version: 1.0
-Created-By: Selffish
-Entry-Definitions: Definitions/resource-resolution.json
-Template-Tags: test, regression
-Template-Name: RT-resource-resolution
-Template-Version: 1.0.0
-Template-Type: DEFAULT \ No newline at end of file
diff --git a/cds-regression-test/cba/resource-resolution/Templates/hello-world-jinja-mapping.json b/cds-regression-test/cba/resource-resolution/Templates/hello-world-jinja-mapping.json
deleted file mode 100644
index 395e7a1..0000000
--- a/cds-regression-test/cba/resource-resolution/Templates/hello-world-jinja-mapping.json
+++ /dev/null
@@ -1,115 +0,0 @@
-[
- {
- "name": "j_default",
- "input-param": true,
- "property": {
- "type": "string",
- "default": "ok"
- },
- "dictionary-name": "input-source",
- "dictionary-source": "input",
- "dependencies": []
- },
- {
- "name": "j_input",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "input-source",
- "dictionary-source": "input",
- "dependencies": []
- },
- {
- "name": "j_python",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "properties-capability-source",
- "dictionary-source": "capability",
- "dependencies": []
- },
- {
- "name": "j_kotlin",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "kotlin-script",
- "dictionary-source": "capability",
- "dependencies": []
- },
- {
- "name": "from_suspend_function",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "kotlin-script",
- "dictionary-source": "capability",
- "dependencies": []
- },
- {
- "name": "j_db",
- "input-param": true,
- "property": {
- "type": "list",
- "entry_schema": {
- "type": "string"
- }
- },
- "dictionary-name": "RT-db",
- "dictionary-source": "processor-db"
- },
- {
- "name": "j_get",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "RT-rest-get",
- "dictionary-source": "sdnc",
- "dependencies": []
- },
- {
- "name": "j_post",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "RT-rest-post",
- "dictionary-source": "sdnc",
- "dependencies": []
- },
- {
- "name": "j_put",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "RT-rest-put",
- "dictionary-source": "sdnc",
- "dependencies": []
- },
- {
- "name": "j_patch",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "RT-rest-patch",
- "dictionary-source": "sdnc",
- "dependencies": []
- },
- {
- "name": "j_del",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "RT-rest-delete",
- "dictionary-source": "sdnc",
- "dependencies": []
- }
-]
diff --git a/cds-regression-test/cba/resource-resolution/Templates/hello-world-template.jinja b/cds-regression-test/cba/resource-resolution/Templates/hello-world-template.jinja
deleted file mode 100644
index 19947b5..0000000
--- a/cds-regression-test/cba/resource-resolution/Templates/hello-world-template.jinja
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "default": "{{ j_default }}",
- "input": "{{ j_input }}",
- "script": {
- "python": "{{ j_python }}",
- "kotlin": {
- "base": "{{ j_kotlin }}"
- "from suspend function": "{{ from_suspend_function }}"
- }
- },
- "db": "{{ j_db[0].value }}",
- "rest": {
- "GET": "{{j_get}}",
- "POST": "{{j_post}}",
- "PUT": "{{j_put}}",
- "PATCH": "{{j_patch}}",
- "DELETE": "{{j_del}}"
- }
-}
diff --git a/cds-regression-test/cba/resource-resolution/Templates/hello-world-template.vtl b/cds-regression-test/cba/resource-resolution/Templates/hello-world-template.vtl
deleted file mode 100644
index f821770..0000000
--- a/cds-regression-test/cba/resource-resolution/Templates/hello-world-template.vtl
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "default": "${v_default}",
- "input": "${v_input}",
- "script": {
- "python": "${v_python}",
- "kotlin": "${v_kotlin}"
- },
- "db": "${v_db.get(0).value}",
- "rest": {
- "GET": "${v_get}",
- "POST": "${v_post}",
- "PUT": "${v_put}",
- "PATCH": "${v_patch}",
- "DELETE": "${v_del}"
- }
-}
diff --git a/cds-regression-test/cba/resource-resolution/Templates/hello-world-velocity-mapping.json b/cds-regression-test/cba/resource-resolution/Templates/hello-world-velocity-mapping.json
deleted file mode 100644
index 4314908..0000000
--- a/cds-regression-test/cba/resource-resolution/Templates/hello-world-velocity-mapping.json
+++ /dev/null
@@ -1,105 +0,0 @@
-[
- {
- "name": "v_default",
- "input-param": true,
- "property": {
- "type": "string",
- "default": "ok"
- },
- "dictionary-name": "input-source",
- "dictionary-source": "input",
- "dependencies": []
- },
- {
- "name": "v_input",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "input-source",
- "dictionary-source": "input",
- "dependencies": []
- },
- {
- "name": "v_python",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "properties-capability-source",
- "dictionary-source": "capability",
- "dependencies": []
- },
- {
- "name": "v_kotlin",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "kotlin-script",
- "dictionary-source": "capability",
- "dependencies": []
- },
- {
- "name": "v_db",
- "input-param": true,
- "property": {
- "type": "list",
- "entry_schema": {
- "type": "string"
- }
- },
- "dictionary-name": "RT-db",
- "dictionary-source": "processor-db"
- },
- {
- "name": "v_get",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "RT-rest-get",
- "dictionary-source": "sdnc",
- "dependencies": []
- },
- {
- "name": "v_post",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "RT-rest-post",
- "dictionary-source": "sdnc",
- "dependencies": []
- },
- {
- "name": "v_put",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "RT-rest-put",
- "dictionary-source": "sdnc",
- "dependencies": []
- },
- {
- "name": "v_patch",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "RT-rest-patch",
- "dictionary-source": "sdnc",
- "dependencies": []
- },
- {
- "name": "v_del",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "RT-rest-delete",
- "dictionary-source": "sdnc",
- "dependencies": []
- }
-]