[vFW CNF CDS] vf_module and vnf name generation improvment in CBA 77/125077/3
authorMichal Chabiera <michal.chabiera@orange.com>
Mon, 18 Oct 2021 14:42:46 +0000 (16:42 +0200)
committerMichal Chabiera <michal.chabiera@orange.com>
Tue, 19 Oct 2021 07:51:01 +0000 (09:51 +0200)
During service deletion generation of vf_module and vnf name causes SDNC error.

Issue-ID: INT-1960
Signed-off-by: Michal Chabiera <michal.chabiera@orange.com>
Change-Id: I88f92e32982dca2054dde7055f40785159d8ec39

13 files changed:
heat/vFW_CNF_CDS/templates/cba/Definitions/data_types.json
heat/vFW_CNF_CDS/templates/cba/Definitions/resources_definition_types.json
heat/vFW_CNF_CDS/templates/cba/Definitions/vFW_CNF_CDS.json
heat/vFW_CNF_CDS/templates/cba/Templates/base_template-mapping.json
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-mapping.json
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 e797e79..e96fbfa 100644 (file)
                     "required": false,
                     "type": "string"
                 },
+                "vf-module-name": {
+                    "description": "",
+                    "required": false,
+                    "type": "string"
+                },
                 "vf-module-label": {
                     "description": "",
                     "required": false,
index 9fe3956..64925d4 100644 (file)
         "tags": "vf-module-id",
         "updated-by": "Singal, Kapil <ks220y@att.com>"
     },
+    "vf-module-name": {
+        "tags": "vf-module-name",
+        "name": "vf-module-name",
+        "property": {
+            "description": "vf-module-name",
+            "type": "string"
+        },
+        "group": "default",
+        "updated-by": "Singal, Kapil <ks220y@att.com>",
+        "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 <yuriy.malakov@att.com>",
+        "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",
         "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>"
     },
     "vnf_name": {
-        "group": "default",
+        "tags": "vnf_name",
         "name": "vnf_name",
         "property": {
             "description": "vnf_name",
             "type": "string"
         },
+        "group": "default",
+        "updated-by": "MALAKOV, YURIY <yuriy.malakov@att.com>",
         "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 <yuriy.malakov@att.com>"
+        }
     },
     "vpg-management-port": {
         "group": "default",
index 86396d0..e5c3ab3 100644 (file)
         }
     ],
     "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://",
index 8de1697..d1104fd 100644 (file)
             "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": {
index 4d1b46a..8cdaaf3 100644 (file)
                 }
             ]
         },
-        {
-            "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": [
             "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",
index ec3ae0b..a534bcc 100644 (file)
             "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": {
index 4702f15..491e9f8 100644 (file)
@@ -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": [
             "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",
index b764a13..db0503d 100644 (file)
         "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": {
index 9f6e96a..5a96320 100644 (file)
@@ -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": [
         }
     ],
     "resource-accumulator-resolved-data": [
+        {
+            "param-name": "vnf_name",
+            "param-value": "${vnf_name}"
+        },
         {
             "param-name": "vf-naming-policy",
             "param-value": "${vf-naming-policy}"
index fa06d64..461f82e 100644 (file)
             "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": {
index da7b271..d270f09 100644 (file)
                 }
             ]
         },
-        {
-            "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": [
             "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",
index 4d2f191..0178ab4 100644 (file)
             "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": {
index 61ba093..edbfa6c 100644 (file)
@@ -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": [
             "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",