X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=openmano_schemas.py;h=5b1b9425b1e5bf78604389cce9dc250d671d13ad;hb=c5651795c9b7fc6782fa666a27351c2aae52c08f;hp=a8c92a0f911922b9676b3934404498a4a6bcd86c;hpb=2a1fc4e770c0688ac1fcb41e1c62bf36a2719d28;p=osm%2FRO.git diff --git a/openmano_schemas.py b/openmano_schemas.py index a8c92a0f..5b1b9425 100644 --- a/openmano_schemas.py +++ b/openmano_schemas.py @@ -80,6 +80,7 @@ config_schema = { "http_port": port_schema, "http_admin_port": port_schema, "http_host": nameshort_schema, + "auto_push_VNF_to_VIMs": {"type":"boolean"}, "vnf_repository": path_schema, "db_host": nameshort_schema, "db_user": nameshort_schema, @@ -107,10 +108,12 @@ config_schema = { "log_level_vim": log_level_schema, "log_level_nfvo": log_level_schema, "log_level_http": log_level_schema, + "log_level_console": log_level_schema, "log_file_db": path_schema, "log_file_vim": path_schema, "log_file_nfvo": path_schema, "log_file_http": path_schema, + "log_file_console": path_schema, "log_socket_host": nameshort_schema, "log_socket_port": port_schema, "log_file": path_schema, @@ -495,6 +498,37 @@ numa_schema = { #"required": ["memory"] } +config_files_schema = { + "title": "Config files for cloud init schema", + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "dest": path_schema, + "encoding": {"type": "string", "enum": ["b64", "base64", "gz", "gz+b64", "gz+base64", "gzip+b64", "gzip+base64"]}, #by default text + "content": {"type": "string"}, + "permissions": {"type": "string"}, # tiypically octal notation '0644' + "owner": {"type": "string"}, # format: owner:group + + }, + "additionalProperties": False, + "required": ["dest", "content"], +} + +boot_data_vdu_schema = { + "title": "Boot data (Cloud-init) configuration schema", + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties":{ + "key-pairs": {"type" : "array", "items": {"type":"string"}}, + "users": {"type" : "array", "items": cloud_config_user_schema}, + "user-data": {"type" : "string"}, # scrip to run + "config-files": {"type": "array", "items": config_files_schema}, + # NOTE: “user-data” are mutually exclusive with users and config-files because user/files are injected using user-data + "boot-data-drive": {"type": "boolean"}, + }, + "additionalProperties": False, +} + vnfc_schema = { "type":"object", "properties":{ @@ -529,7 +563,8 @@ vnfc_schema = { "items": numa_schema }, "bridge-ifaces": bridge_interfaces_schema, - "devices": devices_schema + "devices": devices_schema, + "boot-data" : boot_data_vdu_schema }, "required": ["name"], @@ -1060,3 +1095,75 @@ instance_scenario_action_schema = { #"maxProperties": 1, "additionalProperties": False } + +sdn_controller_properties={ + "name": name_schema, + "dpid": {"type":"string", "pattern":"^[0-9a-fA-F][02468aceACE](:[0-9a-fA-F]{2}){7}$"}, + "ip": ip_schema, + "port": port_schema, + "type": {"type": "string", "enum": ["opendaylight","floodlight","onos"]}, + "version": {"type" : "string", "minLength":1, "maxLength":12}, + "user": nameshort_schema, + "password": passwd_schema +} +sdn_controller_schema = { + "title":"sdn controller information schema", + "$schema": "http://json-schema.org/draft-04/schema#", + "type":"object", + "properties":{ + "sdn_controller":{ + "type":"object", + "properties":sdn_controller_properties, + "required": ["name", "port", 'ip', 'dpid', 'type'], + "additionalProperties": False + } + }, + "required": ["sdn_controller"], + "additionalProperties": False +} + +sdn_controller_edit_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, + "additionalProperties": False + } + }, + "required": ["sdn_controller"], + "additionalProperties": False +} + +sdn_port_mapping_schema = { + "$schema": "http://json-schema.org/draft-04/schema#", + "title":"sdn port mapping information schema", + "type": "object", + "properties": { + "sdn_port_mapping": { + "type": "array", + "items": { + "type": "object", + "properties": { + "compute_node": nameshort_schema, + "ports": { + "type": "array", + "items": { + "type": "object", + "properties": { + "pci": pci_schema, + "switch_port": nameshort_schema, + "switch_mac": mac_schema + }, + "required": ["pci"] + } + } + }, + "required": ["compute_node", "ports"] + } + } + }, + "required": ["sdn_port_mapping"] +} \ No newline at end of file