Feature 11009 Ns Config Template as first class citizens in OSM - NBI

Change-Id: I20edf909b461edc73bebdf9bcad0d2a321b0818f
Signed-off-by: kayal2001 <kayalvizhi.v@tataelxsi.co.in>
diff --git a/osm_nbi/validation.py b/osm_nbi/validation.py
index 18d5ff6..d282bde 100644
--- a/osm_nbi/validation.py
+++ b/osm_nbi/validation.py
@@ -329,6 +329,82 @@
     },
 }
 
+vnf_schema = {
+    "type": "array",
+    "minItems": 1,
+    "items": {
+        "type": "object",
+        "properties": {
+            "member-vnf-index": name_schema,
+            "vimAccountId": id_schema,
+            "vdu": {
+                "type": "array",
+                "minItems": 1,
+                "items": ns_instantiate_vdu,
+            },
+            "internal-vld": {
+                "type": "array",
+                "minItems": 1,
+                "items": ns_instantiate_internal_vld,
+            },
+        },
+        "required": ["member-vnf-index"],
+        "minProperties": 2,
+        "additionalProperties": False,
+    },
+}
+
+vld_schema = {
+    "type": "array",
+    "minItems": 1,
+    "items": {
+        "type": "object",
+        "properties": {
+            "name": string_schema,
+            "vim-network-name": {"oneOf": [string_schema, object_schema]},
+            "vim-network-id": {"oneOf": [string_schema, object_schema]},
+            "ns-net": object_schema,
+            "wimAccountId": {"oneOf": [id_schema, bool_schema, null_schema]},
+            "ip-profile": ip_profile_schema,
+            "provider-network": provider_network_schema,
+            "vnfd-connection-point-ref": {
+                "type": "array",
+                "minItems": 1,
+                "items": {
+                    "type": "object",
+                    "properties": {
+                        "member-vnf-index-ref": name_schema,
+                        "vnfd-connection-point-ref": name_schema,
+                        "ip-address": {"oneOf": [ip_schema, ipv6_schema]},
+                        # "mac-address": mac_schema,
+                    },
+                    "required": [
+                        "member-vnf-index-ref",
+                        "vnfd-connection-point-ref",
+                    ],
+                    "minProperties": 3,
+                    "additionalProperties": False,
+                },
+            },
+        },
+        "required": ["name"],
+        "additionalProperties": False,
+    },
+}
+
+ns_config_template = {
+    "title": " ns config template input schema",
+    "$schema": "http://json-schema.org/draft-04/schema#",
+    "type": "object",
+    "properties": {
+        "name": string_schema,
+        "nsdId": id_schema,
+        "config": object_schema,
+    },
+    "required": ["name", "nsdId", "config"],
+    "additionalProperties": False,
+}
+
 ns_instantiate = {
     "title": "ns action instantiate input schema",
     "$schema": "http://json-schema.org/draft-04/schema#",
@@ -341,6 +417,7 @@
         "nsDescription": {"oneOf": [description_schema, null_schema]},
         "nsdId": id_schema,
         "vimAccountId": id_schema,
+        "nsConfigTemplateId": id_schema,
         "wimAccountId": {"oneOf": [id_schema, bool_schema, null_schema]},
         "placement-engine": string_schema,
         "placement-constraints": object_schema,
@@ -352,67 +429,8 @@
         "timeout_ns_deploy": integer1_schema,
         "nsr_id": id_schema,
         "vduImage": name_schema,
-        "vnf": {
-            "type": "array",
-            "minItems": 1,
-            "items": {
-                "type": "object",
-                "properties": {
-                    "member-vnf-index": name_schema,
-                    "vimAccountId": id_schema,
-                    "vdu": {
-                        "type": "array",
-                        "minItems": 1,
-                        "items": ns_instantiate_vdu,
-                    },
-                    "internal-vld": {
-                        "type": "array",
-                        "minItems": 1,
-                        "items": ns_instantiate_internal_vld,
-                    },
-                },
-                "required": ["member-vnf-index"],
-                "minProperties": 2,
-                "additionalProperties": False,
-            },
-        },
-        "vld": {
-            "type": "array",
-            "minItems": 1,
-            "items": {
-                "type": "object",
-                "properties": {
-                    "name": string_schema,
-                    "vim-network-name": {"oneOf": [string_schema, object_schema]},
-                    "vim-network-id": {"oneOf": [string_schema, object_schema]},
-                    "ns-net": object_schema,
-                    "wimAccountId": {"oneOf": [id_schema, bool_schema, null_schema]},
-                    "ip-profile": ip_profile_schema,
-                    "provider-network": provider_network_schema,
-                    "vnfd-connection-point-ref": {
-                        "type": "array",
-                        "minItems": 1,
-                        "items": {
-                            "type": "object",
-                            "properties": {
-                                "member-vnf-index-ref": name_schema,
-                                "vnfd-connection-point-ref": name_schema,
-                                "ip-address": {"oneOf": [ip_schema, ipv6_schema]},
-                                # "mac-address": mac_schema,
-                            },
-                            "required": [
-                                "member-vnf-index-ref",
-                                "vnfd-connection-point-ref",
-                            ],
-                            "minProperties": 3,
-                            "additionalProperties": False,
-                        },
-                    },
-                },
-                "required": ["name"],
-                "additionalProperties": False,
-            },
-        },
+        "vnf": vnf_schema,
+        "vld": vld_schema,
     },
     "required": ["nsName", "nsdId", "vimAccountId"],
     "additionalProperties": False,
@@ -1223,6 +1241,9 @@
     "vim_accounts": vim_account_edit_schema,
     "sdns": sdn_edit_schema,
     "pdus": pdu_edit_schema,
+    "vnf": vnf_schema,
+    "vld": vld_schema,
+    "additionalParamsForVnf": additional_params_for_vnf,
 }
 
 # NETSLICE SCHEMAS