Improve CBA to derive variables from others on same level 04/103004/3
authorKonrad Bańka <k.banka@samsung.com>
Wed, 4 Mar 2020 14:26:47 +0000 (15:26 +0100)
committerKonrad Bańka <k.banka@samsung.com>
Thu, 5 Mar 2020 06:33:32 +0000 (07:33 +0100)
Previously some variables required to be resolved for each vf-module
individually, by retrieving from MDSAL vnf entry, even though they
didn't differ between each other. Now CBA RA result has been modified to
provide such variables on the same level, by deriving their value from
other variables resolved on the same level (vnf/vf-module) by using sdnc
"unresolved-composite-data" capability.

Issue-ID: INT-1457
Signed-off-by: Konrad Bańka <k.banka@samsung.com>
Change-Id: I9d9134654d680cf1ea735577fb6d54a0fc0fd0b8

heat/vFW_CNF_CDS/templates/cba-dd.json
heat/vFW_CNF_CDS/templates/cba/Definitions/vFW_CNF_CDS.json
heat/vFW_CNF_CDS/templates/cba/TOSCA-Metadata/TOSCA.meta
heat/vFW_CNF_CDS/templates/cba/Templates/base_template-template.vtl
heat/vFW_CNF_CDS/templates/cba/Templates/vfw-mapping.json
heat/vFW_CNF_CDS/templates/cba/Templates/vfw-template.vtl
heat/vFW_CNF_CDS/templates/cba/Templates/vnf-template.vtl
heat/vFW_CNF_CDS/templates/cba/Templates/vpkg-mapping.json
heat/vFW_CNF_CDS/templates/cba/Templates/vpkg-template.vtl
heat/vFW_CNF_CDS/templates/cba/Templates/vsn-mapping.json
heat/vFW_CNF_CDS/templates/cba/Templates/vsn-template.vtl

index 4da510f..12644d4 100644 (file)
             }
         }
     },
+    {
+        "name": "vpg-management-port",
+        "tags": "vpg-management-port",
+        "data_type": "string",
+        "description": "vpg-management-port",
+        "entry_schema": "string",
+        "updatedBy": "Rajewski, Lukasz <lukasz.rajewski@orange.com>",
+        "definition": {
+            "tags": "vpg-management-port",
+            "name": "vpg-management-port",
+            "property": {
+                "description": "vpg-management-port",
+                "type": "string"
+            },
+            "updated-by": "Rajewski, Lukasz <lukasz.rajewski@orange.com>",
+            "sources": {
+                "input": {
+                    "type": "source-input"
+                },
+                "default": {
+                    "type": "source-default",
+                    "properties": {}
+                }
+            }
+        }
+    },
     {
         "name": "key_name",
         "tags": "key_name",
index 673c086..5f7fa0e 100644 (file)
@@ -5,7 +5,7 @@
     "author-email" : "abdelmuhaimen.seaudi@orange.com",
     "user-groups" : "ADMIN, OPERATION",
     "template_name" : "vFW_CNF_CDS",
-    "template_version" : "1.0.13",
+    "template_version" : "1.0.25",
     "template_tags" : "Samuli Silvius, vFW_CNF_CDS",
     "template_type" : "DEFAULT"
   },
index 9a58a23..9a32b5c 100644 (file)
@@ -1,9 +1,8 @@
-# FIXME vim :set makeprg=make -j1 clean all
 TOSCA-Meta-File-Version: 1.0.0
 CSAR-Version: 1.0
 Created-By: Samuli Silvius <s.silvius@partner.samsung.com>
 Entry-Definitions: Definitions/vFW_CNF_CDS.json
 Template-Name: vFW_CNF_CDS
-Template-Version: 1.0.13
+Template-Version: 1.0.25
 Template-Type: DEFAULT
 Template-Tags: Samuli Silvius, vFW_CNF_CDS
index 990e720..76eda6d 100644 (file)
             "param-name": "int_private1_gw_ip",
             "param-value": "${int_private1_gw_ip}"
         },
-        {
-            "param-name": "int_private1_net_id",
-            "param-value": "${vnf-id}-unprotected-network"
-        },
         {
             "param-name": "int_private1_subnet_id",
-            "param-value": "${vnf-id}-unprotected-network-subnet-1"
+            "param-value": "unprotected-network-subnet-1"
         },
         {
             "param-name": "int_private2_gw_ip",
             "param-value": "${int_private2_gw_ip}"
         },
-        {
-            "param-name": "int_private2_net_id",
-            "param-value": "${vnf-id}-protected-network"
-        },
         {
             "param-name": "int_private2_subnet_id",
-            "param-value": "${vnf-id}-protected-network-subnet-1"
+            "param-value": "protected-network-subnet-1"
         },
         {
             "param-name": "onap_private_gw_ip",
             "param-value": "${onap_private_gw_ip}"
         },
-        {
-            "param-name": "onap_private_net_id",
-            "param-value": "${vnf-id}-management-network"
-        },
         {
             "param-name": "onap_private_subnet_id",
-            "param-value": "${vnf-id}-namagement-network-subnet-1"
+            "param-value": "management-network-subnet-1"
         }
     ]
 }
index 320c1ac..508c733 100644 (file)
     "dependencies": [],
     "version": 0
   },
-
-  {
-    "name": "vfw_name_0",
-    "property": {
-      "description": "",
-      "required": false,
-      "type": "string",
-      "status": "",
-      "constraints": [
-        {}
-      ],
-      "entry_schema": {
-        "type": ""
-      },
-      "default": "${vfw_name_0}"
-    },
-    "input-param": false,
-    "dictionary-name": "vfw_name_0",
-    "dictionary-source": "default",
-    "dependencies": [],
-    "version": 0
-  },
     {
     "name": "vfw_onap_private_ip_0",
     "property": {
index 820df76..414d686 100644 (file)
                         {
                             "param-name": "VF_MODULE_LABEL",
                             "param-value": "${vf-module-label}"
-                        },
-                        {
-                            "param-name": "VF_MODULE_TYPE",
-                            "param-value": "${vf-module-type}"
                         }
                     ]
                 }
                     ]
                 }
             ]
+        },
+        {
+            "capability-name": "unresolved-composite-data",
+            "key-mapping": [
+                {
+                    "output-key-mapping": [
+                        {
+                            "resource-name": "vfw_name_0",
+                            "resource-value": "${vf_module_name}"
+                        }
+                    ]
+                }
+            ]
         }
     ],
     "resource-accumulator-resolved-data": [
         {
             "param-name": "k8s-rb-profile-namespace",
             "param-value": "${k8s-rb-profile-namespace}"
-        },
-        {
-            "param-name": "onap_private_net_id",
-            "param-value": "${vnf-id}-management-network"
-        },
-        {
-            "param-name": "int_private2_net_id",
-            "param-value": "${vnf-id}-protected-network"
-        },
-        {
-            "param-name": "int_private1_net_id",
-            "param-value": "${vnf-id}-unprotected-network"
-        },
-        {
-            "param-name": "vfw_name_0",
-            "param-value": "vfw-${vf-module-id}"
         }
     ]
 }
index e050c97..3e235e2 100644 (file)
                     ]
                 }
             ]
+        },
+        {
+            "capability-name": "unresolved-composite-data",
+            "key-mapping": [
+                {
+                    "output-key-mapping": [
+                        {
+                            "resource-name": "int_private2_net_id",
+                            "resource-value": "${vnf_name}-protected-network"
+                        },
+                        {
+                            "resource-name": "int_private1_net_id",
+                            "resource-value": "${vnf_name}-unprotected-network"
+                        },
+                        {
+                            "resource-name": "onap_private_net_id",
+                            "resource-value": "${vnf_name}-management-network"
+                        },
+                        {
+                            "resource-name": "net_attachment_definition",
+                            "resource-value": "${vnf_name}-ovn-nat"
+                        }
+                    ]
+                }
+            ]
         }
     ],
     "resource-accumulator-resolved-data": [
             "param-name": "install_script_version",
             "param-value": "${install_script_version}"
         },
-        {
-            "param-name": "net_attachment_definition",
-            "param-value": "${vnf-id}-ovn-nat"
-        },
         {
             "param-name": "pub_key",
             "param-value": "${pub_key}"
index 68ae6b0..2e3905c 100644 (file)
     ],
     "version": 0
   },
-  {
-    "name": "vpg_name_0",
-    "property": {
-      "description": "",
-      "required": false,
-      "type": "string",
-      "status": "",
-      "constraints": [
-        {}
-      ],
-      "entry_schema": {
-        "type": ""
-      },
-      "default": "${vpg_name_0}"
-    },
-    "input-param": false,
-    "dictionary-name": "vpg_name_0",
-    "dictionary-source": "default",
-    "dependencies": [],
-    "version": 0
-  },
   {
     "name": "private2-prefix-id",
     "property": {
index 3b0453d..55ad790 100644 (file)
                         {
                             "param-name": "VF_MODULE_LABEL",
                             "param-value": "${vf-module-label}"
-                        },
-                        {
-                            "param-name": "VF_MODULE_TYPE",
-                            "param-value": "${vf-module-type}"
                         }
                     ]
                 }
                     ]
                 }
             ]
+        },
+        {
+            "capability-name": "unresolved-composite-data",
+            "key-mapping": [
+                {
+                    "output-key-mapping": [
+                        {
+                            "resource-name": "vpg_name_0",
+                            "resource-value": "${vf_module_name}"
+                        }
+                    ]
+                }
+            ]
         }
     ],
     "resource-accumulator-resolved-data": [
         {
             "param-name": "k8s-rb-profile-namespace",
             "param-value": "${k8s-rb-profile-namespace}"
-        },
-        {
-            "param-name": "onap_private_net_id",
-            "param-value": "${vnf-id}-management-network"
-        },
-        {
-            "param-name": "int_private1_net_id",
-            "param-value": "${vnf-id}-unprotected-network"
-        },
-        {
-            "param-name": "vpg_name_0",
-            "param-value": "vpg-${vf-module-id}"
         }
     ]
 }
index 7b85b54..5803ea6 100644 (file)
     ],
     "version": 0
   },
-  {
-    "name": "vsn_name_0",
-    "property": {
-      "description": "",
-      "required": false,
-      "type": "string",
-      "status": "",
-      "constraints": [
-        {}
-      ],
-      "entry_schema": {
-        "type": ""
-      },
-      "default": "${vsn_name_0}"
-    },
-    "input-param": false,
-    "dictionary-name": "vsn_name_0",
-    "dictionary-source": "default",
-    "dependencies": [],
-    "version": 0
-  },
   {
     "name": "vnf-id",
     "property": {
index a7a61d6..f71379c 100644 (file)
                         {
                             "param-name": "VF_MODULE_LABEL",
                             "param-value": "${vf-module-label}"
-                        },
-                        {
-                            "param-name": "VF_MODULE_TYPE",
-                            "param-value": "${vf-module-type}"
                         }
                     ]
                 }
                     ]
                 }
             ]
+        },
+        {
+            "capability-name": "unresolved-composite-data",
+            "key-mapping": [
+                {
+                    "output-key-mapping": [
+                        {
+                            "resource-name": "vsn_name_0",
+                            "resource-value": "${vf_module_name}"
+                        }
+                    ]
+                }
+            ]
         }
     ],
     "resource-accumulator-resolved-data": [
             "param-name": "int_private2_net_cidr",
             "param-value": "${int_private2_net_cidr}"
         },
-        {
-            "param-name": "onap_private_net_id",
-            "param-value": "${vnf-id}-management-network"
-        },
         {
             "param-name": "onap_private_net_cidr",
             "param-value": "${onap_private_net_cidr}"
         {
             "param-name": "int_private2_gw_ip",
             "param-value": "${int_private2_gw_ip}"
-        },
-        {
-            "param-name": "int_private2_net_id",
-            "param-value": "${vnf-id}-protected-network"
-        },
-        {
-            "param-name": "vsn_name_0",
-            "param-value": "vsn-${vf-module-id}"
         }
     ]
 }