summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMuthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>2018-11-20 12:20:30 -0500
committerDan Timoney <dtimoney@att.com>2018-11-30 20:22:00 +0000
commit358090593a21cb73668a53cfc3e69c1b4a761953 (patch)
treecc6b7a59eab116ece5d21857dc7703dbfc89c78c
parent267d1bf1dfc509da7914a4449dfe80430ca6b377 (diff)
Add Jython Component model and validation logics.
Change-Id: I2bdba0016a41e16198d60be68dff68d1ce7ad13a Issue-ID: CCSDK-696 Signed-off-by: Muthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>
-rw-r--r--components/core/load/model_type/node_type/component-resource-assignment.json2
-rw-r--r--components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/BluePrintConstants.kt1
-rw-r--r--components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/BluePrintTypes.kt1
-rw-r--r--components/core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt8
-rw-r--r--components/model-catalog/blueprint-model/service-blueprint/vFW/Definitions/vFW_spinup.json4
-rw-r--r--components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Definitions/activation-blueprint.json42
-rw-r--r--components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Definitions/artifact-types.json45
-rw-r--r--components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Definitions/data-types.json24
-rw-r--r--components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Definitions/node-types.json (renamed from components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Definitions/types.json)108
-rw-r--r--components/model-catalog/definition-type/starter-type/artifact_type/artifact-script-jython.json8
-rw-r--r--components/model-catalog/definition-type/starter-type/artifact_type/artifact-script-python.json2
-rw-r--r--components/model-catalog/definition-type/starter-type/node_type/component-config-generator.json2
-rw-r--r--components/model-catalog/definition-type/starter-type/node_type/component-jython-executor.json40
-rw-r--r--components/model-catalog/definition-type/starter-type/node_type/component-netconf-executor.json4
-rw-r--r--components/model-catalog/definition-type/starter-type/node_type/component-resource-assignment.json2
-rw-r--r--components/model-catalog/definition-type/starter-type/node_type/tosca.nodes.component.Jython.json5
-rw-r--r--ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/ComponentJythonExecutor.kt (renamed from ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/ComponentPythonExecutor.kt)9
-rw-r--r--ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/JythonExecutionService.kt51
-rw-r--r--ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/ComponentJythonExecutorTest.kt (renamed from ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/ComponentPythonExecutorTest.kt)10
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionService.kt2
-rw-r--r--ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/workflow/BlueprintServiceLogicTest.kt2
-rw-r--r--ms/controllerblueprints/modules/service/src/test/resources/enhance/enhance-template.json4
-rw-r--r--ms/controllerblueprints/modules/service/src/test/resources/enhance/enhanced-template.json15
23 files changed, 260 insertions, 131 deletions
diff --git a/components/core/load/model_type/node_type/component-resource-assignment.json b/components/core/load/model_type/node_type/component-resource-assignment.json
index 1389bc32..2a903561 100644
--- a/components/core/load/model_type/node_type/component-resource-assignment.json
+++ b/components/core/load/model_type/node_type/component-resource-assignment.json
@@ -7,7 +7,7 @@
}
},
"interfaces": {
- "org-onap-ccsdk-config-assignment-service-ConfigAssignmentNode": {
+ "ResourceAssignmentComponent": {
"operations": {
"process": {
"inputs": {
diff --git a/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/BluePrintConstants.kt b/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/BluePrintConstants.kt
index 84d2befc..a4128418 100644
--- a/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/BluePrintConstants.kt
+++ b/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/BluePrintConstants.kt
@@ -93,6 +93,7 @@ object BluePrintConstants {
const val MODEL_TYPE_NODES_COMPONENT_BUNDLE: String = "tosca.nodes.component.Bundle"
const val MODEL_TYPE_NODES_COMPONENT_SCRIPT: String = "tosca.nodes.component.Script"
const val MODEL_TYPE_NODES_COMPONENT_PYTHON: String = "tosca.nodes.component.Python"
+ const val MODEL_TYPE_NODES_COMPONENT_JYTHON: String = "tosca.nodes.component.Jython"
const val MODEL_TYPE_NODES_COMPONENT_JAVA_SCRIPT: String = "tosca.nodes.component.JavaScript"
const val MODEL_TYPE_ARTIFACT_TYPE_IMPLEMENTATION = "tosca.artifacts.Implementation"
diff --git a/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/BluePrintTypes.kt b/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/BluePrintTypes.kt
index a971898d..64797ed4 100644
--- a/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/BluePrintTypes.kt
+++ b/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/BluePrintTypes.kt
@@ -37,6 +37,7 @@ object BluePrintTypes {
BluePrintConstants.MODEL_TYPE_NODES_COMPONENT_BUNDLE,
BluePrintConstants.MODEL_TYPE_NODES_COMPONENT_SCRIPT,
BluePrintConstants.MODEL_TYPE_NODES_COMPONENT_PYTHON,
+ BluePrintConstants.MODEL_TYPE_NODES_COMPONENT_JYTHON,
BluePrintConstants.MODEL_TYPE_NODES_COMPONENT_JAVA_SCRIPT
)
diff --git a/components/core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt b/components/core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt
index 19c6c2f9..2f519802 100644
--- a/components/core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt
+++ b/components/core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt
@@ -69,7 +69,7 @@ class BluePrintRuntimeServiceTest {
"data/default-context.json", executionContext)
val inContext: MutableMap<String, JsonNode> = bluePrintRuntimeService.resolveNodeTemplateInterfaceOperationInputs("resource-assignment",
- "DefaultComponentNode", "process")
+ "ResourceAssignmentComponent", "process")
assertNotNull(inContext, "Failed to populate interface input property values")
assertEquals(inContext["action-name"], jsonNodeFromObject("sample-action"), "Failed to populate parameter action-name")
@@ -86,14 +86,14 @@ class BluePrintRuntimeServiceTest {
bluePrintRuntimeService.setNodeTemplateAttributeValue("resource-assignment", "assignment-params", NullNode.getInstance())
bluePrintRuntimeService.resolveNodeTemplateInterfaceOperationOutputs("resource-assignment",
- "DefaultComponentNode", "process")
+ "ResourceAssignmentComponent", "process")
val outputStatus = bluePrintRuntimeService.getNodeTemplateOperationOutputValue("resource-assignment",
- "DefaultComponentNode", "process", "status")
+ "ResourceAssignmentComponent", "process", "status")
assertEquals("success".asJsonPrimitive(), outputStatus, "Failed to get operation property status")
val outputParams = bluePrintRuntimeService.getNodeTemplateOperationOutputValue("resource-assignment",
- "DefaultComponentNode", "process", "resource-assignment-params")
+ "ResourceAssignmentComponent", "process", "resource-assignment-params")
assertEquals(NullNode.getInstance(), outputParams, "Failed to get operation property resource-assignment-params")
}
diff --git a/components/model-catalog/blueprint-model/service-blueprint/vFW/Definitions/vFW_spinup.json b/components/model-catalog/blueprint-model/service-blueprint/vFW/Definitions/vFW_spinup.json
index d5416c0e..1137c1d5 100644
--- a/components/model-catalog/blueprint-model/service-blueprint/vFW/Definitions/vFW_spinup.json
+++ b/components/model-catalog/blueprint-model/service-blueprint/vFW/Definitions/vFW_spinup.json
@@ -40,7 +40,7 @@
"resource-assignment-ra-component": {
"type": "component-resource-assignment",
"interfaces": {
- "org-onap-ccsdk-config-assignment-service-ConfigAssignmentNode": {
+ "ResourceAssignmentComponent": {
"operations": {
"process": {
"inputs": {
@@ -3337,7 +3337,7 @@
}
},
"interfaces": {
- "org-onap-ccsdk-config-assignment-service-ConfigAssignmentNode": {
+ "ResourceAssignmentComponent": {
"operations": {
"process": {
"inputs": {
diff --git a/components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Definitions/activation-blueprint.json b/components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Definitions/activation-blueprint.json
index e067a7df..269fd0cf 100644
--- a/components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Definitions/activation-blueprint.json
+++ b/components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Definitions/activation-blueprint.json
@@ -9,7 +9,13 @@
},
"imports": [
{
- "file": "Definitions/types.json"
+ "file": "Definitions/data-types.json"
+ },
+ {
+ "file": "Definitions/node-types.json"
+ },
+ {
+ "file": "Definitions/artifact-types.json"
}
],
"topology_template": {
@@ -64,7 +70,7 @@
"request-id": "1234"
},
"interfaces": {
- "DefaultComponentNode": {
+ "ResourceAssignmentComponent": {
"operations": {
"process": {
"inputs": {
@@ -121,7 +127,7 @@
"request-id": "1234"
},
"interfaces": {
- "DefaultComponentNode": {
+ "ResourceAssignmentComponent": {
"operations": {
"process": {
"implementation": {
@@ -142,7 +148,31 @@
},
"artifacts": {
"component-script": {
- "type": "artifact-script-python",
+ "type": "artifact-script-jython",
+ "file": "Scripts/SamplePythonComponentNode.py"
+ }
+ }
+ },
+ "activate-jython": {
+ "type": "component-jython-executor",
+ "interfaces": {
+ "JythonExecutorComponent": {
+ "operations": {
+ "process": {
+ "implementation": {
+ "primary": "component-script"
+ },
+ "outputs": {
+ "response-data": "",
+ "status": ""
+ }
+ }
+ }
+ }
+ },
+ "artifacts": {
+ "component-script": {
+ "type": "artifact-script-jython",
"file": "Scripts/SamplePythonComponentNode.py"
}
}
@@ -174,7 +204,7 @@
"target": "resource-assignment",
"activities": [
{
- "call_operation": "ResourceAssignmentNode.process"
+ "call_operation": "ResourceAssignmentComponent.process"
}
]
}
@@ -205,7 +235,7 @@
"target": "resource-assignment",
"activities": [
{
- "call_operation": "ResourceAssignmentNode.process"
+ "call_operation": "ResourceAssignmentComponent.process"
}
]
}
diff --git a/components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Definitions/artifact-types.json b/components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Definitions/artifact-types.json
new file mode 100644
index 00000000..d741d151
--- /dev/null
+++ b/components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Definitions/artifact-types.json
@@ -0,0 +1,45 @@
+{
+ "artifact_types": {
+ "artifact-template-velocity": {
+ "description": "Velocity Template used for Configuration",
+ "version": "1.0.0",
+ "file_ext": [
+ "vtl"
+ ],
+ "derived_from": "tosca.artifacts.Implementation"
+ },
+ "artifact-mapping-resource": {
+ "description": "Velocity Template Resource Mapping File used along with Configuration template",
+ "version": "1.0.0",
+ "file_ext": [
+ "json"
+ ],
+ "derived_from": "tosca.artifacts.Implementation"
+ },
+ "artifact-script-jython": {
+ "description": "Jython Script File",
+ "version": "1.0.0",
+ "file_ext": [
+ "py"
+ ],
+ "derived_from": "tosca.artifacts.Implementation"
+ },
+ "artifact-directed-graph": {
+ "description": "Directed Graph File",
+ "version": "1.0.0",
+ "file_ext": [
+ "json",
+ "xml"
+ ],
+ "derived_from": "tosca.artifacts.Implementation"
+ },
+ "artifact-component-jar": {
+ "description": "Component Jar",
+ "version": "1.0.0",
+ "file_ext": [
+ "jar"
+ ],
+ "derived_from": "tosca.artifacts.Implementation"
+ }
+ }
+} \ No newline at end of file
diff --git a/components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Definitions/data-types.json b/components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Definitions/data-types.json
new file mode 100644
index 00000000..6ca1ffde
--- /dev/null
+++ b/components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Definitions/data-types.json
@@ -0,0 +1,24 @@
+{
+ "data_types": {
+ "sample-property": {
+ "description": "This is sample data type",
+ "version": "1.0.0",
+ "properties": {
+ "content": {
+ "required": false,
+ "type": "string"
+ },
+ "process-name": {
+ "required": false,
+ "type": "string"
+ },
+ "version": {
+ "required": false,
+ "type": "string",
+ "default": "LATEST"
+ }
+ },
+ "derived_from": "tosca.datatypes.Root"
+ }
+ }
+} \ No newline at end of file
diff --git a/components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Definitions/types.json b/components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Definitions/node-types.json
index 056d5f18..139ebb1a 100644
--- a/components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Definitions/types.json
+++ b/components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Definitions/node-types.json
@@ -1,55 +1,4 @@
{
- "artifact_types": {
- "artifact-template-velocity": {
- "description": " Velocity Template used for Configuration",
- "version": "1.0.0",
- "file_ext": [
- "vtl"
- ],
- "derived_from": "tosca.artifacts.Implementation"
- },
- "artifact-mapping-resource": {
- "description": " Velocity Template Resource Mapping File used along with Configuration template",
- "version": "1.0.0",
- "file_ext": [
- "json"
- ],
- "derived_from": "tosca.artifacts.Implementation"
- },
- "artifact-script-kotlin": {
- "description": " Kotlin Script Template used for Configuration",
- "version": "1.0.0",
- "file_ext": [
- "kt"
- ],
- "derived_from": "tosca.artifacts.Implementation"
- },
- "artifact-script-python": {
- "description": " Kotlin Script Template used for Configuration",
- "version": "1.0.0",
- "file_ext": [
- "py"
- ],
- "derived_from": "tosca.artifacts.Implementation"
- },
- "artifact-directed-graph": {
- "description": "Directed Graph File",
- "version": "1.0.0",
- "file_ext": [
- "json",
- "xml"
- ],
- "derived_from": "tosca.artifacts.Implementation"
- },
- "artifact-component-jar": {
- "description": "Component Jar",
- "version": "1.0.0",
- "file_ext": [
- "jar"
- ],
- "derived_from": "tosca.artifacts.Implementation"
- }
- },
"node_types": {
"dg-activate": {
"description": "This is BPMN Activate node type",
@@ -81,8 +30,8 @@
"version": "1.0.0",
"derived_from": "tosca.nodes.Root"
},
- "tosca.nodes.component.Python": {
- "description": "This is Resource Assignment Python Component API",
+ "tosca.nodes.component.Jython": {
+ "description": "This is Resource Assignment Jython Component API",
"version": "1.0.0",
"derived_from": "tosca.nodes.Root"
},
@@ -97,7 +46,7 @@
}
},
"interfaces": {
- "DefaultComponentNode": {
+ "ResourceAssignmentComponent": {
"operations": {
"process": {
"inputs": {
@@ -147,33 +96,26 @@
},
"derived_from": "tosca.nodes.Component"
},
- "component-resource-assignment-python": {
- "description": "This is Resource Assignment Component API",
+ "component-jython-executor": {
+ "description": "This is Jython Execution Component.",
"version": "1.0.0",
- "properties": {
- "request-id": {
- "description": "Request Id used to store the generated configuration, in the database along with the template-name",
- "required": true,
- "type": "string"
+ "capabilities": {
+ "component-node": {
+ "type": "tosca.capabilities.Node"
}
},
"interfaces": {
- "DefaultComponentNode": {
+ "JythonExecutorComponent": {
"operations": {
"process": {
- "inputs": {
- "action-name": {
- "description": "Recipe Name to get from Database, Either (message & mask-info ) or ( resource-id & resource-type & action-name & template-name ) should be present. Message will be given higest priority",
- "required": false,
- "type": "string"
- }
- },
"outputs": {
- "resource-assignment-params": {
- "required": true,
+ "response-data": {
+ "description": "Execution Response Data in JSON format.",
+ "required": false,
"type": "string"
},
"status": {
+ "description": "Status of the Component Execution ( success or failure )",
"required": true,
"type": "string"
}
@@ -182,29 +124,7 @@
}
}
},
- "derived_from": "tosca.nodes.component.Python"
- }
- },
- "data_types": {
- "sample-property": {
- "description": "This is sample data type",
- "version": "1.0.0",
- "properties": {
- "content": {
- "required": false,
- "type": "string"
- },
- "process-name": {
- "required": false,
- "type": "string"
- },
- "version": {
- "required": false,
- "type": "string",
- "default": "LATEST"
- }
- },
- "derived_from": "tosca.datatypes.Root"
+ "derived_from": "tosca.nodes.component.Jython"
}
}
} \ No newline at end of file
diff --git a/components/model-catalog/definition-type/starter-type/artifact_type/artifact-script-jython.json b/components/model-catalog/definition-type/starter-type/artifact_type/artifact-script-jython.json
new file mode 100644
index 00000000..969662ab
--- /dev/null
+++ b/components/model-catalog/definition-type/starter-type/artifact_type/artifact-script-jython.json
@@ -0,0 +1,8 @@
+{
+ "description": "Jython Script File",
+ "version": "1.0.0",
+ "file_ext": [
+ "py"
+ ],
+ "derived_from": "tosca.artifacts.Implementation"
+} \ No newline at end of file
diff --git a/components/model-catalog/definition-type/starter-type/artifact_type/artifact-script-python.json b/components/model-catalog/definition-type/starter-type/artifact_type/artifact-script-python.json
index b48d2b62..b42f7156 100644
--- a/components/model-catalog/definition-type/starter-type/artifact_type/artifact-script-python.json
+++ b/components/model-catalog/definition-type/starter-type/artifact_type/artifact-script-python.json
@@ -1,5 +1,5 @@
{
- "description": " Kotlin Script Template used for Configuration",
+ "description": "Python Script file",
"version": "1.0.0",
"file_ext": [
"py"
diff --git a/components/model-catalog/definition-type/starter-type/node_type/component-config-generator.json b/components/model-catalog/definition-type/starter-type/node_type/component-config-generator.json
index 764f9e89..ba142600 100644
--- a/components/model-catalog/definition-type/starter-type/node_type/component-config-generator.json
+++ b/components/model-catalog/definition-type/starter-type/node_type/component-config-generator.json
@@ -7,7 +7,7 @@
}
},
"interfaces": {
- "org-openecomp-sdnc-config-generator-service-ConfigGeneratorNode": {
+ "ConfigGeneratorComponent": {
"operations": {
"process": {
"inputs": {
diff --git a/components/model-catalog/definition-type/starter-type/node_type/component-jython-executor.json b/components/model-catalog/definition-type/starter-type/node_type/component-jython-executor.json
new file mode 100644
index 00000000..4959a9dd
--- /dev/null
+++ b/components/model-catalog/definition-type/starter-type/node_type/component-jython-executor.json
@@ -0,0 +1,40 @@
+{
+ "description": "This is Jython Execution Component.",
+ "version": "1.0.0",
+ "capabilities": {
+ "component-node": {
+ "type": "tosca.capabilities.Node"
+ }
+ },
+ "interfaces": {
+ "JythonExecutorComponent": {
+ "operations": {
+ "process": {
+ "inputs": {
+ "instance-dependencies": {
+ "required": true,
+ "description": "Instance Names to Inject to Jython Script.",
+ "type": "list",
+ "entry_schema": {
+ "type": "string"
+ }
+ }
+ },
+ "outputs": {
+ "response-data": {
+ "description": "Execution Response Data in JSON format.",
+ "required": false,
+ "type": "string"
+ },
+ "status": {
+ "description": "Status of the Component Execution ( success or failure )",
+ "required": true,
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ },
+ "derived_from": "tosca.nodes.component.Jython"
+} \ No newline at end of file
diff --git a/components/model-catalog/definition-type/starter-type/node_type/component-netconf-executor.json b/components/model-catalog/definition-type/starter-type/node_type/component-netconf-executor.json
index 240caf3f..7e1d8134 100644
--- a/components/model-catalog/definition-type/starter-type/node_type/component-netconf-executor.json
+++ b/components/model-catalog/definition-type/starter-type/node_type/component-netconf-executor.json
@@ -14,7 +14,7 @@
}
},
"interfaces": {
- "org-openecomp-sdnc-netconf-adaptor-service-NetconfExecutorNode": {
+ "NetconfExecutorComponent": {
"operations": {
"process": {
"inputs": {
@@ -75,5 +75,5 @@
}
}
},
- "derived_from": "tosca.nodes.Component"
+ "derived_from": "tosca.nodes.component.Jython"
} \ No newline at end of file
diff --git a/components/model-catalog/definition-type/starter-type/node_type/component-resource-assignment.json b/components/model-catalog/definition-type/starter-type/node_type/component-resource-assignment.json
index d424a8e4..a29a875c 100644
--- a/components/model-catalog/definition-type/starter-type/node_type/component-resource-assignment.json
+++ b/components/model-catalog/definition-type/starter-type/node_type/component-resource-assignment.json
@@ -7,7 +7,7 @@
}
},
"interfaces": {
- "org-onap-ccsdk-config-assignment-service-ConfigAssignmentNode": {
+ "ResourceAssignmentComponent": {
"operations": {
"process": {
"inputs": {
diff --git a/components/model-catalog/definition-type/starter-type/node_type/tosca.nodes.component.Jython.json b/components/model-catalog/definition-type/starter-type/node_type/tosca.nodes.component.Jython.json
new file mode 100644
index 00000000..8e194f6d
--- /dev/null
+++ b/components/model-catalog/definition-type/starter-type/node_type/tosca.nodes.component.Jython.json
@@ -0,0 +1,5 @@
+{
+ "description": "This is Jython Component",
+ "version": "1.0.0",
+ "derived_from": "tosca.nodes.Root"
+} \ No newline at end of file
diff --git a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/ComponentPythonExecutor.kt b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/ComponentJythonExecutor.kt
index 823b13f2..2965cb5d 100644
--- a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/ComponentPythonExecutor.kt
+++ b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/ComponentJythonExecutor.kt
@@ -27,10 +27,10 @@ import org.onap.ccsdk.apps.controllerblueprints.core.data.OperationAssignment
import org.slf4j.LoggerFactory
import org.springframework.stereotype.Component
-@Component("component-python-executor")
-class ComponentPythonExecutor(private val pythonExecutorProperty: PythonExecutorProperty) : AbstractComponentFunction() {
+@Component("component-jython-executor")
+class ComponentJythonExecutor(private val pythonExecutorProperty: PythonExecutorProperty) : AbstractComponentFunction() {
- private val log = LoggerFactory.getLogger(ComponentPythonExecutor::class.java)
+ private val log = LoggerFactory.getLogger(ComponentJythonExecutor::class.java)
private var componentFunction: AbstractComponentFunction? = null
@@ -69,7 +69,8 @@ class ComponentPythonExecutor(private val pythonExecutorProperty: PythonExecutor
val properties: MutableMap<String, Any> = hashMapOf()
properties["log"] = log
- componentFunction = PythonExecutorUtils.getPythonComponent(pythonExecutorProperty.executionPath, pythonPath, content, pythonClassName, properties)
+ componentFunction = PythonExecutorUtils.getPythonComponent(pythonExecutorProperty.executionPath,
+ pythonPath, content, pythonClassName, properties)
componentFunction!!.process(executionServiceInput)
diff --git a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/JythonExecutionService.kt b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/JythonExecutionService.kt
new file mode 100644
index 00000000..dc372af4
--- /dev/null
+++ b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/JythonExecutionService.kt
@@ -0,0 +1,51 @@
+/*
+ * Copyright © 2017-2018 AT&T Intellectual Property.
+ *
+ * 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.
+ */
+
+package org.onap.ccsdk.apps.blueprintsprocessor.functions.python.executor
+
+import org.onap.ccsdk.apps.blueprintsprocessor.functions.python.executor.utils.PythonExecutorUtils
+import org.onap.ccsdk.apps.blueprintsprocessor.services.execution.AbstractComponentFunction
+import org.slf4j.LoggerFactory
+import org.springframework.beans.factory.annotation.Autowired
+import org.springframework.context.ApplicationContext
+import org.springframework.stereotype.Service
+
+@Service
+class JythonExecutionService(private val pythonExecutorProperty: PythonExecutorProperty) {
+
+
+ private val log = LoggerFactory.getLogger(ComponentJythonExecutor::class.java)
+
+ @Autowired
+ lateinit var applicationContext: ApplicationContext
+
+
+ fun processJythonNodeTemplate(pythonClassName: String, content: String, pythonPath: MutableList<String>,
+ jythonContextInstance: MutableMap<String, Any>,
+ dependencyInstanceNames: List<String>): AbstractComponentFunction {
+
+
+ dependencyInstanceNames.forEach { instanceName ->
+ jythonContextInstance[instanceName] = applicationContext.getBean(instanceName)
+
+ }
+
+ return PythonExecutorUtils.getPythonComponent(pythonExecutorProperty.executionPath,
+ pythonPath, content, pythonClassName, jythonContextInstance)
+
+ }
+
+} \ No newline at end of file
diff --git a/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/ComponentPythonExecutorTest.kt b/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/ComponentJythonExecutorTest.kt
index e16f2f03..1ce8d05b 100644
--- a/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/ComponentPythonExecutorTest.kt
+++ b/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/ComponentJythonExecutorTest.kt
@@ -36,10 +36,10 @@ import org.springframework.test.context.junit4.SpringRunner
["blueprints.processor.functions.python.executor.modulePaths=./../../../../components/scripts/python/ccsdk_blueprints",
"blueprints.processor.functions.python.executor.executionPath=./../../../../components/scripts/python/ccsdk_blueprints"])
-class ComponentPythonExecutorTest {
+class ComponentJythonExecutorTest {
@Autowired
- lateinit var componentPythonExecutor: ComponentPythonExecutor
+ lateinit var componentJythonExecutor: ComponentJythonExecutor
@Test
@@ -60,17 +60,17 @@ class ComponentPythonExecutorTest {
val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime(commonHeader.requestId,
"./../../../../components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration")
- componentPythonExecutor.bluePrintRuntimeService = bluePrintRuntimeService
+ componentJythonExecutor.bluePrintRuntimeService = bluePrintRuntimeService
val metaData: MutableMap<String, JsonNode> = hashMapOf()
metaData.putJsonElement(BluePrintConstants.PROPERTY_CURRENT_STEP, "resource-assignment-py")
metaData.putJsonElement(BluePrintConstants.PROPERTY_CURRENT_NODE_TEMPLATE, "resource-assignment-py")
- metaData.putJsonElement(BluePrintConstants.PROPERTY_CURRENT_INTERFACE, "DefaultComponentNode")
+ metaData.putJsonElement(BluePrintConstants.PROPERTY_CURRENT_INTERFACE, "ResourceAssignmentComponent")
metaData.putJsonElement(BluePrintConstants.PROPERTY_CURRENT_OPERATION, "process")
executionServiceInput.metadata = metaData
- componentPythonExecutor.apply(executionServiceInput)
+ componentJythonExecutor.apply(executionServiceInput)
}
} \ No newline at end of file
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionService.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionService.kt
index 155b3b03..9e735cf0 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionService.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionService.kt
@@ -47,8 +47,6 @@ class ResourceResolutionService {
resourceResolutionOutput.commonHeader = resourceResolutionInput.commonHeader
resourceResolutionOutput.resourceAssignments = resourceResolutionInput.resourceAssignments
- val context = hashMapOf<String, Any>()
-
process(resourceResolutionOutput.resourceAssignments)
val status = Status()
diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/workflow/BlueprintServiceLogicTest.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/workflow/BlueprintServiceLogicTest.kt
index 6fe767ce..9a59831f 100644
--- a/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/workflow/BlueprintServiceLogicTest.kt
+++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/workflow/BlueprintServiceLogicTest.kt
@@ -80,7 +80,7 @@ class BlueprintServiceLogicTest {
val metaData: MutableMap<String, JsonNode> = hashMapOf()
metaData.putJsonElement(BluePrintConstants.PROPERTY_CURRENT_STEP,"resource-assignment-py")
metaData.putJsonElement(BluePrintConstants.PROPERTY_CURRENT_NODE_TEMPLATE, "resource-assignment-py")
- metaData.putJsonElement(BluePrintConstants.PROPERTY_CURRENT_INTERFACE, "DefaultComponentNode")
+ metaData.putJsonElement(BluePrintConstants.PROPERTY_CURRENT_INTERFACE, "ResourceAssignmentComponent")
metaData.putJsonElement(BluePrintConstants.PROPERTY_CURRENT_OPERATION, "process")
executionServiceInput.metadata = metaData
diff --git a/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhance-template.json b/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhance-template.json
index 782ed505..b066dad6 100644
--- a/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhance-template.json
+++ b/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhance-template.json
@@ -64,7 +64,7 @@
}
},
"interfaces": {
- "org-openecomp-sdnc-netconf-adaptor-service-NetconfExecutorNode": {
+ "NetconfExecutorComponent": {
"operations": {
"process": {
"inputs": {
@@ -114,7 +114,7 @@
"component-node": {}
},
"interfaces": {
- "org-onap-ccsdk-config-assignment-service-ConfigAssignmentNode": {
+ "ResourceAssignmentComponent": {
"operations": {
"process": {
"inputs": {
diff --git a/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhanced-template.json b/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhanced-template.json
index d49ab8fe..5e41a507 100644
--- a/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhanced-template.json
+++ b/ms/controllerblueprints/modules/service/src/test/resources/enhance/enhanced-template.json
@@ -336,7 +336,7 @@
}
},
"interfaces" : {
- "org-onap-ccsdk-config-assignment-service-ConfigAssignmentNode" : {
+ "ResourceAssignmentComponent" : {
"operations" : {
"process" : {
"inputs" : {
@@ -395,6 +395,11 @@
},
"derived_from" : "tosca.nodes.Component"
},
+ "tosca.nodes.component.Jython" : {
+ "description" : "This is Jython Component",
+ "version" : "1.0.0",
+ "derived_from" : "tosca.nodes.Root"
+ },
"tosca.nodes.DG" : {
"description" : "This is Directed Graph Node Type",
"version" : "1.0.0",
@@ -548,7 +553,7 @@
}
},
"interfaces" : {
- "org-openecomp-sdnc-netconf-adaptor-service-NetconfExecutorNode" : {
+ "NetconfExecutorComponent" : {
"operations" : {
"process" : {
"inputs" : {
@@ -609,7 +614,7 @@
}
}
},
- "derived_from" : "tosca.nodes.Component"
+ "derived_from" : "tosca.nodes.component.Jython"
}
},
"topology_template" : {
@@ -671,7 +676,7 @@
}
},
"interfaces" : {
- "org-openecomp-sdnc-netconf-adaptor-service-NetconfExecutorNode" : {
+ "NetconfExecutorComponent" : {
"operations" : {
"process" : {
"implementation" : {
@@ -715,7 +720,7 @@
"component-node" : { }
},
"interfaces" : {
- "org-onap-ccsdk-config-assignment-service-ConfigAssignmentNode" : {
+ "ResourceAssignmentComponent" : {
"operations" : {
"process" : {
"inputs" : {