1 # -*- coding: utf-8 -*-
4 # Copyright 2015 Telefonica Investigacion y Desarrollo, S.A.U.
5 # This file is part of openmano
8 # Licensed under the Apache License, Version 2.0 (the "License"); you may
9 # not use this file except in compliance with the License. You may obtain
10 # a copy of the License at
12 # http://www.apache.org/licenses/LICENSE-2.0
14 # Unless required by applicable law or agreed to in writing, software
15 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
17 # License for the specific language governing permissions and limitations
20 # For those usages not covered by the Apache License, Version 2.0 please
21 # contact with: nfvlabs@tid.es
25 JSON schemas used by openmano httpserver.py module to parse the different files and messages sent through the API
27 __author__
="Alfonso Tierno, Gerardo Garcia, Pablo Montes"
28 __date__
="$09-oct-2014 09:09:48$"
31 patern_name
="^[ -~]+$"
32 passwd_schema
={"type" : "string", "minLength":1, "maxLength":60}
33 nameshort_schema
={"type" : "string", "minLength":1, "maxLength":60, "pattern" : "^[^,;()'\"]+$"}
34 name_schema
={"type" : "string", "minLength":1, "maxLength":255, "pattern" : "^[^,;()'\"]+$"}
35 xml_text_schema
={"type" : "string", "minLength":1, "maxLength":1000, "pattern" : "^[^']+$"}
36 description_schema
={"type" : ["string","null"], "maxLength":255, "pattern" : "^[^'\"]+$"}
37 id_schema_fake
= {"type" : "string", "minLength":2, "maxLength":36 } #"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
38 id_schema
= {"type" : "string", "pattern": "^[a-fA-F0-9]{8}(-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}$"}
39 pci_schema
={"type":"string", "pattern":"^[0-9a-fA-F]{4}(:[0-9a-fA-F]{2}){2}\.[0-9a-fA-F]$"}
40 # allows [] for wildcards. For that reason huge length limit is set
41 pci_extended_schema
= {"type": "string", "pattern": "^[0-9a-fA-F.:-\[\]]{12,40}$"}
43 http_schema
={"type":"string", "pattern":"^https?://[^'\"=]+$"}
44 bandwidth_schema
={"type":"string", "pattern" : "^[0-9]+ *([MG]bps)?$"}
45 memory_schema
={"type":"string", "pattern" : "^[0-9]+ *([MG]i?[Bb])?$"}
46 integer0_schema
={"type":"integer","minimum":0}
47 integer1_schema
={"type":"integer","minimum":1}
48 path_schema
={"type":"string", "pattern":"^(\.){0,2}(/[^/\"':{}\(\)]+)+$"}
49 vlan_schema
={"type":"integer","minimum":1,"maximum":4095}
50 vlan1000_schema
={"type":"integer","minimum":1000,"maximum":4095}
51 mac_schema
={"type":"string", "pattern":"^[0-9a-fA-F][02468aceACE](:[0-9a-fA-F]{2}){5}$"} #must be unicast LSB bit of MSB byte ==0
52 #mac_schema={"type":"string", "pattern":"^([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}$"}
53 ip_schema
={"type":"string","pattern":"^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$"}
54 ip_prefix_schema
={"type":"string","pattern":"^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)/(30|[12]?[0-9])$"}
55 port_schema
={"type":"integer","minimum":1,"maximum":65534}
56 object_schema
={"type":"object"}
57 schema_version_2
={"type":"integer","minimum":2,"maximum":2}
58 #schema_version_string={"type":"string","enum": ["0.1", "2", "0.2", "3", "0.3"]}
59 log_level_schema
={"type":"string", "enum":["DEBUG", "INFO", "WARNING","ERROR","CRITICAL"]}
60 checksum_schema
={"type":"string", "pattern":"^[0-9a-fA-F]{32}$"}
61 size_schema
={"type":"integer","minimum":1,"maximum":100}
66 "architecture": {"type":"string"},
67 "use_incremental": {"type":"string","enum":["yes","no"]},
69 "os_distro": {"type":"string"},
70 "os_type": {"type":"string"},
71 "os_version": {"type":"string"},
72 "bus": {"type":"string"},
73 "topology": {"type":"string", "enum": ["oneSocket"]}
77 #Schema for the configuration file
79 "title":"configuration response information schema",
80 "$schema": "http://json-schema.org/draft-04/schema#",
83 "http_port": port_schema
,
84 "http_admin_port": port_schema
,
85 "http_host": nameshort_schema
,
86 "auto_push_VNF_to_VIMs": {"type":"boolean"},
87 "vnf_repository": path_schema
,
88 "db_host": nameshort_schema
,
89 "db_user": nameshort_schema
,
90 "db_passwd": {"type":"string"},
91 "db_name": nameshort_schema
,
92 "db_ovim_host": nameshort_schema
,
93 "db_ovim_user": nameshort_schema
,
94 "db_ovim_passwd": {"type":"string"},
95 "db_ovim_name": nameshort_schema
,
96 # Next fields will disappear once the MANO API includes appropriate primitives
97 "vim_url": http_schema
,
98 "vim_url_admin": http_schema
,
99 "vim_name": nameshort_schema
,
100 "vim_tenant_name": nameshort_schema
,
101 "mano_tenant_name": nameshort_schema
,
102 "mano_tenant_id": id_schema
,
103 "http_console_proxy": {"type":"boolean"},
104 "http_console_host": nameshort_schema
,
105 "http_console_ports": {
109 {"type": "object", "properties": {"from": port_schema
, "to": port_schema
}, "required": ["from", "to"]}
112 "log_level": log_level_schema
,
113 "log_socket_level": log_level_schema
,
114 "log_level_db": log_level_schema
,
115 "log_level_vim": log_level_schema
,
116 "log_level_nfvo": log_level_schema
,
117 "log_level_http": log_level_schema
,
118 "log_level_console": log_level_schema
,
119 "log_level_ovim": log_level_schema
,
120 "log_file_db": path_schema
,
121 "log_file_vim": path_schema
,
122 "log_file_nfvo": path_schema
,
123 "log_file_http": path_schema
,
124 "log_file_console": path_schema
,
125 "log_file_ovim": path_schema
,
126 "log_socket_host": nameshort_schema
,
127 "log_socket_port": port_schema
,
128 "log_file": path_schema
,
130 "required": ['db_user', 'db_passwd', 'db_name'],
131 "additionalProperties": False
135 "title":"tenant information schema",
136 "$schema": "http://json-schema.org/draft-04/schema#",
142 "name": nameshort_schema
,
143 "description": description_schema
,
145 "required": ["name"],
146 "additionalProperties": True
149 "required": ["tenant"],
150 "additionalProperties": False
153 tenant_edit_schema
= {
154 "title":"tenant edit information schema",
155 "$schema": "http://json-schema.org/draft-04/schema#",
162 "description": description_schema
,
164 "additionalProperties": False
167 "required": ["tenant"],
168 "additionalProperties": False
171 datacenter_schema_properties
={
173 "description": description_schema
,
174 "type": nameshort_schema
, #currently "openvim" or "openstack", can be enlarged with plugins
175 "vim_url": description_schema
,
176 "vim_url_admin": description_schema
,
177 "config": { "type":"object" }
180 datacenter_schema
= {
181 "title":"datacenter information schema",
182 "$schema": "http://json-schema.org/draft-04/schema#",
187 "properties":datacenter_schema_properties
,
188 "required": ["name", "vim_url"],
189 "additionalProperties": True
192 "required": ["datacenter"],
193 "additionalProperties": False
197 datacenter_edit_schema
= {
198 "title":"datacenter edit nformation schema",
199 "$schema": "http://json-schema.org/draft-04/schema#",
204 "properties":datacenter_schema_properties
,
205 "additionalProperties": False
208 "required": ["datacenter"],
209 "additionalProperties": False
213 netmap_new_schema
= {
214 "title":"netmap new information schema",
215 "$schema": "http://json-schema.org/draft-04/schema#",
218 "netmap":{ #delete from datacenter
221 "name": name_schema
, #name or uuid of net to change
223 "vim_name": name_schema
226 "additionalProperties": False
229 "required": ["netmap"],
230 "additionalProperties": False
233 netmap_edit_schema
= {
234 "title":"netmap edit information schema",
235 "$schema": "http://json-schema.org/draft-04/schema#",
238 "netmap":{ #delete from datacenter
241 "name": name_schema
, #name or uuid of net to change
244 "additionalProperties": False
247 "required": ["netmap"],
248 "additionalProperties": False
251 datacenter_action_schema
= {
252 "title":"datacenter action information schema",
253 "$schema": "http://json-schema.org/draft-04/schema#",
256 "net-update":{"type":"null",},
260 "net": name_schema
, #name or uuid of net to change
262 "description": description_schema
,
263 "shared": {"type": "boolean"}
266 "additionalProperties": False
271 "net": name_schema
, #name or uuid of net to change
274 "additionalProperties": False
279 "additionalProperties": False
283 datacenter_associate_schema
={
284 "title":"datacenter associate information schema",
285 "$schema": "http://json-schema.org/draft-04/schema#",
293 "vim_tenant": name_schema
,
294 "vim_tenant_name": name_schema
,
295 "vim_username": nameshort_schema
,
296 "vim_password": nameshort_schema
,
297 "config": {"type": "object"}
299 # "required": ["vim_tenant"],
300 "additionalProperties": True
303 "required": ["datacenter"],
304 "additionalProperties": False
308 "title": "DHCP schema",
309 "$schema": "http://json-schema.org/draft-04/schema#",
312 "enabled": {"type": "boolean"},
313 "start-address": {"OneOf": [{"type": "null"}, ip_schema
]},
314 "count": integer0_schema
316 # "required": ["start-address", "count"],
319 ip_profile_schema
= {
320 "title": "IP profile schema",
321 "$schema": "http://json-schema.org/draft-04/schema#",
324 "ip-version": {"type": "string", "enum": ["IPv4", "IPv6"]},
325 "subnet-address": ip_prefix_schema
,
326 "gateway-address": ip_schema
,
327 "dns-address": {"oneOf": [ip_schema
, # for backward compatibility
328 {"type": "array", "items": ip_schema
}]},
334 "title": "Key-pair schema for cloud-init configuration schema",
335 "$schema": "http://json-schema.org/draft-04/schema#",
339 "key": {"type":"string"}
342 "additionalProperties": False
345 cloud_config_user_schema
= {
346 "title": "User schema for cloud-init configuration schema",
347 "$schema": "http://json-schema.org/draft-04/schema#",
350 "name": nameshort_schema
,
351 "user-info": {"type":"string"},
352 #"key-pairs": {"type" : "array", "items": key_pair_schema}
353 "key-pairs": {"type" : "array", "items": {"type":"string"}}
355 "required": ["name"],
356 "additionalProperties": False
359 cloud_config_schema
= {
360 "title": "Cloud-init configuration schema",
361 "$schema": "http://json-schema.org/draft-04/schema#",
364 #"key-pairs": {"type" : "array", "items": key_pair_schema},
365 "key-pairs": {"type" : "array", "items": {"type":"string"}},
366 "users": {"type" : "array", "items": cloud_config_user_schema
}
368 "additionalProperties": False
371 internal_connection_element_schema
= {
375 "local_iface_name": name_schema
379 internal_connection_element_schema_v02
= {
383 "local_iface_name": name_schema
,
384 "ip_address": ip_schema
388 internal_connection_schema
= {
392 "description":description_schema
,
393 "type":{"type":"string", "enum":["bridge","data","ptp"]},
394 "elements": {"type" : "array", "items": internal_connection_element_schema
, "minItems":1}
396 "required": ["name", "type", "elements"],
397 "additionalProperties": False
400 internal_connection_schema_v02
= {
404 "description":description_schema
,
405 "type": {"type": "string", "enum":["e-line", "e-lan"]},
406 "implementation": {"type": "string", "enum":["overlay", "underlay"]},
407 "ip-profile": ip_profile_schema
,
408 "elements": {"type" : "array", "items": internal_connection_element_schema_v02
, "minItems":1}
410 "required": ["name", "type", "implementation", "elements"],
411 "additionalProperties": False
414 external_connection_schema
= {
418 "type":{"type":"string", "enum":["mgmt","bridge","data"]},
420 "local_iface_name": name_schema
,
421 "description":description_schema
423 "required": ["name", "type", "VNFC", "local_iface_name"],
424 "additionalProperties": False
428 external_connection_schema_v02
= {
432 "mgmt": {"type":"boolean"},
433 "type": {"type": "string", "enum":["e-line", "e-lan"]},
434 "implementation": {"type": "string", "enum":["overlay", "underlay"]},
436 "local_iface_name": name_schema
,
437 "description":description_schema
439 "required": ["name", "type", "VNFC", "local_iface_name"],
440 "additionalProperties": False
449 "dedicated":{"type":"string","enum":["yes","no","yes:sriov"]},
450 "bandwidth":bandwidth_schema
,
452 "mac_address": mac_schema
454 "additionalProperties": False,
455 "required": ["name","dedicated", "bandwidth"]
459 bridge_interfaces_schema
={
465 "bandwidth":bandwidth_schema
,
467 "mac_address": mac_schema
,
468 "model": {"type":"string", "enum":["virtio","e1000","ne2k_pci","pcnet","rtl8139"]},
469 "port-security": {"type" : "boolean"},
470 "floating-ip": {"type" : "boolean"}
472 "additionalProperties": False,
482 "type":{"type":"string", "enum":["disk","cdrom","xml"] },
483 "image": path_schema
,
484 "image name": name_schema
,
485 "image checksum": checksum_schema
,
486 "image metadata": metadata_schema
,
489 "xml":xml_text_schema
,
492 "additionalProperties": False,
501 "memory":integer1_schema
,
502 "cores":integer1_schema
,
503 "paired-threads":integer1_schema
,
504 "threads":integer1_schema
,
505 "cores-id":{"type":"array","items":integer0_schema
},
506 "paired-threads-id":{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":integer0_schema
}},
507 "threads-id":{"type":"array","items":integer0_schema
},
508 "interfaces":interfaces_schema
510 "additionalProperties": False,
511 #"required": ["memory"]
514 config_files_schema
= {
515 "title": "Config files for cloud init schema",
516 "$schema": "http://json-schema.org/draft-04/schema#",
520 "encoding": {"type": "string", "enum": ["b64", "base64", "gz", "gz+b64", "gz+base64", "gzip+b64", "gzip+base64"]}, #by default text
521 "content": {"type": "string"},
522 "permissions": {"type": "string"}, # tiypically octal notation '0644'
523 "owner": {"type": "string"}, # format: owner:group
526 "additionalProperties": False,
527 "required": ["dest", "content"],
530 boot_data_vdu_schema
= {
531 "title": "Boot data (Cloud-init) configuration schema",
532 "$schema": "http://json-schema.org/draft-04/schema#",
535 "key-pairs": {"type" : "array", "items": {"type":"string"}},
536 "users": {"type" : "array", "items": cloud_config_user_schema
},
537 "user-data": {"type" : "string"}, # scrip to run
538 "config-files": {"type": "array", "items": config_files_schema
},
539 # NOTE: “user-data” are mutually exclusive with users and config-files because user/files are injected using user-data
540 "boot-data-drive": {"type": "boolean"},
542 "additionalProperties": False,
549 "description": description_schema
,
550 "count": integer1_schema
,
551 "image name": name_schema
,
552 "availability_zone": name_schema
,
553 "VNFC image": {"oneOf": [path_schema
, http_schema
]},
554 "image checksum": checksum_schema
,
555 "image metadata": metadata_schema
,
556 #"cloud-config": cloud_config_schema, #common for all vnfs in the scenario
560 "model":description_schema
,
561 "features":{"type":"array","items":nameshort_schema
}
563 "required": ["model"],
564 "additionalProperties": False
569 "type":nameshort_schema
,
570 "version":description_schema
573 "ram":integer0_schema
,
574 "vcpus":integer0_schema
,
575 "disk": integer1_schema
,
580 "bridge-ifaces": bridge_interfaces_schema
,
581 "devices": devices_schema
,
582 "boot-data" : boot_data_vdu_schema
585 "required": ["name"],
587 {"required": ["VNFC image"]},
588 {"required": ["image name"]}
590 "additionalProperties": False
594 "title":"vnfd information schema v0.1",
595 "$schema": "http://json-schema.org/draft-04/schema#",
602 "description": description_schema
,
604 "class": nameshort_schema
,
605 "public": {"type" : "boolean"},
606 "physical": {"type" : "boolean"},
607 "default_user": name_schema
,
608 "tenant_id": id_schema
, #only valid for admin
609 "external-connections": {"type" : "array", "items": external_connection_schema
, "minItems":1},
610 "internal-connections": {"type" : "array", "items": internal_connection_schema
, "minItems":1},
611 "VNFC":{"type" : "array", "items": vnfc_schema
, "minItems":1}
613 "required": ["name","external-connections"],
614 "additionalProperties": True
618 "additionalProperties": False
621 #VNFD schema for OSM R1
623 "title":"vnfd information schema v0.2",
624 "$schema": "http://json-schema.org/draft-04/schema#",
627 "schema_version": {"type": "string", "enum": ["0.2"]},
632 "description": description_schema
,
633 "class": nameshort_schema
,
634 "public": {"type" : "boolean"},
635 "physical": {"type" : "boolean"},
636 "tenant_id": id_schema
, #only valid for admin
637 "external-connections": {"type" : "array", "items": external_connection_schema
, "minItems":1},
638 "internal-connections": {"type" : "array", "items": internal_connection_schema_v02
, "minItems":1},
639 # "cloud-config": cloud_config_schema, #common for all vnfcs
640 "VNFC":{"type" : "array", "items": vnfc_schema
, "minItems":1}
642 "required": ["name"],
643 "additionalProperties": True
646 "required": ["vnf", "schema_version"],
647 "additionalProperties": False
650 #vnfd_schema = vnfd_schema_v01
652 # "title":"vnfd information schema v0.2",
653 # "$schema": "http://json-schema.org/draft-04/schema#",
654 # "oneOf": [vnfd_schema_v01, vnfd_schema_v02]
658 "title":"graphical scenario descriptor information schema",
659 "$schema": "http://json-schema.org/draft-04/schema#",
662 "x": integer0_schema
,
663 "y": integer0_schema
,
667 "left": {"type":"array"},
668 "right": {"type":"array"},
669 "bottom": {"type":"array"},
673 "required": ["x","y"]
677 "title":"network scenario descriptor information schema v0.1",
678 "$schema": "http://json-schema.org/draft-04/schema#",
682 "description": description_schema
,
683 "tenant_id": id_schema
, #only valid for admin
684 "public": {"type": "boolean"},
690 "patternProperties":{
694 "type":{"type":"string", "enum":["VNF", "other_network", "network", "external_network"]},
696 "graph": graph_schema
,
698 "patternProperties":{
699 "^(VNF )?model$": {"type": "string"}
707 "patternProperties":{
711 "nodes":{"oneOf":[{"type":"object", "minProperties":2}, {"type":"array", "minLength":1}]},
712 "type": {"type": "string", "enum":["link", "external_network", "dataplane_net", "bridge_net"]},
713 "graph": graph_schema
715 "required": ["nodes"]
720 "required": ["nodes"],
721 "additionalProperties": False
724 "required": ["name","topology"],
725 "additionalProperties": False
729 "title":"network scenario descriptor information schema v0.2",
730 "$schema": "http://json-schema.org/draft-04/schema#",
733 "schema_version": schema_version_2
,
738 "description": description_schema
,
739 "tenant_id": id_schema
, #only valid for admin
740 "public": {"type": "boolean"},
743 "patternProperties":{
748 "graph": graph_schema
,
749 "vnf_name": name_schema
,
757 "patternProperties":{
761 "interfaces":{"type":"array", "minLength":1},
762 "type": {"type": "string", "enum":["dataplane", "bridge"]},
763 "external" : {"type": "boolean"},
764 "graph": graph_schema
766 "required": ["interfaces"]
772 "required": ["vnfs", "name"],
773 "additionalProperties": False
776 "required": ["scenario","schema_version"],
777 "additionalProperties": False
780 #NSD schema for OSM R1
782 "title":"network scenario descriptor information schema v0.3",
783 "$schema": "http://json-schema.org/draft-04/schema#",
786 "schema_version": {"type": "string", "enum": ["0.3"]},
791 "description": description_schema
,
792 "tenant_id": id_schema
, #only valid for admin
793 "public": {"type": "boolean"},
794 "cloud-config": cloud_config_schema
, #common for all vnfs in the scenario
795 #"datacenter": name_schema,
798 "patternProperties":{
803 "graph": graph_schema
,
804 "vnf_name": name_schema
,
805 #"cloud-config": cloud_config_schema, #particular for a vnf
806 #"datacenter": name_schema,
807 "internal-connections": {
809 "patternProperties": {
813 "ip-profile": ip_profile_schema
,
820 "local_iface_name": name_schema
,
821 "ip_address": ip_schema
,
823 "required": ["VNFC", "local_iface_name"],
837 "patternProperties":{
848 "vnf_interface": name_schema
,
849 "ip_address": ip_schema
851 "required": ["vnf", "vnf_interface"],
854 "type": {"type": "string", "enum":["e-line", "e-lan"]},
855 "implementation": {"type": "string", "enum":["overlay", "underlay"]},
856 "external" : {"type": "boolean"},
857 "graph": graph_schema
,
858 "ip-profile": ip_profile_schema
860 "required": ["interfaces"]
866 "required": ["vnfs", "networks","name"],
867 "additionalProperties": False
870 "required": ["scenario","schema_version"],
871 "additionalProperties": False
874 #scenario_new_schema = {
875 # "title":"new scenario information schema",
876 # "$schema": "http://json-schema.org/draft-04/schema#",
877 # #"oneOf": [nsd_schema_v01, nsd_schema_v02]
878 # "oneOf": [nsd_schema_v01]
881 scenario_edit_schema
= {
882 "title":"edit scenario information schema",
883 "$schema": "http://json-schema.org/draft-04/schema#",
887 "description": description_schema
,
893 "patternProperties":{
894 "^[a-fA-F0-9]{8}(-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}$": {
900 "x": integer0_schema
,
901 "y": integer0_schema
,
902 "ifaces":{ "type": "object"}
905 "description": description_schema
,
912 "required": ["nodes"],
913 "additionalProperties": False
916 "additionalProperties": False
919 scenario_action_schema
= {
920 "title":"scenario action information schema",
921 "$schema": "http://json-schema.org/draft-04/schema#",
927 "instance_name":name_schema
,
928 "description":description_schema
,
929 "datacenter": {"type": "string"}
931 "required": ["instance_name"]
936 "instance_name":name_schema
,
937 "description":description_schema
,
938 "datacenter": {"type": "string"}
940 "required": ["instance_name"]
945 "instance_name":name_schema
,
946 "description":description_schema
,
947 "datacenter": {"type": "string"}
949 "required": ["instance_name"]
954 "instance_name":name_schema
,
955 "description":description_schema
,
956 "datacenter": {"type": "string"}
958 "required": ["instance_name"]
963 "additionalProperties": False
966 instance_scenario_create_schema_v01
= {
967 "title":"instance scenario create information schema v0.1",
968 "$schema": "http://json-schema.org/draft-04/schema#",
971 "schema_version": {"type": "string", "enum": ["0.1"]},
976 "description":description_schema
,
977 "datacenter": name_schema
,
978 "scenario" : name_schema
, #can be an UUID or name
979 "action":{"enum": ["deploy","reserve","verify" ]},
980 "connect_mgmt_interfaces": {"oneOf": [{"type":"boolean"}, {"type":"object"}]},# can be true or a dict with datacenter: net_name
981 "cloud-config": cloud_config_schema
, #common to all vnfs in the instance scenario
982 "vnfs":{ #mapping from scenario to datacenter
984 "patternProperties":{
988 "name": name_schema
, #override vnf name
989 "datacenter": name_schema
,
990 #"metadata": {"type": "object"},
991 #"user_data": {"type": "string"}
992 #"cloud-config": cloud_config_schema, #particular for a vnf
995 "patternProperties": {
999 "name": name_schema
, # overrides vdu name schema
1002 "patternProperties": {
1004 "vim_id": name_schema
,
1010 "patternProperties": {
1012 "ip_address": ip_schema
,
1013 "mac_address": mac_schema
,
1014 "floating-ip": {"type": "boolean"},
1024 "patternProperties": {
1028 "vim-network-name": name_schema
,
1029 "ip-profile": ip_profile_schema
,
1030 "name": name_schema
,
1039 "networks":{ #mapping from scenario to datacenter
1041 "patternProperties":{
1051 "ip_address": ip_schema
,
1052 "datacenter": name_schema
,
1053 "vim-network-name": name_schema
1055 "patternProperties":{
1056 ".": {"type": "string"}
1060 "ip-profile": ip_profile_schema
,
1061 #if the network connects VNFs deployed at different sites, you must specify one entry per site that this network connect to
1068 # By default for an scenario 'external' network openmano looks for an existing VIM network to map this external scenario network,
1069 # for other networks openamno creates at VIM
1070 # Use netmap-create to force to create an external scenario network
1071 "netmap-create": {"oneOf":[name_schema
,{"type": "null"}]}, #datacenter network to use. Null if must be created as an internal net
1072 #netmap-use: Indicates an existing VIM network that must be used for this scenario network.
1073 #Can use both the VIM network name (if it is not ambiguous) or the VIM net UUID
1074 #If both 'netmap-create' and 'netmap-use'are supplied, netmap-use precedes, but if fails openmano follows the netmap-create
1075 #In oder words, it is the same as 'try to map to the VIM network (netmap-use) if exist, and if not create the network (netmap-create)
1076 "netmap-use": name_schema
, #
1077 "vim-network-name": name_schema
, #override network name
1078 #"ip-profile": ip_profile_schema,
1079 "datacenter": name_schema
,
1088 "additionalProperties": False,
1089 "required": ["name"]
1092 "required": ["instance"],
1093 "additionalProperties": False
1096 instance_scenario_action_schema
= {
1097 "title": "instance scenario action information schema",
1098 "$schema": "http://json-schema.org/draft-04/schema#",
1101 "start": {"type": "null"},
1102 "pause": {"type": "null"},
1103 "resume": {"type": "null"},
1104 "shutoff": {"type": "null"},
1105 "shutdown": {"type": "null"},
1106 "forceOff": {"type": "null"},
1107 "rebuild": {"type": "null"},
1109 "type": ["object", "null"],
1111 "add_public_key": description_schema
,
1112 "console": {"type": ["string", "null"], "enum": ["novnc", "xvpvnc", "rdp-html5", "spice-html5", None]},
1118 "vdu-id": id_schema
,
1119 "osm_vdu_id": name_schema
,
1120 "member-vnf-index": name_schema
,
1121 "count": integer1_schema
,
1122 "type": {"enum": ["create", "delete"]}
1124 "additionalProperties": False,
1126 "required": ["type"]
1129 "vnfs": {"type": "array", "items": {"type": "string"}},
1130 "vms": {"type": "array", "items": {"type": "string"}}
1133 #"maxProperties": 1,
1134 "additionalProperties": False
1137 sdn_controller_properties
={
1138 "name": name_schema
,
1139 "dpid": {"type":"string", "pattern":"^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){7}$"},
1141 "port": port_schema
,
1142 "type": {"type": "string", "enum": ["opendaylight","floodlight","onos"]},
1143 "version": {"type" : "string", "minLength":1, "maxLength":12},
1144 "user": nameshort_schema
,
1145 "password": passwd_schema
1147 sdn_controller_schema
= {
1148 "title":"sdn controller information schema",
1149 "$schema": "http://json-schema.org/draft-04/schema#",
1154 "properties":sdn_controller_properties
,
1155 "required": ["name", "port", 'ip', 'dpid', 'type'],
1156 "additionalProperties": False
1159 "required": ["sdn_controller"],
1160 "additionalProperties": False
1163 sdn_controller_edit_schema
= {
1164 "title":"sdn controller update information schema",
1165 "$schema": "http://json-schema.org/draft-04/schema#",
1170 "properties":sdn_controller_properties
,
1171 "additionalProperties": False
1174 "required": ["sdn_controller"],
1175 "additionalProperties": False
1178 sdn_port_mapping_schema
= {
1179 "$schema": "http://json-schema.org/draft-04/schema#",
1180 "title":"sdn port mapping information schema",
1183 "sdn_port_mapping": {
1188 "compute_node": nameshort_schema
,
1194 "pci": pci_extended_schema
, # pci_schema,
1195 "switch_port": nameshort_schema
,
1196 "switch_mac": mac_schema
1202 "required": ["compute_node", "ports"]
1206 "required": ["sdn_port_mapping"]
1209 sdn_external_port_schema
= {
1210 "$schema": "http://json-schema.org/draft-04/schema#",
1211 "title":"External port ingformation",
1214 "port": {"type" : "string", "minLength":1, "maxLength":60},
1215 "vlan": vlan_schema
,
1218 "required": ["port"]