fix issue for k8scluster on action "kdu_name" instead 'vdu_name'
[osm/NBI.git] / osm_nbi / validation.py
index fcd3048..f4823f6 100644 (file)
@@ -172,6 +172,17 @@ ip_profile_update_schema = {
     "additionalProperties": False
 }
 
+provider_network_schema = {
+    "title": "provider network validation schame",
+    "$schema": "http://json-schema.org/draft-04/schema#",
+    "type": "object",
+    "properties": {
+        "physical-network": name_schema,
+        "segmentation-id": name_schema,
+    },
+    "additionalProperties": False
+}
+
 ns_instantiate_internal_vld = {
     "title": "ns action instantiate input schema for vdu",
     "$schema": "http://json-schema.org/draft-04/schema#",
@@ -181,6 +192,7 @@ ns_instantiate_internal_vld = {
         "vim-network-name": name_schema,
         "vim-network-id": name_schema,
         "ip-profile": ip_profile_update_schema,
+        "provider-network": provider_network_schema,
         "internal-connection-point": {
             "type": "array",
             "minItems": 1,
@@ -270,6 +282,7 @@ ns_instantiate = {
                     "ns-net": object_schema,
                     "wimAccountId": {"OneOf": [id_schema, bool_schema, null_schema]},
                     "ip-profile": object_schema,
+                    "provider-network": provider_network_schema,
                     "vnfd-connection-point-ref": {
                         "type": "array",
                         "minItems": 1,
@@ -307,6 +320,7 @@ ns_action = {   # TODO for the moment it is only contemplated the vnfd primitive
         "vnf_member_index": name_schema,  # TODO for backward compatibility. To remove in future
         "vdu_id": name_schema,
         "vdu_count_index": integer0_schema,
+        "kdu_name": name_schema,
         "primitive": name_schema,
         "primitive_params": {"type": "object"},
     },
@@ -508,7 +522,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
 }