bug 636 validation vim_account-create config. Deny null values 85/7285/1
authortierno <alfonso.tiernosepulveda@telefonica.com>
Thu, 7 Mar 2019 16:26:47 +0000 (16:26 +0000)
committertierno <alfonso.tiernosepulveda@telefonica.com>
Thu, 7 Mar 2019 16:26:47 +0000 (16:26 +0000)
Change-Id: I02a06d749eee02e5faa4bd54ccf10439dbb6e4e7
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
osm_nbi/instance_topics.py
osm_nbi/validation.py

index 36b6a42..9dced30 100644 (file)
@@ -192,6 +192,7 @@ class NsrTopic(BaseTopic):
                 "nsd-name-ref": nsd["name"],
                 "operational-events": [],   # "id", "timestamp", "description", "event",
                 "nsd-ref": nsd["id"],
+                "nsd-id": nsd["_id"],
                 "instantiate_params": self._format_ns_request(ns_request),
                 "additionalParamsForNs": self._format_addional_params(ns_request),
                 "ns-instance-config-ref": nsr_id,
index 0ec8304..c79cdaf 100644 (file)
@@ -302,6 +302,7 @@ ns_action = {   # TODO for the moment it is only contemplated the vnfd primitive
         "member_vnf_index": name_schema,
         "vnf_member_index": name_schema,  # TODO for backward compatibility. To remove in future
         "vdu_id": name_schema,
+        "vdu_count_index": integer0_schema,
         "primitive": name_schema,
         "primitive_params": {"type": "object"},
     },
@@ -420,7 +421,12 @@ wim_account_new_schema = {
         "wim_url": description_schema,
         "user": shortname_schema,
         "password": passwd_schema,
-        "config": {"type": "object"}
+        "config": {
+            "type": "object",
+            "patternProperties": {
+                ".": {"not": {"type": "null"}}
+            }
+        }
     },
     "required": ["name", "wim_url", "wim_type"],
     "additionalProperties": False