fix validation error oneOf
[osm/RO.git] / RO / osm_ro / openmano_schemas.py
index 8fd2889..aa235ec 100644 (file)
@@ -106,7 +106,7 @@ config_schema = {
         "http_console_host": nameshort_schema,
         "http_console_ports": {
             "type": "array",
-            "items": {"OneOf": [
+            "items": {"oneOf": [
                 port_schema,
                 {"type": "object", "properties": {"from": port_schema, "to": port_schema}, "required": ["from", "to"]}
             ]}
@@ -120,6 +120,8 @@ config_schema = {
         "log_level_http": log_level_schema,
         "log_level_console": log_level_schema,
         "log_level_ovim": log_level_schema,
+        "log_level_sdn": log_level_schema,
+        "log_level_sdnconn": log_level_schema,
         "log_file_db": path_schema,
         "log_file_vim": path_schema,
         "log_file_wim": path_schema,
@@ -127,6 +129,8 @@ config_schema = {
         "log_file_http": path_schema,
         "log_file_console": path_schema,
         "log_file_ovim": path_schema,
+        "log_file_sdn": path_schema,
+        "log_file_sdnconn": path_schema,
         "log_socket_host": nameshort_schema,
         "log_socket_port": port_schema,
         "log_file": path_schema,
@@ -315,7 +319,7 @@ dhcp_schema = {
     "type": "object",
     "properties":{
         "enabled": boolean_schema,
-        "start-address": {"OneOf": [null_schema, ip_schema]},
+        "start-address": {"oneOf": [null_schema, ip_schema]},
         "count": integer0_schema
     },
     # "required": ["start-address", "count"],
@@ -1185,23 +1189,26 @@ instance_scenario_action_schema = {
 
 sdn_controller_properties={
     "name": name_schema,
-    "dpid": {"type":"string", "pattern":"^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){7}$"},
+    "dpid": {"type": "string", "pattern": "^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){7}$"},
+    "description": name_schema,
     "ip": ip_schema,
     "port": port_schema,
-    "type": {"type": "string", "enum": ["opendaylight","floodlight","onos"]},
-    "version": {"type" : "string", "minLength":1, "maxLength":12},
+    "type": nameshort_schema,
+    "url": name_schema,
+    "version": {"type": "string", "minLength": 1, "maxLength": 12},
     "user": nameshort_schema,
-    "password": passwd_schema
+    "password": passwd_schema,
+    "config": object_schema,
 }
 sdn_controller_schema = {
-    "title":"sdn controller information schema",
+    "title": "sdn controller information schema",
     "$schema": "http://json-schema.org/draft-04/schema#",
-    "type":"object",
+    "type": "object",
     "properties":{
         "sdn_controller":{
-            "type":"object",
-            "properties":sdn_controller_properties,
-            "required": ["name", "port", 'ip', 'dpid', 'type'],
+            "type": "object",
+            "properties": sdn_controller_properties,
+            "required": ["name", 'type'],
             "additionalProperties": False
         }
     },
@@ -1210,13 +1217,13 @@ sdn_controller_schema = {
 }
 
 sdn_controller_edit_schema = {
-    "title":"sdn controller update information schema",
+    "title": "sdn controller update information schema",
     "$schema": "http://json-schema.org/draft-04/schema#",
-    "type":"object",
-    "properties":{
-        "sdn_controller":{
-            "type":"object",
-            "properties":sdn_controller_properties,
+    "type": "object",
+    "properties": {
+        "sdn_controller": {
+            "type": "object",
+            "properties": sdn_controller_properties,
             "additionalProperties": False
         }
     },
@@ -1224,7 +1231,7 @@ sdn_controller_edit_schema = {
     "additionalProperties": False
 }
 
-sdn_port_mapping_schema  = {
+sdn_port_mapping_schema = {
     "$schema": "http://json-schema.org/draft-04/schema#",
     "title":"sdn port mapping information schema",
     "type": "object",
@@ -1240,8 +1247,10 @@ sdn_port_mapping_schema  = {
                         "items": {
                             "type": "object",
                             "properties": {
-                                "pci": {"OneOf": [null_schema, pci_extended_schema]},       # pci_schema,
+                                "pci": {"oneOf": [null_schema, pci_extended_schema]},       # pci_schema,
                                 "switch_port": nameshort_schema,
+                                "switch_id": nameshort_schema,
+                                "switch_dpid": nameshort_schema,
                                 "switch_mac": mac_schema
                             },
                             "required": ["pci"]