Assign image keyname and pubkey at vnf level 40/70840/2
authorAlexis de Talhouët <adetalhouet89@gmail.com>
Fri, 19 Oct 2018 18:43:45 +0000 (14:43 -0400)
committerDan Timoney <dtimoney@att.com>
Thu, 25 Oct 2018 18:26:08 +0000 (18:26 +0000)
Change-Id: I7eb4b47a9440e277a510864f2bb52323e464da5a
Issue-ID: CCSDK-621
Signed-off-by: Alexis de Talhouët <adetalhouet89@gmail.com>
(cherry picked from commit f39904fbe580301b896ad598e85a135d11c8944b)

ms/controllerblueprints/application/load/blueprints/vFW/Definitions/vFW_spinup.json
ms/controllerblueprints/application/load/blueprints/vFW/Templates/base_template.vtl
ms/controllerblueprints/application/load/blueprints/vFW/Templates/vFW_vNF_Artifact.vtl
ms/controllerblueprints/application/load/blueprints/vFW/Templates/vfw.vtl
ms/controllerblueprints/application/load/blueprints/vFW/Templates/vpg.vtl
ms/controllerblueprints/application/load/blueprints/vFW/Templates/vsn.vtl
ms/controllerblueprints/application/load/resource_dictionary/image_name.json [new file with mode: 0755]
ms/controllerblueprints/application/load/resource_dictionary/key_name.json [new file with mode: 0755]
ms/controllerblueprints/application/load/resource_dictionary/pub_key.json [new file with mode: 0755]

index 3cfa6f7..d5416c0 100644 (file)
                     
                   ],
                   "version": 0
-                },{
+                },
+                {
                   "name": "onap_private_net_id",
                   "property": {
                     "description": "",
                   ],
                   "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": {
                   ],
                   "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": {
                   "dictionary-name": "onap_private_net_id",
                   "dictionary-source": "mdsal",
                   "dependencies": [
-                      "service-instance-id",
-                      "vnf-id"
+                    "service-instance-id",
+                    "vnf-id"
                   ],
                   "version": 0
                 },
                   "dictionary-name": "onap_private_subnet_id",
                   "dictionary-source": "mdsal",
                   "dependencies": [
-                      "service-instance-id",
-                      "vnf-id"
+                    "service-instance-id",
+                    "vnf-id"
                   ],
                   "version": 0
                 },
                   ],
                   "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": {
                   "dictionary-name": "onap_private_net_id",
                   "dictionary-source": "mdsal",
                   "dependencies": [
-                      "service-instance-id",
-                      "vnf-id"
+                    "service-instance-id",
+                    "vnf-id"
                   ],
                   "version": 0
                 },
                   "dictionary-name": "onap_private_subnet_id",
                   "dictionary-source": "mdsal",
                   "dependencies": [
-                      "service-instance-id",
-                      "vnf-id"
+                    "service-instance-id",
+                    "vnf-id"
                   ],
                   "version": 0
                 },
                   ],
                   "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": {
                   ],
                   "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": {
                   "dictionary-name": "onap_private_net_id",
                   "dictionary-source": "mdsal",
                   "dependencies": [
-                      "service-instance-id",
-                      "vnf-id"
+                    "service-instance-id",
+                    "vnf-id"
                   ],
                   "version": 0
                 },
                   "dictionary-name": "onap_private_subnet_id",
                   "dictionary-source": "mdsal",
                   "dependencies": [
-                      "service-instance-id",
-                      "vnf-id"
+                    "service-instance-id",
+                    "vnf-id"
                   ],
                   "version": 0
                 },
index a5a8ff0..1f8298c 100644 (file)
       "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"
     },
     {
       "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",
index f25e956..ca09046 100644 (file)
       "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"
               "resource-value": "${vpg_private_ip_0}"
             }
           ]
-        },{
+        },
+        {
           "payload": [
             {
               "param-name": "service-instance-id",
           ]
         }
       ]
+    },
+    {
+      "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
index 0e11b4b..06a91d3 100644 (file)
       "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",
       "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",
index c69aeb5..f7e3780 100644 (file)
       "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"
     },
     {
       "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"
       "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}"
index c681de5..727427a 100644 (file)
       "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",
       "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"
       "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 (executable)
index 0000000..37ef5ae
--- /dev/null
@@ -0,0 +1,33 @@
+{
+  "name": "image_name",
+  "tags": "image_name",
+  "updated-by": "Singal, Kapil <ks220y@att.com>",
+  "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 (executable)
index 0000000..1f1b3e6
--- /dev/null
@@ -0,0 +1,33 @@
+{
+  "name": "key_name",
+  "tags": "key_name",
+  "updated-by": "Singal, Kapil <ks220y@att.com>",
+  "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 (executable)
index 0000000..ce6c2f2
--- /dev/null
@@ -0,0 +1,34 @@
+{
+  "name": "pub_key",
+  "tags": "pub_key",
+  "updated-by": "Singal, Kapil <ks220y@att.com>",
+  "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"
+        ]
+      }
+    }
+  }
+}
+