aboutsummaryrefslogtreecommitdiffstats
path: root/components/model-catalog/blueprint-model/starter-blueprint
diff options
context:
space:
mode:
Diffstat (limited to 'components/model-catalog/blueprint-model/starter-blueprint')
-rw-r--r--components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Definitions/activation-blueprint.json70
-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/baseconfig-mapping.json (renamed from components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Mappings/baseconfig-mapping.json)0
-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/blueprint-model/starter-blueprint/baseconfiguration/Definitions/resources_dictionaty_types.json3
-rw-r--r--components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Plans/CONFIG_ActivateNetconf_1.0.0.xml34
-rw-r--r--components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Scripts/SamplePythonComponentNode.py14
8 files changed, 188 insertions, 110 deletions
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 ee02b3a7..04e0efce 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": {
@@ -54,7 +60,7 @@
"artifacts": {
"dg-activate-process": {
"type": "artifact-directed-graph",
- "file": "Plans/ActivateProcess.bpmn"
+ "file": "Plans/CONFIG_ActivateNetconf_1.0.0.xml"
}
}
},
@@ -64,7 +70,7 @@
"request-id": "1234"
},
"interfaces": {
- "DefaultComponentNode": {
+ "ResourceAssignmentComponent": {
"operations": {
"process": {
"inputs": {
@@ -111,7 +117,7 @@
},
"baseconfig-mapping": {
"type": "artifact-mapping-resource",
- "file": "Mappings/baseconfig-mapping.json"
+ "file": "Definitions/baseconfig-mapping.json"
}
}
},
@@ -121,7 +127,7 @@
"request-id": "1234"
},
"interfaces": {
- "DefaultComponentNode": {
+ "ResourceAssignmentComponent": {
"operations": {
"process": {
"implementation": {
@@ -142,8 +148,32 @@
},
"artifacts": {
"component-script": {
- "type": "artifact-script-python",
- "file": "Scripts/baseconfig-template.vtl"
+ "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,20 +204,38 @@
"target": "resource-assignment",
"activities": [
{
- "call_operation": "ResourceAssignmentNode.process"
+ "call_operation": "ResourceAssignmentComponent.process"
}
]
}
}
},
"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": {
+ "activate-process": {
"description": "Netconf Activation Workflow",
- "target": "resource-assignment",
+ "target": "activate-process",
"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/Mappings/baseconfig-mapping.json b/components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Definitions/baseconfig-mapping.json
index caee773b..caee773b 100644
--- a/components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Mappings/baseconfig-mapping.json
+++ b/components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Definitions/baseconfig-mapping.json
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/blueprint-model/starter-blueprint/baseconfiguration/Definitions/resources_dictionaty_types.json b/components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Definitions/resources_dictionaty_types.json
new file mode 100644
index 00000000..0e0dcd23
--- /dev/null
+++ b/components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Definitions/resources_dictionaty_types.json
@@ -0,0 +1,3 @@
+{
+
+} \ No newline at end of file
diff --git a/components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Plans/CONFIG_ActivateNetconf_1.0.0.xml b/components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Plans/CONFIG_ActivateNetconf_1.0.0.xml
new file mode 100644
index 00000000..d256bbd2
--- /dev/null
+++ b/components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Plans/CONFIG_ActivateNetconf_1.0.0.xml
@@ -0,0 +1,34 @@
+<!--
+ ~ 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.
+ -->
+
+<service-logic
+ xmlns='http://www.onap.org/sdnc/svclogic'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='CONFIG' version='1.0.0'>
+ <method rpc='ActivateNetconf' mode='sync'>
+ <block atomic="true">
+ <execute plugin="resource-assignment" method="process">
+ <outcome value='failure'>
+ <return status="failure">
+ </return>
+ </outcome>
+ <outcome value='success'>
+ <return status='success'>
+ </return>
+ </outcome>
+ </execute>
+ </block>
+ </method>
+</service-logic> \ No newline at end of file
diff --git a/components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Scripts/SamplePythonComponentNode.py b/components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Scripts/SamplePythonComponentNode.py
index fc515133..0a583dc5 100644
--- a/components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Scripts/SamplePythonComponentNode.py
+++ b/components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Scripts/SamplePythonComponentNode.py
@@ -1,8 +1,12 @@
-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