change repo type to helm-chart,juju-bundle
[osm/NBI.git] / osm_nbi / validation.py
index c6821c5..69caff7 100644 (file)
@@ -221,11 +221,35 @@ additional_params_for_vnf = {
         "properties": {
             "member-vnf-index": name_schema,
             "additionalParams": object_schema,
+            "additionalParamsForVdu": {
+                "type": "array",
+                "items": {
+                    "type": "object",
+                    "properties": {
+                        "vdu_id": name_schema,
+                        "additionalParams": object_schema,
+                    },
+                    "required": ["vdu_id", "additionalParams"],
+                    "additionalProperties": False,
+                },
+            },
+            "additionalParamsForKdu": {
+                "type": "array",
+                "items": {
+                    "type": "object",
+                    "properties": {
+                        "kdu_name": name_schema,
+                        "additionalParams": object_schema,
+                    },
+                    "required": ["kdu_name", "additionalParams"],
+                    "additionalProperties": False,
+                },
+            },
         },
-        "required": ["member-vnf-index", "additionalParams"],
+        "required": ["member-vnf-index"],
+        "minProperties": 2,
         "additionalProperties": False
     }
-
 }
 
 ns_instantiate = {
@@ -363,7 +387,7 @@ ns_scale = {   # TODO for the moment it is only VDU-scaling
 
 schema_version = {"type": "string", "enum": ["1.0"]}
 schema_type = {"type": "string"}
-vim_type = {"enum": ["openstack", "openvim", "vmware", "opennebula", "aws", "azure", "fos"]}
+vim_type = shortname_schema  # {"enum": ["openstack", "openvim", "vmware", "opennebula", "aws", "azure", "fos"]}
 
 vim_account_edit_schema = {
     "title": "vim_account edit input schema",
@@ -410,7 +434,7 @@ vim_account_new_schema = {
     "additionalProperties": False
 }
 
-wim_type = {"enum": ["tapi", "onos", "odl", "dynpac", "fake"]}
+wim_type = shortname_schema  # {"enum": ["tapi", "onos", "odl", "dynpac", "fake"]}
 
 wim_account_edit_schema = {
     "title": "wim_account edit input schema",
@@ -522,7 +546,7 @@ k8scluster_nets_schema = {
     "title": "k8scluster nets input schema",
     "$schema": "http://json-schema.org/draft-04/schema#",
     "type": "object",
-    "patternProperties": {".": string_schema},
+    "patternProperties": {".": {"oneOf": [description_schema, null_schema]}},
     "minProperties": 1,
     "additionalProperties": False
 }
@@ -563,7 +587,7 @@ k8scluster_edit_schema = {
 }
 
 # K8s Repos
-k8srepo_types = {"enum": ["chart", "bundle"]}
+k8srepo_types = {"enum": ["helm-chart", "juju-bundle"]}
 k8srepo_properties = {
     "name": name_schema,
     "description": description_schema,