X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=RO%2Fosm_ro%2Fopenmano_schemas.py;h=14e334d4f4816e626d0d963b18bffb4fd43c78de;hb=51cc9c4c78bb54c84a5d2399207d206eb30ea247;hp=8fd2889bc6652e68eefe67052bb4f72e46b408e4;hpb=7d782eff123e5b44d41437377ccca66ad1e8b21b;p=osm%2FRO.git diff --git a/RO/osm_ro/openmano_schemas.py b/RO/osm_ro/openmano_schemas.py index 8fd2889b..14e334d4 100644 --- a/RO/osm_ro/openmano_schemas.py +++ b/RO/osm_ro/openmano_schemas.py @@ -56,6 +56,7 @@ port_schema={"type":"integer","minimum":1,"maximum":65534} object_schema={"type":"object"} schema_version_2={"type":"integer","minimum":2,"maximum":2} #schema_version_string={"type":"string","enum": ["0.1", "2", "0.2", "3", "0.3"]} +string_list = {"type": "array", "items": {"type": "string"}} log_level_schema={"type":"string", "enum":["DEBUG", "INFO", "WARNING","ERROR","CRITICAL"]} checksum_schema={"type":"string", "pattern":"^[0-9a-fA-F]{32}$"} size_schema={"type":"integer","minimum":1,"maximum":100} @@ -106,7 +107,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 +121,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 +130,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 +320,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"], @@ -1029,8 +1034,9 @@ instance_scenario_create_schema_v01 = { "type": "object", "properties": { "name": name_schema, # overrides vdu name schema - "mgmt_keys": {"type": "array", "items": {"type": "string"}}, + "mgmt_keys": string_list, "vduImage": name_schema, + "cloud_init": string_list, "devices": { "type": "object", "patternProperties": { @@ -1168,7 +1174,8 @@ instance_scenario_action_schema = { "osm_vdu_id": name_schema, "member-vnf-index": name_schema, "count": integer1_schema, - "type": {"enum": ["create", "delete"]} + "type": {"enum": ["create", "delete"]}, + "cloud_init": string_list, }, "additionalProperties": False, "minProperties": 1, @@ -1185,23 +1192,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 +1220,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 +1234,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 +1250,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"]