From 3c887a297e506f393df2a56e748fc398bcbc4b1a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Konrad=20Ba=C5=84ka?= Date: Wed, 4 Mar 2020 15:26:47 +0100 Subject: [PATCH] Improve CBA to derive variables from others on same level MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Change-Id: I9d9134654d680cf1ea735577fb6d54a0fc0fd0b8 --- heat/vFW_CNF_CDS/templates/cba-dd.json | 26 +++++++++++++++++ .../templates/cba/Definitions/vFW_CNF_CDS.json | 2 +- .../templates/cba/TOSCA-Metadata/TOSCA.meta | 3 +- .../cba/Templates/base_template-template.vtl | 18 ++---------- .../templates/cba/Templates/vfw-mapping.json | 22 --------------- .../templates/cba/Templates/vfw-template.vtl | 33 +++++++++------------- .../templates/cba/Templates/vnf-template.vtl | 29 ++++++++++++++++--- .../templates/cba/Templates/vpkg-mapping.json | 21 -------------- .../templates/cba/Templates/vpkg-template.vtl | 29 +++++++++---------- .../templates/cba/Templates/vsn-mapping.json | 21 -------------- .../templates/cba/Templates/vsn-template.vtl | 29 +++++++++---------- 11 files changed, 95 insertions(+), 138 deletions(-) diff --git a/heat/vFW_CNF_CDS/templates/cba-dd.json b/heat/vFW_CNF_CDS/templates/cba-dd.json index 4da510f4..12644d4c 100644 --- a/heat/vFW_CNF_CDS/templates/cba-dd.json +++ b/heat/vFW_CNF_CDS/templates/cba-dd.json @@ -779,6 +779,32 @@ } } }, + { + "name": "vpg-management-port", + "tags": "vpg-management-port", + "data_type": "string", + "description": "vpg-management-port", + "entry_schema": "string", + "updatedBy": "Rajewski, Lukasz ", + "definition": { + "tags": "vpg-management-port", + "name": "vpg-management-port", + "property": { + "description": "vpg-management-port", + "type": "string" + }, + "updated-by": "Rajewski, Lukasz ", + "sources": { + "input": { + "type": "source-input" + }, + "default": { + "type": "source-default", + "properties": {} + } + } + } + }, { "name": "key_name", "tags": "key_name", diff --git a/heat/vFW_CNF_CDS/templates/cba/Definitions/vFW_CNF_CDS.json b/heat/vFW_CNF_CDS/templates/cba/Definitions/vFW_CNF_CDS.json index 673c0864..5f7fa0e2 100644 --- a/heat/vFW_CNF_CDS/templates/cba/Definitions/vFW_CNF_CDS.json +++ b/heat/vFW_CNF_CDS/templates/cba/Definitions/vFW_CNF_CDS.json @@ -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" }, diff --git a/heat/vFW_CNF_CDS/templates/cba/TOSCA-Metadata/TOSCA.meta b/heat/vFW_CNF_CDS/templates/cba/TOSCA-Metadata/TOSCA.meta index 9a58a238..9a32b5ca 100644 --- a/heat/vFW_CNF_CDS/templates/cba/TOSCA-Metadata/TOSCA.meta +++ b/heat/vFW_CNF_CDS/templates/cba/TOSCA-Metadata/TOSCA.meta @@ -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 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 diff --git a/heat/vFW_CNF_CDS/templates/cba/Templates/base_template-template.vtl b/heat/vFW_CNF_CDS/templates/cba/Templates/base_template-template.vtl index 990e7200..76eda6d3 100644 --- a/heat/vFW_CNF_CDS/templates/cba/Templates/base_template-template.vtl +++ b/heat/vFW_CNF_CDS/templates/cba/Templates/base_template-template.vtl @@ -77,37 +77,25 @@ "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" } ] } diff --git a/heat/vFW_CNF_CDS/templates/cba/Templates/vfw-mapping.json b/heat/vFW_CNF_CDS/templates/cba/Templates/vfw-mapping.json index 320c1ac4..508c7339 100644 --- a/heat/vFW_CNF_CDS/templates/cba/Templates/vfw-mapping.json +++ b/heat/vFW_CNF_CDS/templates/cba/Templates/vfw-mapping.json @@ -441,28 +441,6 @@ "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": { diff --git a/heat/vFW_CNF_CDS/templates/cba/Templates/vfw-template.vtl b/heat/vFW_CNF_CDS/templates/cba/Templates/vfw-template.vtl index 820df768..414d6865 100644 --- a/heat/vFW_CNF_CDS/templates/cba/Templates/vfw-template.vtl +++ b/heat/vFW_CNF_CDS/templates/cba/Templates/vfw-template.vtl @@ -38,10 +38,6 @@ { "param-name": "VF_MODULE_LABEL", "param-value": "${vf-module-label}" - }, - { - "param-name": "VF_MODULE_TYPE", - "param-value": "${vf-module-type}" } ] } @@ -96,6 +92,19 @@ ] } ] + }, + { + "capability-name": "unresolved-composite-data", + "key-mapping": [ + { + "output-key-mapping": [ + { + "resource-name": "vfw_name_0", + "resource-value": "${vf_module_name}" + } + ] + } + ] } ], "resource-accumulator-resolved-data": [ @@ -238,22 +247,6 @@ { "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}" } ] } diff --git a/heat/vFW_CNF_CDS/templates/cba/Templates/vnf-template.vtl b/heat/vFW_CNF_CDS/templates/cba/Templates/vnf-template.vtl index e050c977..3e235e26 100644 --- a/heat/vFW_CNF_CDS/templates/cba/Templates/vnf-template.vtl +++ b/heat/vFW_CNF_CDS/templates/cba/Templates/vnf-template.vtl @@ -277,6 +277,31 @@ ] } ] + }, + { + "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": [ @@ -328,10 +353,6 @@ "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}" diff --git a/heat/vFW_CNF_CDS/templates/cba/Templates/vpkg-mapping.json b/heat/vFW_CNF_CDS/templates/cba/Templates/vpkg-mapping.json index 68ae6b06..2e3905cc 100644 --- a/heat/vFW_CNF_CDS/templates/cba/Templates/vpkg-mapping.json +++ b/heat/vFW_CNF_CDS/templates/cba/Templates/vpkg-mapping.json @@ -439,27 +439,6 @@ ], "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": { diff --git a/heat/vFW_CNF_CDS/templates/cba/Templates/vpkg-template.vtl b/heat/vFW_CNF_CDS/templates/cba/Templates/vpkg-template.vtl index 3b0453d1..55ad7906 100644 --- a/heat/vFW_CNF_CDS/templates/cba/Templates/vpkg-template.vtl +++ b/heat/vFW_CNF_CDS/templates/cba/Templates/vpkg-template.vtl @@ -38,10 +38,6 @@ { "param-name": "VF_MODULE_LABEL", "param-value": "${vf-module-label}" - }, - { - "param-name": "VF_MODULE_TYPE", - "param-value": "${vf-module-type}" } ] } @@ -65,6 +61,19 @@ ] } ] + }, + { + "capability-name": "unresolved-composite-data", + "key-mapping": [ + { + "output-key-mapping": [ + { + "resource-name": "vpg_name_0", + "resource-value": "${vf_module_name}" + } + ] + } + ] } ], "resource-accumulator-resolved-data": [ @@ -203,18 +212,6 @@ { "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}" } ] } diff --git a/heat/vFW_CNF_CDS/templates/cba/Templates/vsn-mapping.json b/heat/vFW_CNF_CDS/templates/cba/Templates/vsn-mapping.json index 7b85b54e..5803ea65 100644 --- a/heat/vFW_CNF_CDS/templates/cba/Templates/vsn-mapping.json +++ b/heat/vFW_CNF_CDS/templates/cba/Templates/vsn-mapping.json @@ -468,27 +468,6 @@ ], "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": { diff --git a/heat/vFW_CNF_CDS/templates/cba/Templates/vsn-template.vtl b/heat/vFW_CNF_CDS/templates/cba/Templates/vsn-template.vtl index a7a61d6b..f71379c2 100644 --- a/heat/vFW_CNF_CDS/templates/cba/Templates/vsn-template.vtl +++ b/heat/vFW_CNF_CDS/templates/cba/Templates/vsn-template.vtl @@ -38,10 +38,6 @@ { "param-name": "VF_MODULE_LABEL", "param-value": "${vf-module-label}" - }, - { - "param-name": "VF_MODULE_TYPE", - "param-value": "${vf-module-type}" } ] } @@ -96,6 +92,19 @@ ] } ] + }, + { + "capability-name": "unresolved-composite-data", + "key-mapping": [ + { + "output-key-mapping": [ + { + "resource-name": "vsn_name_0", + "resource-value": "${vf_module_name}" + } + ] + } + ] } ], "resource-accumulator-resolved-data": [ @@ -171,10 +180,6 @@ "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}" @@ -222,14 +227,6 @@ { "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}" } ] } -- 2.16.6