\r
fun resolveNodeTemplateArtifact(nodeTemplateName: String, artifactName: String): String\r
\r
+ fun resolveNodeTemplateArtifactDefinition(nodeTemplateName: String, artifactName: String): ArtifactDefinition\r
+\r
fun setInputValue(propertyName: String, propertyDefinition: PropertyDefinition, value: JsonNode)\r
\r
fun setWorkflowInputValue(workflowName: String, propertyName: String, propertyDefinition: PropertyDefinition, value: JsonNode)\r
return propertyAssignmentValue\r
}\r
\r
- override fun resolveNodeTemplateArtifact(nodeTemplateName: String,\r
- artifactName: String): String {\r
+ override fun resolveNodeTemplateArtifact(nodeTemplateName: String, artifactName: String): String {\r
+ val artifactDefinition: ArtifactDefinition = resolveNodeTemplateArtifactDefinition(nodeTemplateName, artifactName)\r
+ val propertyAssignmentExpression = PropertyAssignmentService(this)\r
+ return propertyAssignmentExpression.artifactContent(artifactDefinition)\r
+ }\r
+\r
+ override fun resolveNodeTemplateArtifactDefinition(nodeTemplateName: String, artifactName: String): ArtifactDefinition {\r
val nodeTemplate = bluePrintContext.nodeTemplateByName(nodeTemplateName)\r
\r
- val artifactDefinition: ArtifactDefinition = nodeTemplate.artifacts?.get(artifactName)\r
+ return nodeTemplate.artifacts?.get(artifactName)\r
?: throw BluePrintProcessorException(String.format("failed to get artifat definition {} from the node template"\r
, artifactName))\r
- val propertyAssignmentExpression = PropertyAssignmentService(this)\r
- return propertyAssignmentExpression.artifactContent(artifactDefinition)\r
+\r
}\r
\r
\r
"artifacts": {
"component-script": {
"type": "artifact-script-python",
- "file": "Scripts/baseconfig-template.vtl"
+ "file": "Scripts/SamplePythonComponentNode.py"
}
}
}
}
},
"activate": {
+ "inputs": {
+ "request-id": {
+ "required": true,
+ "type": "string"
+ },
+ "action-name": {
+ "required": true,
+ "type": "string"
+ },
+ "scope-type": {
+ "required": true,
+ "type": "string"
+ },
+ "hostname": {
+ "required": true,
+ "type": "string"
+ }
+ },
"steps": {
"call-resource-assignment": {
"description": "Netconf Activation Workflow",
-from com.brvith.orchestrator.core.interfaces import ComponentNode
+from abstract_blueprint_function import AbstractPythonComponentFunction
+from blueprint_constants import *
-class SamplePythonComponentNode(ComponentNode):
- def prepare(self, context, componentContext):
+class SamplePythonComponentNode(AbstractPythonComponentFunction):
+
+ def process(self, execution_request):
+ print "Processing calling.." + PROPERTY_BLUEPRINT_BASE_PATH
return None
- def prepare(self, context, componentContext):
- return None
\ No newline at end of file
+ def recover(self, runtime_exception, execution_request):
+ print "Recovering calling.." + PROPERTY_BLUEPRINT_BASE_PATH
+ return None
--- /dev/null
+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
--- /dev/null
+
+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"
--- /dev/null
+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)
--- /dev/null
+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