summaryrefslogtreecommitdiffstats
path: root/components/scripts/python
diff options
context:
space:
mode:
authorMuthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>2018-11-19 12:48:31 -0500
committerMuthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>2018-11-28 19:46:23 -0500
commit421823b343881c6d1690be8b1082a878764635f2 (patch)
tree02bc51155236cee4225d037c6bc6a010c339fbd9 /components/scripts/python
parentd05548a629e3612f3512f57390469bee392bbe18 (diff)
Implement Base Jython Executor function.
Change-Id: I3fb066a021de4a7b3aa1fce7f6c191bc3944fb51 Issue-ID: CCSDK-696 Signed-off-by: Muthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>
Diffstat (limited to 'components/scripts/python')
-rw-r--r--components/scripts/python/ccsdk_blueprints/__init__.py0
-rw-r--r--components/scripts/python/ccsdk_blueprints/abstract_blueprint_function.py11
-rw-r--r--components/scripts/python/ccsdk_blueprints/blueprint_constants.py23
-rw-r--r--components/scripts/python/ccsdk_blueprints/blueprint_runtime_service.py13
-rw-r--r--components/scripts/python/ccsdk_blueprints/sample_blueprint_component.py12
5 files changed, 59 insertions, 0 deletions
diff --git a/components/scripts/python/ccsdk_blueprints/__init__.py b/components/scripts/python/ccsdk_blueprints/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/components/scripts/python/ccsdk_blueprints/__init__.py
diff --git a/components/scripts/python/ccsdk_blueprints/abstract_blueprint_function.py b/components/scripts/python/ccsdk_blueprints/abstract_blueprint_function.py
new file mode 100644
index 000000000..0ddab16e7
--- /dev/null
+++ b/components/scripts/python/ccsdk_blueprints/abstract_blueprint_function.py
@@ -0,0 +1,11 @@
+from org.onap.ccsdk.apps.blueprintsprocessor.services.execution import AbstractComponentFunction
+
+class AbstractPythonComponentFunction(AbstractComponentFunction):
+
+ def process(self, execution_request):
+ print "Processing calling.."
+ return None
+
+ def recover(self, runtime_exception, execution_request):
+ print "Recovering calling.."
+ return None
diff --git a/components/scripts/python/ccsdk_blueprints/blueprint_constants.py b/components/scripts/python/ccsdk_blueprints/blueprint_constants.py
new file mode 100644
index 000000000..2ec95f312
--- /dev/null
+++ b/components/scripts/python/ccsdk_blueprints/blueprint_constants.py
@@ -0,0 +1,23 @@
+
+PROPERTY_BLUEPRINT_PROCESS_ID= "blueprint-process-id"
+PROPERTY_BLUEPRINT_BASE_PATH= "blueprint-basePath"
+PROPERTY_BLUEPRINT_RUNTIME= "blueprint-runtime"
+PROPERTY_BLUEPRINT_INPUTS_DATA= "blueprint-inputs-data"
+PROPERTY_BLUEPRINT_CONTEXT= "blueprint-context"
+PROPERTY_BLUEPRINT_NAME= "template_name"
+PROPERTY_BLUEPRINT_VERSION= "template_version"
+
+METADATA_USER_GROUPS = "user-groups"
+METADATA_TEMPLATE_NAME = "template_name"
+METADATA_TEMPLATE_VERSION = "template_version"
+METADATA_TEMPLATE_AUTHOR = "template_author"
+METADATA_TEMPLATE_TAGS = "template_tags"
+METADATA_WORKFLOW_NAME = "workflow_name"
+
+PAYLOAD_DATA = "payload-data"
+PROPERTY_CURRENT_STEP = "current-step"
+PROPERTY_CURRENT_NODE_TEMPLATE = "current-node-template"
+PROPERTY_CURRENT_INTERFACE = "current-interface"
+PROPERTY_CURRENT_OPERATION = "current-operation"
+PROPERTY_CURRENT_IMPLEMENTATION = "current-implementation"
+PROPERTY_EXECUTION_REQUEST = "execution-request"
diff --git a/components/scripts/python/ccsdk_blueprints/blueprint_runtime_service.py b/components/scripts/python/ccsdk_blueprints/blueprint_runtime_service.py
new file mode 100644
index 000000000..022b47244
--- /dev/null
+++ b/components/scripts/python/ccsdk_blueprints/blueprint_runtime_service.py
@@ -0,0 +1,13 @@
+class BluePrintRuntimeService:
+
+ def __init__(self, bps):
+ self.bps = bps
+
+ def resolveNodeTemplateArtifact(self, node_template_name, artifact_name):
+ return self.bps.resolveNodeTemplateArtifact(node_template_name, artifact_name)
+
+ def setNodeTemplateAttributeValue(self, nodeTemplateName, attributeName, value):
+ return self.bps.setNodeTemplateAttributeValue(nodeTemplateName, attributeName, value)
+
+ def setNodeTemplatePropertyValue(self, nodeTemplateName, propertyName, value):
+ return self.bps.setNodeTemplatePropertyValue(nodeTemplateName, propertyName, value)
diff --git a/components/scripts/python/ccsdk_blueprints/sample_blueprint_component.py b/components/scripts/python/ccsdk_blueprints/sample_blueprint_component.py
new file mode 100644
index 000000000..62665dc8f
--- /dev/null
+++ b/components/scripts/python/ccsdk_blueprints/sample_blueprint_component.py
@@ -0,0 +1,12 @@
+from abstract_blueprint_function import AbstractPythonComponentFunction
+from blueprint_constants import *
+
+class SampleBlueprintComponent(AbstractPythonComponentFunction):
+
+ def process(self, execution_request):
+ print "Processing calling.." + PROPERTY_BLUEPRINT_BASE_PATH
+ return None
+
+ def recover(self, runtime_exception, execution_request):
+ print "Recovering calling.." + PROPERTY_BLUEPRINT_BASE_PATH
+ return None