From 888204b28fb634a56c56adc3ec28c2c7ce1ff4ad Mon Sep 17 00:00:00 2001 From: Alexis de Talhouët Date: Fri, 19 Oct 2018 14:43:45 -0400 Subject: Assign image keyname and pubkey at vnf level MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I7eb4b47a9440e277a510864f2bb52323e464da5a Issue-ID: CCSDK-621 Signed-off-by: Alexis de Talhouët (cherry picked from commit f39904fbe580301b896ad598e85a135d11c8944b) --- .../blueprints/vFW/Definitions/vFW_spinup.json | 326 ++++++++++++++++++++- .../blueprints/vFW/Templates/base_template.vtl | 12 +- .../blueprints/vFW/Templates/vFW_vNF_Artifact.vtl | 24 +- .../load/blueprints/vFW/Templates/vfw.vtl | 12 +- .../load/blueprints/vFW/Templates/vpg.vtl | 18 +- .../load/blueprints/vFW/Templates/vsn.vtl | 18 +- .../load/resource_dictionary/image_name.json | 33 +++ .../load/resource_dictionary/key_name.json | 33 +++ .../load/resource_dictionary/pub_key.json | 34 +++ 9 files changed, 462 insertions(+), 48 deletions(-) create mode 100755 ms/controllerblueprints/application/load/resource_dictionary/image_name.json create mode 100755 ms/controllerblueprints/application/load/resource_dictionary/key_name.json create mode 100755 ms/controllerblueprints/application/load/resource_dictionary/pub_key.json diff --git a/ms/controllerblueprints/application/load/blueprints/vFW/Definitions/vFW_spinup.json b/ms/controllerblueprints/application/load/blueprints/vFW/Definitions/vFW_spinup.json index 3cfa6f779..d5416c0ea 100644 --- a/ms/controllerblueprints/application/load/blueprints/vFW/Definitions/vFW_spinup.json +++ b/ms/controllerblueprints/application/load/blueprints/vFW/Definitions/vFW_spinup.json @@ -221,7 +221,8 @@ ], "version": 0 - },{ + }, + { "name": "onap_private_net_id", "property": { "description": "", @@ -269,6 +270,80 @@ ], "version": 0 }, + { + "name": "key_name", + "property": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + { + + } + ], + "entry_schema": { + "type": "" + } + }, + "input-param": false, + "dictionary-name": "key_name", + "dictionary-source": "input", + "dependencies": [ + + ], + "version": 0 + }, + { + "name": "image_name", + "property": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + { + + } + ], + "entry_schema": { + "type": "" + }, + "default": "Ubuntu 14.04 LTS Generic" + }, + "input-param": false, + "dictionary-name": "image_name", + "dictionary-source": "input", + "dependencies": [ + + ], + "version": 0 + }, + { + "name": "pub_key", + "property": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + { + + } + ], + "entry_schema": { + "type": "" + }, + "default": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKXDgoo3+WOqcUG8/5uUbk81+yczgwC4Y8ywTmuQqbNxlY1oQ0YxdMUqUnhitSXs5S/yRuAVOYHwGg2mCs20oAINrP+mxBI544AMIb9itPjCtgqtE2EWo6MmnFGbHB4Sx3XioE7F4VPsh7japsIwzOjbrQe+Mua1TGQ5d4nfEOQaaglXLLPFfuc7WbhbJbK6Q7rHqZfRcOwAMXgDoBqlyqKeiKwnumddo2RyNT8ljYmvB6buz7KnMinzo7qB0uktVT05FH9Rg0CTWH5norlG5qXgP2aukL0gk1ph8iAt7uYLf1ktp+LJI2gaF6L0/qli9EmVCSLr1uJ38Q8CBflhkh" + }, + "input-param": false, + "dictionary-name": "pub_key", + "dictionary-source": "input", + "dependencies": [ + + ], + "version": 0 + }, { "name": "vnf_name", "property": { @@ -889,6 +964,81 @@ ], "version": 0 }, + { + "name": "image_name", + "property": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + { + + } + ], + "entry_schema": { + "type": "" + } + }, + "input-param": false, + "dictionary-name": "image_name", + "dictionary-source": "mdsal", + "dependencies": [ + "service-instance-id", + "vnf-id" + ], + "version": 0 + }, + { + "name": "key_name", + "property": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + { + + } + ], + "entry_schema": { + "type": "" + } + }, + "input-param": false, + "dictionary-name": "key_name", + "dictionary-source": "mdsal", + "dependencies": [ + "service-instance-id", + "vnf-id" + ], + "version": 0 + }, + { + "name": "pub_key", + "property": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + { + + } + ], + "entry_schema": { + "type": "" + } + }, + "input-param": false, + "dictionary-name": "pub_key", + "dictionary-source": "mdsal", + "dependencies": [ + "service-instance-id", + "vnf-id" + ], + "version": 0 + }, { "name": "onap_private_net_id", "property": { @@ -909,8 +1059,8 @@ "dictionary-name": "onap_private_net_id", "dictionary-source": "mdsal", "dependencies": [ - "service-instance-id", - "vnf-id" + "service-instance-id", + "vnf-id" ], "version": 0 }, @@ -934,8 +1084,8 @@ "dictionary-name": "onap_private_subnet_id", "dictionary-source": "mdsal", "dependencies": [ - "service-instance-id", - "vnf-id" + "service-instance-id", + "vnf-id" ], "version": 0 }, @@ -1609,6 +1759,81 @@ ], "version": 0 }, + { + "name": "image_name", + "property": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + { + + } + ], + "entry_schema": { + "type": "" + } + }, + "input-param": false, + "dictionary-name": "image_name", + "dictionary-source": "mdsal", + "dependencies": [ + "service-instance-id", + "vnf-id" + ], + "version": 0 + }, + { + "name": "key_name", + "property": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + { + + } + ], + "entry_schema": { + "type": "" + } + }, + "input-param": false, + "dictionary-name": "key_name", + "dictionary-source": "mdsal", + "dependencies": [ + "service-instance-id", + "vnf-id" + ], + "version": 0 + }, + { + "name": "pub_key", + "property": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + { + + } + ], + "entry_schema": { + "type": "" + } + }, + "input-param": false, + "dictionary-name": "pub_key", + "dictionary-source": "mdsal", + "dependencies": [ + "service-instance-id", + "vnf-id" + ], + "version": 0 + }, { "name": "onap_private_net_id", "property": { @@ -1629,8 +1854,8 @@ "dictionary-name": "onap_private_net_id", "dictionary-source": "mdsal", "dependencies": [ - "service-instance-id", - "vnf-id" + "service-instance-id", + "vnf-id" ], "version": 0 }, @@ -1654,8 +1879,8 @@ "dictionary-name": "onap_private_subnet_id", "dictionary-source": "mdsal", "dependencies": [ - "service-instance-id", - "vnf-id" + "service-instance-id", + "vnf-id" ], "version": 0 }, @@ -2331,6 +2556,31 @@ ], "version": 0 }, + { + "name": "image_name", + "property": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + { + + } + ], + "entry_schema": { + "type": "" + } + }, + "input-param": false, + "dictionary-name": "image_name", + "dictionary-source": "mdsal", + "dependencies": [ + "service-instance-id", + "vnf-id" + ], + "version": 0 + }, { "name": "public_net_id", "property": { @@ -2357,6 +2607,56 @@ ], "version": 0 }, + { + "name": "key_name", + "property": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + { + + } + ], + "entry_schema": { + "type": "" + } + }, + "input-param": false, + "dictionary-name": "key_name", + "dictionary-source": "mdsal", + "dependencies": [ + "service-instance-id", + "vnf-id" + ], + "version": 0 + }, + { + "name": "pub_key", + "property": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + { + + } + ], + "entry_schema": { + "type": "" + } + }, + "input-param": false, + "dictionary-name": "pub_key", + "dictionary-source": "mdsal", + "dependencies": [ + "service-instance-id", + "vnf-id" + ], + "version": 0 + }, { "name": "onap_private_net_id", "property": { @@ -2377,8 +2677,8 @@ "dictionary-name": "onap_private_net_id", "dictionary-source": "mdsal", "dependencies": [ - "service-instance-id", - "vnf-id" + "service-instance-id", + "vnf-id" ], "version": 0 }, @@ -2402,8 +2702,8 @@ "dictionary-name": "onap_private_subnet_id", "dictionary-source": "mdsal", "dependencies": [ - "service-instance-id", - "vnf-id" + "service-instance-id", + "vnf-id" ], "version": 0 }, diff --git a/ms/controllerblueprints/application/load/blueprints/vFW/Templates/base_template.vtl b/ms/controllerblueprints/application/load/blueprints/vFW/Templates/base_template.vtl index a5a8ff020..1f8298c5f 100644 --- a/ms/controllerblueprints/application/load/blueprints/vFW/Templates/base_template.vtl +++ b/ms/controllerblueprints/application/load/blueprints/vFW/Templates/base_template.vtl @@ -24,14 +24,6 @@ "param-name": "vf_module_type", "param-value": "${vf-module-type}" }, - { - "param-name": "key_name", - "param-value": "${nf-role}_key" - }, - { - "param-name": "pub_key", - "param-value": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKXDgoo3+WOqcUG8/5uUbk81+yczgwC4Y8ywTmuQqbNxlY1oQ0YxdMUqUnhitSXs5S/yRuAVOYHwGg2mCs20oAINrP+mxBI544AMIb9itPjCtgqtE2EWo6MmnFGbHB4Sx3XioE7F4VPsh7japsIwzOjbrQe+Mua1TGQ5d4nfEOQaaglXLLPFfuc7WbhbJbK6Q7rHqZfRcOwAMXgDoBqlyqKeiKwnumddo2RyNT8ljYmvB6buz7KnMinzo7qB0uktVT05FH9Rg0CTWH5norlG5qXgP2aukL0gk1ph8iAt7uYLf1ktp+LJI2gaF6L0/qli9EmVCSLr1uJ38Q8CBflhkh" - }, { "param-name": "unprotected_private_net_id", "param-value": "${vnf-name}_unprotected" @@ -46,11 +38,11 @@ }, { "param-name": "protected_private_net_id", - "param-value": "${vnf-name}_protected_private_net_id" + "param-value": "${vnf-name}_protected" }, { "param-name": "protected_private_subnet_id", - "param-value": "${vnf-name}_protected_private_subnet_id" + "param-value": "${vnf-name}_protected_sub" }, { "param-name": "protected_private_net_cidr", diff --git a/ms/controllerblueprints/application/load/blueprints/vFW/Templates/vFW_vNF_Artifact.vtl b/ms/controllerblueprints/application/load/blueprints/vFW/Templates/vFW_vNF_Artifact.vtl index f25e95608..ca09046aa 100644 --- a/ms/controllerblueprints/application/load/blueprints/vFW/Templates/vFW_vNF_Artifact.vtl +++ b/ms/controllerblueprints/application/load/blueprints/vFW/Templates/vFW_vNF_Artifact.vtl @@ -20,6 +20,14 @@ "param-name": "onap_private_net_id", "param-value": "${onap_private_net_id}" }, + { + "param-name": "pub_key", + "param-value": "${pub_key}" + }, + { + "param-name": "image_name", + "param-value": "${image_name}" + }, { "param-name": "onap_private_subnet_id", "param-value": "${onap_private_net_id}_sub" @@ -149,7 +157,8 @@ "resource-value": "${vpg_private_ip_0}" } ] - },{ + }, + { "payload": [ { "param-name": "service-instance-id", @@ -176,6 +185,19 @@ ] } ] + }, + { + "capability-name": "unresolved-composite-data", + "key-mapping": [ + { + "output-key-mapping": [ + { + "resource-name": "key_name", + "resource-value": "${vnf_name}_key" + } + ] + } + ] } ] } \ No newline at end of file diff --git a/ms/controllerblueprints/application/load/blueprints/vFW/Templates/vfw.vtl b/ms/controllerblueprints/application/load/blueprints/vFW/Templates/vfw.vtl index 0e11b4bf3..06a91d3a1 100644 --- a/ms/controllerblueprints/application/load/blueprints/vFW/Templates/vfw.vtl +++ b/ms/controllerblueprints/application/load/blueprints/vFW/Templates/vfw.vtl @@ -64,10 +64,6 @@ "param-name": "cloud_env", "param-value": "openstack" }, - { - "param-name": "key_name", - "param-value": "${nf-role}_key" - }, { "param-name": "repo_url_artifacts", "param-value": "https://nexus.onap.org/content/groups/staging" @@ -82,7 +78,7 @@ }, { "param-name": "image_name", - "param-value": "Ubuntu 14.04 LTS Generic" + "param-value": "${image_name}" }, { "param-name": "flavor_name", @@ -100,9 +96,13 @@ "param-name": "dcae_collector_ip", "param-value": "10.0.4.1" }, + { + "param-name": "key_name", + "param-value": "${key_name}" + }, { "param-name": "pub_key", - "param-value": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKXDgoo3+WOqcUG8/5uUbk81+yczgwC4Y8ywTmuQqbNxlY1oQ0YxdMUqUnhitSXs5S/yRuAVOYHwGg2mCs20oAINrP+mxBI544AMIb9itPjCtgqtE2EWo6MmnFGbHB4Sx3XioE7F4VPsh7japsIwzOjbrQe+Mua1TGQ5d4nfEOQaaglXLLPFfuc7WbhbJbK6Q7rHqZfRcOwAMXgDoBqlyqKeiKwnumddo2RyNT8ljYmvB6buz7KnMinzo7qB0uktVT05FH9Rg0CTWH5norlG5qXgP2aukL0gk1ph8iAt7uYLf1ktp+LJI2gaF6L0/qli9EmVCSLr1uJ38Q8CBflhkh" + "param-value": "${pub_key}" }, { "param-name": "public_net_id", diff --git a/ms/controllerblueprints/application/load/blueprints/vFW/Templates/vpg.vtl b/ms/controllerblueprints/application/load/blueprints/vFW/Templates/vpg.vtl index c69aeb5f9..f7e3780a3 100644 --- a/ms/controllerblueprints/application/load/blueprints/vFW/Templates/vpg.vtl +++ b/ms/controllerblueprints/application/load/blueprints/vFW/Templates/vpg.vtl @@ -64,10 +64,6 @@ "param-name": "cloud_env", "param-value": "openstack" }, - { - "param-name": "key_name", - "param-value": "${nf-role}_key" - }, { "param-name": "repo_url_artifacts", "param-value": "https://nexus.onap.org/content/groups/staging" @@ -82,12 +78,20 @@ }, { "param-name": "image_name", - "param-value": "Ubuntu 14.04 LTS Generic" + "param-value": "${image_name}" }, { "param-name": "flavor_name", "param-value": "m1.medium" }, + { + "param-name": "key_name", + "param-value": "${key_name}" + }, + { + "param-name": "pub_key", + "param-value": "${pub_key}" + }, { "param-name": "install_script_version", "param-value": "1.2.1-SNAPSHOT" @@ -100,10 +104,6 @@ "param-name": "dcae_collector_ip", "param-value": "10.0.4.1" }, - { - "param-name": "pub_key", - "param-value": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKXDgoo3+WOqcUG8/5uUbk81+yczgwC4Y8ywTmuQqbNxlY1oQ0YxdMUqUnhitSXs5S/yRuAVOYHwGg2mCs20oAINrP+mxBI544AMIb9itPjCtgqtE2EWo6MmnFGbHB4Sx3XioE7F4VPsh7japsIwzOjbrQe+Mua1TGQ5d4nfEOQaaglXLLPFfuc7WbhbJbK6Q7rHqZfRcOwAMXgDoBqlyqKeiKwnumddo2RyNT8ljYmvB6buz7KnMinzo7qB0uktVT05FH9Rg0CTWH5norlG5qXgP2aukL0gk1ph8iAt7uYLf1ktp+LJI2gaF6L0/qli9EmVCSLr1uJ38Q8CBflhkh" - }, { "param-name": "public_net_id", "param-value": "${public_net_id}" diff --git a/ms/controllerblueprints/application/load/blueprints/vFW/Templates/vsn.vtl b/ms/controllerblueprints/application/load/blueprints/vFW/Templates/vsn.vtl index c681de5f8..727427a63 100644 --- a/ms/controllerblueprints/application/load/blueprints/vFW/Templates/vsn.vtl +++ b/ms/controllerblueprints/application/load/blueprints/vFW/Templates/vsn.vtl @@ -64,10 +64,6 @@ "param-name": "cloud_env", "param-value": "openstack" }, - { - "param-name": "key_name", - "param-value": "${nf-role}_key" - }, { "param-name": "repo_url_artifacts", "param-value": "https://nexus.onap.org/content/groups/staging" @@ -82,7 +78,7 @@ }, { "param-name": "image_name", - "param-value": "Ubuntu 14.04 LTS Generic" + "param-value": "${image_name}" }, { "param-name": "flavor_name", @@ -92,6 +88,14 @@ "param-name": "install_script_version", "param-value": "1.2.1-SNAPSHOT" }, + { + "param-name": "key_name", + "param-value": "${key_name}" + }, + { + "param-name": "pub_key", + "param-value": "${pub_key}" + }, { "param-name": "demo_artifacts_version", "param-value": "1.2.1-SNAPSHOT" @@ -100,10 +104,6 @@ "param-name": "dcae_collector_ip", "param-value": "10.0.4.1" }, - { - "param-name": "pub_key", - "param-value": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKXDgoo3+WOqcUG8/5uUbk81+yczgwC4Y8ywTmuQqbNxlY1oQ0YxdMUqUnhitSXs5S/yRuAVOYHwGg2mCs20oAINrP+mxBI544AMIb9itPjCtgqtE2EWo6MmnFGbHB4Sx3XioE7F4VPsh7japsIwzOjbrQe+Mua1TGQ5d4nfEOQaaglXLLPFfuc7WbhbJbK6Q7rHqZfRcOwAMXgDoBqlyqKeiKwnumddo2RyNT8ljYmvB6buz7KnMinzo7qB0uktVT05FH9Rg0CTWH5norlG5qXgP2aukL0gk1ph8iAt7uYLf1ktp+LJI2gaF6L0/qli9EmVCSLr1uJ38Q8CBflhkh" - }, { "param-name": "public_net_id", "param-value": "${public_net_id}" diff --git a/ms/controllerblueprints/application/load/resource_dictionary/image_name.json b/ms/controllerblueprints/application/load/resource_dictionary/image_name.json new file mode 100755 index 000000000..37ef5ae19 --- /dev/null +++ b/ms/controllerblueprints/application/load/resource_dictionary/image_name.json @@ -0,0 +1,33 @@ +{ + "name": "image_name", + "tags": "image_name", + "updated-by": "Singal, Kapil ", + "property": { + "type": "string", + "description": "image_name" + }, + "sources": { + "input": { + "type": "source-input" + }, + "mdsal": { + "type": "source-rest", + "properties": { + "type": "JSON", + "url-path": "config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/image_name", + "path": "/param/0/value", + "input-key-mapping": { + "service-instance-id": "service-instance-id", + "vnf-id": "vnf-id" + }, + "output-key-mapping": { + "image_name": "value" + }, + "key-dependencies": [ + "service-instance-id", + "vnf-id" + ] + } + } + } +} \ No newline at end of file diff --git a/ms/controllerblueprints/application/load/resource_dictionary/key_name.json b/ms/controllerblueprints/application/load/resource_dictionary/key_name.json new file mode 100755 index 000000000..1f1b3e65c --- /dev/null +++ b/ms/controllerblueprints/application/load/resource_dictionary/key_name.json @@ -0,0 +1,33 @@ +{ + "name": "key_name", + "tags": "key_name", + "updated-by": "Singal, Kapil ", + "property": { + "type": "string", + "description": "key_name" + }, + "sources": { + "input": { + "type": "source-input" + }, + "mdsal": { + "type": "source-rest", + "properties": { + "type": "JSON", + "url-path": "config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/key_name", + "path": "/param/0/value", + "input-key-mapping": { + "service-instance-id": "service-instance-id", + "vnf-id": "vnf-id" + }, + "output-key-mapping": { + "key_name": "value" + }, + "key-dependencies": [ + "service-instance-id", + "vnf-id" + ] + } + } + } +} \ No newline at end of file diff --git a/ms/controllerblueprints/application/load/resource_dictionary/pub_key.json b/ms/controllerblueprints/application/load/resource_dictionary/pub_key.json new file mode 100755 index 000000000..ce6c2f2a3 --- /dev/null +++ b/ms/controllerblueprints/application/load/resource_dictionary/pub_key.json @@ -0,0 +1,34 @@ +{ + "name": "pub_key", + "tags": "pub_key", + "updated-by": "Singal, Kapil ", + "property": { + "type": "string", + "description": "pub_key" + }, + "sources": { + "input": { + "type": "source-input" + }, + "mdsal": { + "type": "source-rest", + "properties": { + "type": "JSON", + "url-path": "config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/pub_key", + "path": "/param/0/value", + "input-key-mapping": { + "service-instance-id": "service-instance-id", + "vnf-id": "vnf-id" + }, + "output-key-mapping": { + "pub_key": "value" + }, + "key-dependencies": [ + "service-instance-id", + "vnf-id" + ] + } + } + } +} + -- cgit 1.2.3-korg