From b35d55e3f57630551f0b773674bd1f5c44585ede Mon Sep 17 00:00:00 2001 From: "Singal, Kapil (ks220y)" Date: Thu, 9 Aug 2018 20:47:29 +0000 Subject: Controller Blueprints MS Creating the base directory structure for Controller Blueprints MicroService Change-Id: I1ccf7fc76446048af3b2822f9155bb634657aee3 Issue-ID: CCSDK-410 Signed-off-by: Singal, Kapil (ks220y) --- .../Definitions/sample-nodetype.json | 34 ++ .../Definitions/simple-baseconfig.json | 345 +++++++++++++++++++++ .../Mappings/baseconfig-mapping.json | 3 + .../simple-baseconfig/Plans/ActivateProcess.bpmn | 66 ++++ .../Scripts/SamplePythonComponentNode.py | 8 + .../simple-baseconfig/Scripts/__init__.py | 0 .../simple-baseconfig/TOSCA-Metadata/TOSCA.meta | 8 + .../Templates/base-config-template.vtl | 40 +++ .../Templates/baseconfig-template.vtl | 1 + .../Templates/licence-template.vtl | 4 + .../load/blueprints/simple-baseconfig/__init__.py | 0 11 files changed, 509 insertions(+) create mode 100644 ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Definitions/sample-nodetype.json create mode 100644 ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Definitions/simple-baseconfig.json create mode 100644 ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Mappings/baseconfig-mapping.json create mode 100644 ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Plans/ActivateProcess.bpmn create mode 100644 ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Scripts/SamplePythonComponentNode.py create mode 100644 ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Scripts/__init__.py create mode 100644 ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/TOSCA-Metadata/TOSCA.meta create mode 100644 ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Templates/base-config-template.vtl create mode 100644 ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Templates/baseconfig-template.vtl create mode 100644 ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Templates/licence-template.vtl create mode 100644 ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/__init__.py (limited to 'ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig') diff --git a/ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Definitions/sample-nodetype.json b/ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Definitions/sample-nodetype.json new file mode 100644 index 000000000..6d469ea84 --- /dev/null +++ b/ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Definitions/sample-nodetype.json @@ -0,0 +1,34 @@ +{ + "description": "This is Resource Assignment Component API", + "version": "1.0.0", + "properties": { + "type": { + "description": "Request Id used to store the generated configuration, in the database along with the template-name", + "required": false, + "type": "string" + } + }, + "interfaces": { + "DefaultOperation": { + "operations": { + "validate": { + "inputs": { + "action-name": { + "description": "validate for action", + "required": false, + "type": "string" + } + } + } + } + } + }, + "artifacts" :{ + "component-jar": { + "description": "Component Jar", + "type": "artifact-component-jar", + "file": "Component/basecomponent.jar" + } + }, + "derived_from": "tosca.nodes.Root" +} \ No newline at end of file diff --git a/ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Definitions/simple-baseconfig.json b/ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Definitions/simple-baseconfig.json new file mode 100644 index 000000000..e78f32f02 --- /dev/null +++ b/ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Definitions/simple-baseconfig.json @@ -0,0 +1,345 @@ +{ + "metadata": { + "template_author": "Brinda Santh", + "template_name": "simple-baseconfig", + "template_version": "1.0.0", + "service-type": "Sample Service", + "release": "1806", + "vnf-type": "VPE" + }, + "topology_template": { + "inputs": { + "request-id": { + "required": true, + "type": "string" + }, + "service-instance-id": { + "required": true, + "type": "string" + }, + "scope-type": { + "required": true, + "type": "string" + }, + "action-name": { + "required": true, + "type": "string" + }, + "hostname": { + "required": true, + "type": "string" + } + }, + "node_templates": { + "vpe-netconf-device": { + "capabilities": { + "netconf": { + "properties": { + "login-key": "sdnc", + "login-account": "sndc-local", + "source": "local", + "target-ip-address": "{\"get_attribute\":\"lo0-local-ipv4-address\"}", + "port-number": 22, + "connection-time-out": 30 + } + } + }, + "type": "vnf-netconf-device" + }, + "activate-netconf-component": { + "capabilities": { + "component-node": {} + }, + "requirements": { + "netconf-connection": { + "capability": "netconf", + "node": "vpe-netconf-device", + "relationship": "tosca.relationships.ConnectsTo" + } + }, + "interfaces": { + "org-openecomp-sdnc-netconf-adaptor-service-NetconfExecutorNode": { + "operations": { + "process": { + "inputs": { + "action-name": "{ \"get_input\" : \"action-name\" }", + "service-template-name": "{ \"get_attribute\" : \"template_name\" }", + "service-template-version": "{ \"get_attribute\" : \"service-template-version\" }", + "resource-type": "vnf-type", + "request-id": "{ \"get_input\" : \"request-id\" }", + "resource-id": "{ \"get_input\" : \"hostname\" }", + "execution-script": "execution-script" + }, + "outputs": { + "response-data": "{ \"get_attribute\" : \"netconf-executor-baseconfig.response-data\" }", + "status": "{ \"get_attribute\" : \"netconf-executor-baseconfig.status\" }" + }, + "implementation" : { + "primary" : "file://netconf_adaptor/DefaultBaseLicenceConfig.py" + } + } + } + } + }, + "type": "component-netconf-executor" + }, + "resource-assignment-ra-component": { + "capabilities": { + "component-node": {} + }, + "interfaces": { + "org-openecomp-sdnc-config-assignment-service-ConfigAssignmentNode": { + "operations": { + "process": { + "inputs": { + "template-names": [ + "base-config-template", + "licence-template" + ], + "action-name": "{ \"get_input\" : \"action-name\" }", + "service-template-name": "{ \"get_attribute\" : \"template_name\" }", + "service-template-version": "{ \"get_attribute\" : \"service-template-version\" }", + "resource-type": "vnf-type", + "request-id": "{ \"get_input\" : \"request-id\" }", + "resource-id": "{ \"get_input\" : \"hostname\" }" + }, + "outputs": { + "resource-assignment-params": "success", + "status": "status" + } + } + } + } + }, + "type": "component-resource-assignment" + }, + "resource-assignment-action": { + "properties": { + "mode": "sync", + "version": "LATEST", + "is-start-flow": "false" + }, + "requirements": { + "component-dependency": { + "capability": "component-node", + "node": "resource-assignment-ra-component", + "relationship": "tosca.relationships.DependsOn" + } + }, + "capabilities": { + "dg-node": {}, + "content": { + "properties": { + "type": "json" + } + } + }, + "interfaces": { + "CONFIG": { + "operations": { + "ResourceAssignment": { + "inputs": { + "params": [] + } + } + } + } + }, + "type": "dg-resource-assignment" + }, + "activate-action": { + "properties": { + "mode": "sync", + "version": "LATEST", + "is-start-flow": "false" + }, + "requirements": { + "component-dependency": { + "capability": "component-node", + "node": "activate-netconf-component", + "relationship": "tosca.relationships.DependsOn" + } + }, + "capabilities": { + "dg-node": {}, + "content": { + "properties": { + "type": "json" + } + } + }, + "interfaces": { + "CONFIG": { + "operations": { + "ActivateNetconf": { + "inputs": { + "params": [] + } + } + } + } + }, + "type": "dg-activate-netconf" + }, + "base-config-template": { + "capabilities": { + "content": { + "properties": { + "content": "db://base-config-template" + } + }, + "mapping": { + "properties": { + "mapping": [ + { + "name": "bundle-mac", + "property": { + "description": "", + "required": true, + "type": "string", + "status": "", + "constraints": [ + {} + ], + "entry_schema": { + "type": "" + } + }, + "input-param": false, + "dictionary-name": "bundle-mac", + "dictionary-source": "db", + "dependencies": [ + "hostname" + ], + "version": 0 + }, + { + "name": "wan-aggregate-ipv4-addresses", + "property": { + "description": "", + "required": true, + "type": "list", + "status": "", + "constraints": [ + {} + ], + "entry_schema": { + "type": "dt-v4-aggregate" + } + }, + "input-param": false, + "dictionary-name": "wan-aggregate-ipv4-addresses", + "dictionary-source": "mdsal", + "dependencies": [ + "service-instance-id", + "oam-network-role", + "oam-v4-ip-type ", + "oam-vm-type" + ], + "version": 0 + }, + { + "name": "hostname", + "property": { + "required": true, + "type": "string" + }, + "dictionary-name": "hostname", + "dictionary-source": "input", + "version": 0, + "input-param": false + }, + { + "name": "service", + "property": { + "required": true, + "type": "string" + }, + "dictionary-name": "service", + "dictionary-source": "input", + "version": 0, + "input-param": false + }, + { + "name": "service-instance-id", + "property": { + "required": true, + "type": "string" + }, + "dictionary-name": "service-instance-id", + "dictionary-source": "input", + "version": 0, + "input-param": false + } + ] + } + } + }, + "properties": { + "action-names": [ + "resource-assignment-action" + ] + }, + "type": "artifact-config-template" + }, + "licence-template": { + "capabilities": { + "content": { + "properties": { + "content": "db://licence-template" + } + }, + "mapping": { + "properties": { + "mapping": [ + { + "name": "licenses", + "property": { + "description": "", + "required": true, + "type": "list", + "status": "", + "constraints": [ + {} + ], + "entry_schema": { + "type": "dt-license-key" + } + }, + "input-param": false, + "dictionary-name": "licenses", + "dictionary-source": "mdsal", + "dependencies": [ + "service-instance-id" + ], + "version": 0 + }, + { + "name": "service-instance-id", + "property": { + "required": true, + "type": "string" + }, + "dictionary-name": "service-instance-id", + "dictionary-source": "input", + "version": 0, + "input-param": false + } + ] + } + } + }, + "properties": { + "action-names": [ + "resource-assignment-action" + ] + }, + "type": "artifact-config-template" + } + } + }, + "node_types": { + }, + "data_types": { + } +} \ No newline at end of file diff --git a/ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Mappings/baseconfig-mapping.json b/ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Mappings/baseconfig-mapping.json new file mode 100644 index 000000000..6abfb51bd --- /dev/null +++ b/ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Mappings/baseconfig-mapping.json @@ -0,0 +1,3 @@ +{ + "assignments": "Sample Assignments" +} \ No newline at end of file diff --git a/ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Plans/ActivateProcess.bpmn b/ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Plans/ActivateProcess.bpmn new file mode 100644 index 000000000..5e94c0f8e --- /dev/null +++ b/ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Plans/ActivateProcess.bpmn @@ -0,0 +1,66 @@ + + + + + SequenceFlow_0l0dq58 + + + SequenceFlow_1ay0k6p + + + + + + + + + + SequenceFlow_0l0dq58 + SequenceFlow_1ay0k6p + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Scripts/SamplePythonComponentNode.py b/ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Scripts/SamplePythonComponentNode.py new file mode 100644 index 000000000..eb198c79a --- /dev/null +++ b/ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Scripts/SamplePythonComponentNode.py @@ -0,0 +1,8 @@ +from com.brvith.orchestrator.core.interfaces import ComponentNode + +class SamplePythonComponentNode(ComponentNode): + def prepare(self, context, componentContext): + return None + + def prepare(self, context, componentContext): + return None \ No newline at end of file diff --git a/ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Scripts/__init__.py b/ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Scripts/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/TOSCA-Metadata/TOSCA.meta b/ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/TOSCA-Metadata/TOSCA.meta new file mode 100644 index 000000000..d7ae5e8a2 --- /dev/null +++ b/ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/TOSCA-Metadata/TOSCA.meta @@ -0,0 +1,8 @@ +TOSCA-Meta-File-Version: 1.0.0 +CSAR-Version: 1.0 +Created-By: Brinda Santh M +Entry-Definitions: Definitions/simple-baseconfig.json +Template-Tags: vrr-test, Brinda Santh + +Name: Plans/ActivateProcess.bpmn +Content-Type: application/vnd.oasis.bpmn diff --git a/ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Templates/base-config-template.vtl b/ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Templates/base-config-template.vtl new file mode 100644 index 000000000..92dba1024 --- /dev/null +++ b/ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Templates/base-config-template.vtl @@ -0,0 +1,40 @@ + + + + ${group-name} + + + <*> + + + + + + 224.0.1.40/32 + + + 224.0.1.39/32 + + + 224.0.0.0/4 + + + + + + + + + + <*> + + 1000 + + + + + + + + + \ No newline at end of file diff --git a/ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Templates/baseconfig-template.vtl b/ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Templates/baseconfig-template.vtl new file mode 100644 index 000000000..026c59176 --- /dev/null +++ b/ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Templates/baseconfig-template.vtl @@ -0,0 +1 @@ +This is Sample Velocity Template \ No newline at end of file diff --git a/ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Templates/licence-template.vtl b/ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Templates/licence-template.vtl new file mode 100644 index 000000000..626974f27 --- /dev/null +++ b/ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/Templates/licence-template.vtl @@ -0,0 +1,4 @@ + + + + diff --git a/ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/__init__.py b/ms/controllerblueprints/modules/core/load/blueprints/simple-baseconfig/__init__.py new file mode 100644 index 000000000..e69de29bb -- cgit 1.2.3-korg