From 734b3d2134b4e1dd3cd946b8badd2baf83f97110 Mon Sep 17 00:00:00 2001 From: Michal Chabiera Date: Mon, 18 Oct 2021 16:42:46 +0200 Subject: [vFW CNF CDS] vf_module and vnf name generation improvment in CBA During service deletion generation of vf_module and vnf name causes SDNC error. Issue-ID: INT-1960 Signed-off-by: Michal Chabiera Change-Id: I88f92e32982dca2054dde7055f40785159d8ec39 --- .../templates/cba/Definitions/data_types.json | 5 + .../Definitions/resources_definition_types.json | 169 +++++++++++++++++++-- .../templates/cba/Definitions/vFW_CNF_CDS.json | 6 + .../cba/Templates/base_template-mapping.json | 25 +++ .../cba/Templates/base_template-template.vtl | 51 +------ .../templates/cba/Templates/vfw-mapping.json | 25 +++ .../templates/cba/Templates/vfw-template.vtl | 51 +------ .../templates/cba/Templates/vnf-mapping.json | 24 +++ .../templates/cba/Templates/vnf-template.vtl | 43 +----- .../templates/cba/Templates/vpkg-mapping.json | 25 +++ .../templates/cba/Templates/vpkg-template.vtl | 51 +------ .../templates/cba/Templates/vsn-mapping.json | 25 +++ .../templates/cba/Templates/vsn-template.vtl | 51 +------ 13 files changed, 308 insertions(+), 243 deletions(-) (limited to 'heat/vFW_CNF_CDS') diff --git a/heat/vFW_CNF_CDS/templates/cba/Definitions/data_types.json b/heat/vFW_CNF_CDS/templates/cba/Definitions/data_types.json index e797e79b..e96fbfa6 100644 --- a/heat/vFW_CNF_CDS/templates/cba/Definitions/data_types.json +++ b/heat/vFW_CNF_CDS/templates/cba/Definitions/data_types.json @@ -212,6 +212,11 @@ "required": false, "type": "string" }, + "vf-module-name": { + "description": "", + "required": false, + "type": "string" + }, "vf-module-label": { "description": "", "required": false, diff --git a/heat/vFW_CNF_CDS/templates/cba/Definitions/resources_definition_types.json b/heat/vFW_CNF_CDS/templates/cba/Definitions/resources_definition_types.json index 9fe3956a..64925d4d 100644 --- a/heat/vFW_CNF_CDS/templates/cba/Definitions/resources_definition_types.json +++ b/heat/vFW_CNF_CDS/templates/cba/Definitions/resources_definition_types.json @@ -821,6 +821,111 @@ "tags": "vf-module-id", "updated-by": "Singal, Kapil " }, + "vf-module-name": { + "tags": "vf-module-name", + "name": "vf-module-name", + "property": { + "description": "vf-module-name", + "type": "string" + }, + "group": "default", + "updated-by": "Singal, Kapil ", + "sources": { + "input": { + "type": "source-input" + }, + "default": { + "type": "source-default", + "properties": {} + }, + "sdnc": { + "type": "source-rest", + "properties": { + "verb": "GET", + "type": "JSON", + "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vf-modules/vf-module/$vf_module_id/vf-module-data/vf-module-topology/vf-module-parameters/param/vf-module-name", + "path": "/param/0/value", + "input-key-mapping": { + "service-instance-id": "service-instance-id", + "vnf-id": "vnf-id" + }, + "output-key-mapping": { + "vf-module-name": "value" + }, + "key-dependencies": [ + "service-instance-id", + "vnf-id", + "vf_module_id" + ] + } + }, + "rest": { + "type": "source-rest", + "properties": { + "endpoint-selector": "naming-resolution", + "verb": "POST", + "type": "JSON", + "headers": { + "Accept": "application/json", + "Content-Type": "application/json" + }, + "url-path": "/v1/genNetworkElementName", + "payload": "{\r\n \"elements\": [\r\n {\r\n \"resource-name\": \"vf-module-name\",\r\n \"resource-value\": \"${vf-module-name}\",\r\n \"external-key\": \"${vf-module-id}\",\r\n \"policy-instance-name\": \"${vf-naming-policy}\",\r\n \"naming-type\": \"VF-MODULE\",\r\n \"VNF_NAME\": \"${vnf_name}\",\r\n \"VF_MODULE_LABEL\":\"${vf-module-label}\",\r\n \"VF_MODULE_TYPE\":\"vfmt\"\r\n }\r\n ]\r\n}", + "path": "/elements/0/resource-value", + "input-key-mapping": { + "vf-naming-policy": "vf-naming-policy", + "vnf_name": "vnf_name", + "vf-module-label": "vf-module-label", + "vf-module-id": "vf-module-id" + }, + "output-key-mapping": { + "vf-module-name": "resource-value" + }, + "key-dependencies": [ + "vf-naming-policy", + "vnf_name", + "vf-module-label", + "vf-module-id" + ] + } + } + } + }, + "vf-module-type": { + "tags": "vf-module-type", + "name": "vf-module-type", + "property": { + "description": "vf-module-type", + "type": "string" + }, + "group": "default", + "updated-by": "MALAKOV, YURIY ", + "sources": { + "input": { + "type": "source-input" + }, + "default": { + "type": "source-default", + "properties": {} + }, + "processor-db": { + "type": "source-db", + "properties": { + "type": "SQL", + "query": "select vf_module_type as vf_module_type from sdnctl.VF_MODULE_MODEL where customization_uuid=:customizationid", + "output-key-mapping": { + "vf-module-type": "vf_module_type" + }, + "input-key-mapping": { + "customizationid": "vf-module-model-customization-uuid" + }, + "key-dependencies": [ + "vf-module-model-customization-uuid" + ] + } + } + } + }, "vf-module-label": { "group": "default", "name": "vf-module-label", @@ -1094,43 +1199,75 @@ "updated-by": "MALAKOV, YURIY " }, "vnf_name": { - "group": "default", + "tags": "vnf_name", "name": "vnf_name", "property": { "description": "vnf_name", "type": "string" }, + "group": "default", + "updated-by": "MALAKOV, YURIY ", "sources": { - "default": { - "properties": {}, - "type": "source-default" - }, "input": { "type": "source-input" }, + "default": { + "type": "source-default", + "properties": {} + }, "sdnc": { + "type": "source-rest", "properties": { + "verb": "GET", + "type": "JSON", + "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vnf_name", + "path": "/param/0/value", + "headers": { + "Accept": "application/json", + "Content-Type": "application/json" + }, "input-key-mapping": { "service-instance-id": "service-instance-id", "vnf-id": "vnf-id" }, + "output-key-mapping": { + "vnf_name": "value" + }, "key-dependencies": [ "service-instance-id", "vnf-id" - ], + ] + } + }, + "rest": { + "type": "source-rest", + "properties": { + "endpoint-selector": "naming-resolution", + "verb": "POST", + "type": "JSON", + "headers": { + "Accept": "application/json", + "Content-Type": "application/json" + }, + "url-path": "/v1/genNetworkElementName", + "payload": "{\r\n \"elements\": [\r\n {\r\n \"resource-name\": \"vnf_name\",\r\n \"resource-value\": \"${vnf_name}\",\r\n \"external-key\": \"${vnf-id}\",\r\n \"policy-instance-name\": \"${vf-naming-policy}\",\r\n \"naming-type\": \"VNF\",\r\n \"AIC_CLOUD_REGION\": \"${aic-cloud-region}\"\r\n }\r\n ]\r\n}", + "path": "/elements/0/resource-value", + "input-key-mapping": { + "vnf-id": "vnf-id", + "aic-cloud-region": "aic-cloud-region", + "vf-naming-policy": "vf-naming-policy" + }, "output-key-mapping": { - "vnf_name": "value" + "vnf_name": "resource-value" }, - "path": "/param/0/value", - "type": "JSON", - "url-path": "/restconf/config/GENERIC-RESOURCE-API:services/service/$service-instance-id/service-data/vnfs/vnf/$vnf-id/vnf-data/vnf-topology/vnf-parameters-data/param/vnf_name", - "verb": "GET" - }, - "type": "source-rest" + "key-dependencies": [ + "vnf-id", + "aic-cloud-region", + "vf-naming-policy" + ] + } } - }, - "tags": "vnf_name", - "updated-by": "MALAKOV, YURIY " + } }, "vpg-management-port": { "group": "default", 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 86396d0a..e5c3ab33 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 @@ -27,6 +27,12 @@ } ], "dsl_definitions": { + "naming-resolution": { + "type": "basic-auth", + "url": "http://neng-serv:8080/web/service", + "username": "ccsdkapps", + "password": "ccsdkapps" + }, "vpkg-rest-api": { "type": "basic-auth", "url": "http://", diff --git a/heat/vFW_CNF_CDS/templates/cba/Templates/base_template-mapping.json b/heat/vFW_CNF_CDS/templates/cba/Templates/base_template-mapping.json index 8de1697a..d1104fd2 100644 --- a/heat/vFW_CNF_CDS/templates/cba/Templates/base_template-mapping.json +++ b/heat/vFW_CNF_CDS/templates/cba/Templates/base_template-mapping.json @@ -23,6 +23,31 @@ "vf-module-model-customization-uuid" ] }, + { + "name": "vf-module-name", + "property": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + {} + ], + "entry_schema": { + "type": "" + } + }, + "input-param": false, + "dictionary-name": "vf-module-name", + "dictionary-source": "rest", + "dependencies": [ + "vnf_name", + "vf-module-label", + "vf-naming-policy", + "vf-module-id" + ], + "version": 0 + }, { "name": "management-prefix-id", "property": { 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 4d1b46a0..8cdaaf39 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 @@ -31,53 +31,6 @@ } ] }, - { - "capability-name": "generate-name", - "key-mapping": [ - { - "output-key-mapping": [ - { - "resource-name": "vf_module_name", - "resource-value": "${vf-module-name}" - } - ], - "payload": [ - { - "param-name": "resource-name", - "param-value": "vf_module_name" - }, - { - "param-name": "resource-value", - "param-value": "${vf-module-name}" - }, - { - "param-name": "external-key", - "param-value": "${vf-module-id}_vf-module-name" - }, - { - "param-name": "policy-instance-name", - "param-value": "${vf-naming-policy}" - }, - { - "param-name": "naming-type", - "param-value": "VF-MODULE" - }, - { - "param-name": "VNF_NAME", - "param-value": "${vnf_name}" - }, - { - "param-name": "VF_MODULE_TYPE", - "param-value": "vfmt" - }, - { - "param-name": "VF_MODULE_LABEL", - "param-value": "${vf-module-label}" - } - ] - } - ] - }, { "capability-name": "aai-vf-module-put", "key-mapping": [ @@ -97,6 +50,10 @@ "param-name": "vnf_name", "param-value": "${vnf_name}" }, + { + "param-name": "vf-module-name", + "param-value": "${vf-module-name}" + }, ##RB name { "param-name": "vf-module-model-invariant-uuid", 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 ec3ae0be..a534bccb 100644 --- a/heat/vFW_CNF_CDS/templates/cba/Templates/vfw-mapping.json +++ b/heat/vFW_CNF_CDS/templates/cba/Templates/vfw-mapping.json @@ -23,6 +23,31 @@ "vf-module-model-customization-uuid" ] }, + { + "name": "vf-module-name", + "property": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + {} + ], + "entry_schema": { + "type": "" + } + }, + "input-param": false, + "dictionary-name": "vf-module-name", + "dictionary-source": "rest", + "dependencies": [ + "vnf_name", + "vf-module-label", + "vf-naming-policy", + "vf-module-id" + ], + "version": 0 + }, { "name": "management-prefix-id", "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 4702f15c..491e9f84 100644 --- a/heat/vFW_CNF_CDS/templates/cba/Templates/vfw-template.vtl +++ b/heat/vFW_CNF_CDS/templates/cba/Templates/vfw-template.vtl @@ -1,52 +1,5 @@ { "capability-data": [ - { - "capability-name": "generate-name", - "key-mapping": [ - { - "output-key-mapping": [ - { - "resource-name": "vf_module_name", - "resource-value": "${vf-module-name}" - } - ], - "payload": [ - { - "param-name": "VF_MODULE_TYPE", - "param-value": "vfmt" - }, - { - "param-name": "resource-name", - "param-value": "vf_module_name" - }, - { - "param-name": "resource-value", - "param-value": "${vf-module-name}" - }, - { - "param-name": "external-key", - "param-value": "${vf-module-id}_vf-module-name" - }, - { - "param-name": "policy-instance-name", - "param-value": "${vf-naming-policy}" - }, - { - "param-name": "naming-type", - "param-value": "VF-MODULE" - }, - { - "param-name": "VNF_NAME", - "param-value": "${vnf_name}" - }, - { - "param-name": "VF_MODULE_LABEL", - "param-value": "${vf-module-label}" - } - ] - } - ] - }, { "capability-name": "netbox-ip-assign", "key-mapping": [ @@ -110,6 +63,10 @@ "param-name": "vnf_name", "param-value": "${vnf_name}" }, + { + "param-name": "vf-module-name", + "param-value": "${vf-module-name}" + }, ##RB name { "param-name": "vf-module-model-invariant-uuid", diff --git a/heat/vFW_CNF_CDS/templates/cba/Templates/vnf-mapping.json b/heat/vFW_CNF_CDS/templates/cba/Templates/vnf-mapping.json index b764a136..db0503dc 100644 --- a/heat/vFW_CNF_CDS/templates/cba/Templates/vnf-mapping.json +++ b/heat/vFW_CNF_CDS/templates/cba/Templates/vnf-mapping.json @@ -93,6 +93,30 @@ "dependencies": [], "version": 0 }, + { + "name": "vnf_name", + "property": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + {} + ], + "entry_schema": { + "type": "" + } + }, + "input-param": false, + "dictionary-name": "vnf_name", + "dictionary-source": "rest", + "dependencies": [ + "aic-cloud-region", + "vf-naming-policy", + "vnf-id" + ], + "version": 0 + }, { "name": "vf-naming-policy", "property": { 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 9f6e96ae..5a963205 100644 --- a/heat/vFW_CNF_CDS/templates/cba/Templates/vnf-template.vtl +++ b/heat/vFW_CNF_CDS/templates/cba/Templates/vnf-template.vtl @@ -1,44 +1,5 @@ { "capability-data": [ - { - "capability-name": "generate-name", - "key-mapping": [ - { - "output-key-mapping": [ - { - "resource-name": "vnf_name", - "resource-value": "${vnf_name}" - } - ], - "payload": [ - { - "param-name": "resource-name", - "param-value": "vnf_name" - }, - { - "param-name": "resource-value", - "param-value": "${vnf_name}" - }, - { - "param-name": "external-key", - "param-value": "${vnf-id}_vnf_name" - }, - { - "param-name": "policy-instance-name", - "param-value": "${vf-naming-policy}" - }, - { - "param-name": "naming-type", - "param-value": "VNF" - }, - { - "param-name": "AIC_CLOUD_REGION", - "param-value": "${aic-cloud-region}" - } - ] - } - ] - }, { "capability-name": "netbox-ip-assign", "key-mapping": [ @@ -227,6 +188,10 @@ } ], "resource-accumulator-resolved-data": [ + { + "param-name": "vnf_name", + "param-value": "${vnf_name}" + }, { "param-name": "vf-naming-policy", "param-value": "${vf-naming-policy}" 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 fa06d641..461f82e3 100644 --- a/heat/vFW_CNF_CDS/templates/cba/Templates/vpkg-mapping.json +++ b/heat/vFW_CNF_CDS/templates/cba/Templates/vpkg-mapping.json @@ -23,6 +23,31 @@ "vf-module-model-customization-uuid" ] }, + { + "name": "vf-module-name", + "property": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + {} + ], + "entry_schema": { + "type": "" + } + }, + "input-param": false, + "dictionary-name": "vf-module-name", + "dictionary-source": "rest", + "dependencies": [ + "vnf_name", + "vf-module-label", + "vf-naming-policy", + "vf-module-id" + ], + "version": 0 + }, { "name": "management-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 da7b2718..d270f098 100644 --- a/heat/vFW_CNF_CDS/templates/cba/Templates/vpkg-template.vtl +++ b/heat/vFW_CNF_CDS/templates/cba/Templates/vpkg-template.vtl @@ -31,53 +31,6 @@ } ] }, - { - "capability-name": "generate-name", - "key-mapping": [ - { - "output-key-mapping": [ - { - "resource-name": "vf_module_name", - "resource-value": "${vf-module-name}" - } - ], - "payload": [ - { - "param-name": "VF_MODULE_TYPE", - "param-value": "vfmt" - }, - { - "param-name": "resource-name", - "param-value": "vf_module_name" - }, - { - "param-name": "resource-value", - "param-value": "${vf-module-name}" - }, - { - "param-name": "external-key", - "param-value": "${vf-module-id}_vf-module-name" - }, - { - "param-name": "policy-instance-name", - "param-value": "${vf-naming-policy}" - }, - { - "param-name": "naming-type", - "param-value": "VF-MODULE" - }, - { - "param-name": "VNF_NAME", - "param-value": "${vnf_name}" - }, - { - "param-name": "VF_MODULE_LABEL", - "param-value": "${vf-module-label}" - } - ] - } - ] - }, { "capability-name": "aai-vf-module-put", "key-mapping": [ @@ -110,6 +63,10 @@ "param-name": "vnf_name", "param-value": "${vnf_name}" }, + { + "param-name": "vf-module-name", + "param-value": "${vf-module-name}" + }, ##RB name { "param-name": "vf-module-model-invariant-uuid", 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 4d2f191f..0178ab44 100644 --- a/heat/vFW_CNF_CDS/templates/cba/Templates/vsn-mapping.json +++ b/heat/vFW_CNF_CDS/templates/cba/Templates/vsn-mapping.json @@ -23,6 +23,31 @@ "vf-module-model-customization-uuid" ] }, + { + "name": "vf-module-name", + "property": { + "description": "", + "required": false, + "type": "string", + "status": "", + "constraints": [ + {} + ], + "entry_schema": { + "type": "" + } + }, + "input-param": false, + "dictionary-name": "vf-module-name", + "dictionary-source": "rest", + "dependencies": [ + "vnf_name", + "vf-module-label", + "vf-naming-policy", + "vf-module-id" + ], + "version": 0 + }, { "name": "vnf_name", "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 61ba0935..edbfa6c5 100644 --- a/heat/vFW_CNF_CDS/templates/cba/Templates/vsn-template.vtl +++ b/heat/vFW_CNF_CDS/templates/cba/Templates/vsn-template.vtl @@ -1,52 +1,5 @@ { "capability-data": [ - { - "capability-name": "generate-name", - "key-mapping": [ - { - "output-key-mapping": [ - { - "resource-name": "vf_module_name", - "resource-value": "${vf-module-name}" - } - ], - "payload": [ - { - "param-name": "VF_MODULE_TYPE", - "param-value": "vfmt" - }, - { - "param-name": "resource-name", - "param-value": "vf_module_name" - }, - { - "param-name": "resource-value", - "param-value": "${vf-module-name}" - }, - { - "param-name": "external-key", - "param-value": "${vf-module-id}_vf-module-name" - }, - { - "param-name": "policy-instance-name", - "param-value": "${vf-naming-policy}" - }, - { - "param-name": "naming-type", - "param-value": "VF-MODULE" - }, - { - "param-name": "VNF_NAME", - "param-value": "${vnf_name}" - }, - { - "param-name": "VF_MODULE_LABEL", - "param-value": "${vf-module-label}" - } - ] - } - ] - }, { "capability-name": "netbox-ip-assign", "key-mapping": [ @@ -110,6 +63,10 @@ "param-name": "vnf_name", "param-value": "${vnf_name}" }, + { + "param-name": "vf-module-name", + "param-value": "${vf-module-name}" + }, ##RB name { "param-name": "vf-module-model-invariant-uuid", -- cgit 1.2.3-korg