69d6a0cd924a9168023dfb7b765d707ddc856483
[osm/openvim.git] / osm_openvim / vim_schema.py
1 # -*- coding: utf-8 -*-
2
3 ##
4 # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U.
5 # This file is part of openvim
6 # All Rights Reserved.
7 #
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
11 #
12 # http://www.apache.org/licenses/LICENSE-2.0
13 #
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
18 # under the License.
19 #
20 # For those usages not covered by the Apache License, Version 2.0 please
21 # contact with: nfvlabs@tid.es
22 ##
23
24 ''' Definition of dictionaries schemas used by validating input
25 These dictionaries are validated using jsonschema library
26 '''
27 __author__="Alfonso Tierno"
28 __date__ ="$10-jul-2014 12:07:15$"
29
30 #
31 # SCHEMAS to validate input data
32 #
33
34 path_schema={"type":"string", "pattern":"^(\.){0,2}(/[^/\"':{}\(\)]+)+$"}
35 http_schema={"type":"string", "pattern":"^https?://[^'\"=]+$"}
36 port_schema={"type":"integer","minimum":1,"maximun":65534}
37 ip_schema={"type":"string","pattern":"^([0-9]{1,3}.){3}[0-9]{1,3}$"}
38 cidr_schema={"type":"string","pattern":"^([0-9]{1,3}.){3}[0-9]{1,3}/[0-9]{1,2}$"}
39 name_schema={"type" : "string", "minLength":1, "maxLength":255, "pattern" : "^[^,;()'\"]+$"}
40 nameshort_schema={"type" : "string", "minLength":1, "maxLength":64, "pattern" : "^[^,;()'\"]+$"}
41 nametiny_schema={"type" : "string", "minLength":1, "maxLength":12, "pattern" : "^[^,;()'\"]+$"}
42 xml_text_schema={"type" : "string", "minLength":1, "maxLength":1000, "pattern" : "^[^']+$"}
43 description_schema={"type" : ["string","null"], "maxLength":255, "pattern" : "^[^'\"]+$"}
44 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}$"
45 id_schema = {"type" : "string", "pattern": "^[a-fA-F0-9]{8}(-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}$"}
46 pci_schema={"type":"string", "pattern":"^[0-9a-fA-F]{4}(:[0-9a-fA-F]{2}){2}\.[0-9a-fA-F]$"}
47 bandwidth_schema={"type":"string", "pattern" : "^[0-9]+ *([MG]bps)?$"}
48 integer0_schema={"type":"integer","minimum":0}
49 integer1_schema={"type":"integer","minimum":1}
50 vlan_schema={"type":"integer","minimum":1,"maximun":4095}
51 vlan1000_schema={"type":"integer","minimum":1000,"maximun":4095}
52 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
53 net_bind_schema={"oneOf":[{"type":"null"},{"type":"string", "pattern":"^(default|((bridge|macvtap):[0-9a-zA-Z\.\-]{1,50})|openflow:[/0-9a-zA-Z\.\-]{1,50}(:vlan)?)$"}]}
54 yes_no_schema={"type":"string", "enum":["yes", "no"]}
55 log_level_schema={"type":"string", "enum":["DEBUG", "INFO", "WARNING","ERROR","CRITICAL"]}
56
57 config_schema = {
58 "title":"main configuration information schema",
59 "$schema": "http://json-schema.org/draft-04/schema#",
60 "type":"object",
61 "properties":{
62 "http_port": port_schema,
63 "http_admin_port": port_schema,
64 "http_host": nameshort_schema,
65 "http_url_prefix": path_schema, # it does not work yet; it's supposed to be the base path to be used by bottle, but it must be explicitly declared
66 "db_host": nameshort_schema,
67 "db_user": nameshort_schema,
68 "db_passwd": {"type":"string"},
69 "db_name": nameshort_schema,
70 "of_controller_ip": ip_schema,
71 "of_controller_port": port_schema,
72 "of_controller_dpid": nameshort_schema,
73 "of_controller_nets_with_same_vlan": {"type" : "boolean"},
74 "of_controller": nameshort_schema, #{"type":"string", "enum":["floodlight", "opendaylight"]},
75 "of_controller_module": {"type":"string"},
76 "of_user": nameshort_schema,
77 "of_password": nameshort_schema,
78 "test_mode": {"type": "boolean"}, #leave for backward compatibility
79 "mode": {"type":"string", "enum":["normal", "host only", "OF only", "development", "test"] },
80 "development_bridge": {"type":"string"},
81 "tenant_id": {"type" : "string"},
82 "image_path": path_schema,
83 "network_vlan_range_start": vlan_schema,
84 "network_vlan_range_end": vlan_schema,
85 "bridge_ifaces": {
86 "type": "object",
87 "patternProperties": {
88 "." : {
89 "type": "array",
90 "items": integer0_schema,
91 "minItems":2,
92 "maxItems":2,
93 },
94 },
95 "minProperties": 2
96 },
97 "dhcp_server": {
98 "type": "object",
99 "properties": {
100 "host" : name_schema,
101 "port" : port_schema,
102 "provider" : {"type": "string", "enum": ["isc-dhcp-server"]},
103 "user" : nameshort_schema,
104 "password" : {"type": "string"},
105 "key" : {"type": "string"},
106 "bridge_ifaces" :{
107 "type": "array",
108 "items": nameshort_schema,
109 },
110 "nets" :{
111 "type": "array",
112 "items": name_schema,
113 },
114 },
115 "required": ['host', 'provider', 'user']
116 },
117 "log_level": log_level_schema,
118 "log_level_db": log_level_schema,
119 "log_level_of": log_level_schema,
120 "network_type": {"type": "string", "enum": ["ovs", "bridge"]},
121 "ovs_controller_file_path": path_schema,
122 "ovs_controller_user": nameshort_schema,
123
124 "ovs_controller_ip": nameshort_schema
125 },
126 "patternProperties": {
127 "of_*" : {"type": ["string", "integer", "boolean"]}
128 },
129 "required": ['db_host', 'db_user', 'db_passwd', 'db_name'],
130 "additionalProperties": False
131 }
132
133
134
135 metadata_schema={
136 "type":"object",
137 "properties":{
138 "architecture": {"type":"string"},
139 "use_incremental": yes_no_schema,
140 "vpci": pci_schema,
141 "os_distro": {"type":"string"},
142 "os_type": {"type":"string"},
143 "os_version": {"type":"string"},
144 "bus": {"type":"string"},
145 "topology": {"type":"string", "enum": ["oneSocket"]}
146 }
147 }
148
149 tenant_new_schema = {
150 "title":"tenant creation information schema",
151 "$schema": "http://json-schema.org/draft-04/schema#",
152 "type":"object",
153 "properties":{
154 "tenant":{
155 "type":"object",
156 "properties":{
157 "id":id_schema,
158 "name": nameshort_schema,
159 "description":description_schema,
160 "enabled":{"type" : "boolean"}
161 },
162 "required": ["name"]
163 }
164 },
165 "required": ["tenant"],
166 "additionalProperties": False
167 }
168
169 tenant_edit_schema = {
170 "title":"tenant edition information schema",
171 "$schema": "http://json-schema.org/draft-04/schema#",
172 "type":"object",
173 "properties":{
174 "tenant":{
175 "type":"object",
176 "minProperties":1,
177 "properties":{
178 "name":nameshort_schema,
179 "description":description_schema,
180 "enabled":{"type" : "boolean"}
181 },
182 "additionalProperties": False,
183 }
184 },
185 "required": ["tenant"],
186 "additionalProperties": False
187 }
188 interfaces_schema={
189 "type":"array",
190 "minItems":0,
191 "items":{
192 "type":"object",
193 "properties":{
194 "name":name_schema,
195 "dedicated":{"type":"string","enum":["yes","no","yes:sriov"]},
196 "bandwidth":bandwidth_schema,
197 "vpci":pci_schema,
198 "uuid":id_schema,
199 "mac_address":mac_schema
200 },
201 "additionalProperties": False,
202 "required": ["dedicated", "bandwidth"]
203 }
204 }
205
206 extended_schema={
207 "type":"object",
208 "properties":{
209 "processor_ranking":integer0_schema,
210 "devices":{
211 "type": "array",
212 "items":{
213 "type": "object",
214 "properties":{
215 "type":{"type":"string", "enum":["usb","disk","cdrom","xml"]},
216 "vpci":pci_schema,
217 "imageRef":id_schema,
218 "xml":xml_text_schema,
219 "dev":nameshort_schema
220 },
221 "additionalProperties": False,
222 "required": ["type"]
223 }
224 },
225 "numas":{
226 "type": "array",
227 "items":{
228 "type": "object",
229 "properties":{
230 "memory":integer1_schema,
231 "cores":integer1_schema,
232 "paired-threads":integer1_schema,
233 "threads":integer1_schema,
234 "cores-id":{"type":"array","items":integer0_schema},
235 "paired-threads-id":{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":integer0_schema}},
236 "threads-id":{"type":"array","items":integer0_schema},
237 "interfaces":interfaces_schema
238 },
239 "additionalProperties": False,
240 "minProperties": 1,
241 #"required": ["memory"]
242 }
243 }
244 },
245 #"additionalProperties": False,
246 #"required": ["processor_ranking"]
247 }
248
249 host_data_schema={
250 "title":"hosts manual insertion information schema",
251 "type":"object",
252 "properties":{
253 "ip_name":nameshort_schema,
254 "name": name_schema,
255 "description":description_schema,
256 "user":nameshort_schema,
257 "password":nameshort_schema,
258 "features":description_schema,
259 "ranking":integer0_schema,
260 "devices":{
261 "type": "array",
262 "items":{
263 "type": "object",
264 "properties":{
265 "type":{"type":"string", "enum":["usb","disk"]},
266 "vpci":pci_schema
267 },
268 "additionalProperties": False,
269 "required": ["type"]
270 }
271 },
272 "numas":{
273 "type": "array",
274 "minItems":1,
275 "items":{
276 "type": "object",
277 "properties":{
278 "admin_state_up":{"type":"boolean"},
279 "hugepages":integer0_schema,
280 "cores":{
281 "type": "array",
282 "minItems":2,
283 "items":{
284 "type": "object",
285 "properties":{
286 "core_id":integer0_schema,
287 "thread_id":integer0_schema,
288 "status": {"type":"string", "enum":["noteligible"]}
289 },
290 "additionalProperties": False,
291 "required": ["core_id","thread_id"]
292 }
293 },
294 "interfaces":{
295 "type": "array",
296 "minItems":1,
297 "items":{
298 "type": "object",
299 "properties":{
300 "source_name":nameshort_schema,
301 "mac":mac_schema,
302 "Mbps":integer0_schema,
303 "pci":pci_schema,
304 "sriovs":{
305 "type": "array",
306 "minItems":1,
307 "items":{
308 "type": "object",
309 "properties":{
310 "source_name":{"oneOf":[integer0_schema, nameshort_schema]},
311 "mac":mac_schema,
312 "vlan":integer0_schema,
313 "pci":pci_schema,
314 },
315 "additionalProperties": False,
316 "required": ["source_name","mac","pci"]
317 }
318 },
319 "switch_port": nameshort_schema,
320 "switch_dpid": nameshort_schema,
321 },
322 "additionalProperties": False,
323 "required": ["source_name","mac","Mbps","pci"]
324 }
325 },
326 "numa_socket":integer0_schema,
327 "memory":integer1_schema
328 },
329 "additionalProperties": False,
330 "required": ["cores","numa_socket"]
331 }
332 }
333 },
334 "additionalProperties": False,
335 "required": ["ranking", "numas","ip_name","user"]
336 }
337
338 host_edit_schema={
339 "title":"hosts creation information schema",
340 "$schema": "http://json-schema.org/draft-04/schema#",
341 "type":"object",
342 "properties":{
343 "host":{
344 "type":"object",
345 "properties":{
346 "ip_name":nameshort_schema,
347 "name": name_schema,
348 "description":description_schema,
349 "user":nameshort_schema,
350 "password":nameshort_schema,
351 "admin_state_up":{"type":"boolean"},
352 "numas":{
353 "type":"array",
354 "items":{
355 "type": "object",
356 "properties":{
357 "numa_socket": integer0_schema,
358 "admin_state_up":{"type":"boolean"},
359 "interfaces":{
360 "type":"array",
361 "items":{
362 "type": "object",
363 "properties":{
364 "source_name": nameshort_schema,
365 "switch_dpid": nameshort_schema,
366 "switch_port": nameshort_schema,
367 },
368 "required": ["source_name"],
369 }
370 }
371 },
372 "required": ["numa_socket"],
373 "additionalProperties": False,
374 }
375 }
376 },
377 "minProperties": 1,
378 "additionalProperties": False
379 },
380 },
381 "required": ["host"],
382 "minProperties": 1,
383 "additionalProperties": False
384 }
385
386 host_new_schema = {
387 "title":"hosts creation information schema",
388 "$schema": "http://json-schema.org/draft-04/schema#",
389 "type":"object",
390 "properties":{
391 "host":{
392 "type":"object",
393 "properties":{
394 "id":id_schema,
395 "ip_name":nameshort_schema,
396 "name": name_schema,
397 "description":description_schema,
398 "user":nameshort_schema,
399 "password":nameshort_schema,
400 "admin_state_up":{"type":"boolean"},
401 },
402 "required": ["name","ip_name","user"]
403 },
404 "host-data":host_data_schema
405 },
406 "required": ["host"],
407 "minProperties": 1,
408 "maxProperties": 2,
409 "additionalProperties": False
410 }
411
412
413 flavor_new_schema = {
414 "title":"flavor creation information schema",
415 "$schema": "http://json-schema.org/draft-04/schema#",
416 "type":"object",
417 "properties":{
418 "flavor":{
419 "type":"object",
420 "properties":{
421 "id":id_schema,
422 "name":name_schema,
423 "description":description_schema,
424 "ram":integer0_schema,
425 "vcpus":integer0_schema,
426 "extended": extended_schema,
427 "public": yes_no_schema
428 },
429 "required": ["name"]
430 }
431 },
432 "required": ["flavor"],
433 "additionalProperties": False
434 }
435 flavor_update_schema = {
436 "title":"flavor update information schema",
437 "$schema": "http://json-schema.org/draft-04/schema#",
438 "type":"object",
439 "properties":{
440 "flavor":{
441 "type":"object",
442 "properties":{
443 "name":name_schema,
444 "description":description_schema,
445 "ram":integer0_schema,
446 "vcpus":integer0_schema,
447 "extended": extended_schema,
448 "public": yes_no_schema
449 },
450 "minProperties": 1,
451 "additionalProperties": False
452 }
453 },
454 "required": ["flavor"],
455 "additionalProperties": False
456 }
457
458 image_new_schema = {
459 "title":"image creation information schema",
460 "$schema": "http://json-schema.org/draft-04/schema#",
461 "type":"object",
462 "properties":{
463 "image":{
464 "type":"object",
465 "properties":{
466 "id":id_schema,
467 "path": {"oneOf": [path_schema, http_schema]},
468 "description":description_schema,
469 "name":name_schema,
470 "metadata":metadata_schema,
471 "public": yes_no_schema
472 },
473 "required": ["name","path"]
474 }
475 },
476 "required": ["image"],
477 "additionalProperties": False
478 }
479
480 image_update_schema = {
481 "title":"image update information schema",
482 "$schema": "http://json-schema.org/draft-04/schema#",
483 "type":"object",
484 "properties":{
485 "image":{
486 "type":"object",
487 "properties":{
488 "path":{"oneOf": [path_schema, http_schema]},
489 "description":description_schema,
490 "name":name_schema,
491 "metadata":metadata_schema,
492 "public": yes_no_schema
493 },
494 "minProperties": 1,
495 "additionalProperties": False
496 }
497 },
498 "required": ["image"],
499 "additionalProperties": False
500 }
501
502 networks_schema={
503 "type":"array",
504 "items":{
505 "type":"object",
506 "properties":{
507 "name":name_schema,
508 "bandwidth":bandwidth_schema,
509 "vpci":pci_schema,
510 "uuid":id_schema,
511 "mac_address": mac_schema,
512 "model": {"type":"string", "enum":["virtio","e1000","ne2k_pci","pcnet","rtl8139"]},
513 "type": {"type":"string", "enum":["virtual","PF","VF","VFnotShared"]}
514 },
515 "additionalProperties": False,
516 "required": ["uuid"]
517 }
518 }
519
520 server_new_schema = {
521 "title":"server creation information schema",
522 "$schema": "http://json-schema.org/draft-04/schema#",
523 "type":"object",
524 "properties":{
525 "server":{
526 "type":"object",
527 "properties":{
528 "id":id_schema,
529 "name":name_schema,
530 "description":description_schema,
531 "start":{"type":"string", "enum":["yes","no","paused"]},
532 "hostId":id_schema,
533 "flavorRef":id_schema,
534 "imageRef":id_schema,
535 "extended": extended_schema,
536 "networks":networks_schema
537 },
538 "required": ["name","flavorRef","imageRef"]
539 }
540 },
541 "required": ["server"],
542 "additionalProperties": False
543 }
544
545 server_action_schema = {
546 "title":"server action information schema",
547 "$schema": "http://json-schema.org/draft-04/schema#",
548 "type":"object",
549 "properties":{
550 "start":{"oneOf":[{"type": "null"}, {"type":"string", "enum":["rebuild","null"] }]},
551 "pause":{"type": "null"},
552 "resume":{"type": "null"},
553 "shutoff":{"type": "null"},
554 "shutdown":{"type": "null"},
555 "forceOff":{"type": "null"},
556 "terminate":{"type": "null"},
557 "createImage":{
558 "type":"object",
559 "properties":{
560 "path":path_schema,
561 "description":description_schema,
562 "name":name_schema,
563 "metadata":metadata_schema,
564 "imageRef": id_schema,
565 "disk": {"oneOf":[{"type": "null"}, {"type":"string"}] },
566 },
567 "required": ["name"]
568 },
569 "rebuild":{"type": ["object","null"]},
570 "reboot":{
571 "type": ["object","null"],
572 # "properties": {
573 # "type":{"type":"string", "enum":["SOFT"] }
574 # },
575 # "minProperties": 1,
576 # "maxProperties": 1,
577 # "additionalProperties": False
578 }
579 },
580 "minProperties": 1,
581 "maxProperties": 1,
582 "additionalProperties": False
583 }
584
585 network_new_schema = {
586 "title": "network creation information schema",
587 "$schema": "http://json-schema.org/draft-04/schema#",
588 "type": "object",
589 "properties": {
590 "network": {
591 "type": "object",
592 "properties":{
593 "id": id_schema,
594 "name": name_schema,
595 "type": {"type":"string", "enum": ["bridge_man", "bridge_data", "data", "ptp"]},
596 "shared": {"type": "boolean"},
597 "tenant_id": id_schema,
598 "admin_state_up": {"type": "boolean"},
599 "provider:vlan": vlan_schema,
600 "provider:physical": net_bind_schema,
601 "region": nameshort_schema,
602 "cidr": cidr_schema,
603 "enable_dhcp": {"type": "boolean"},
604 "dhcp_first_ip": ip_schema,
605 "dhcp_last_ip": ip_schema,
606 "bind_net": name_schema, # can be name, or uuid
607 "bind_type": {"oneOf": [{"type": "null"}, {"type": "string", "pattern": "^vlan:[0-9]{1,4}$"}]}
608 },
609 "required": ["name"]
610 }
611 },
612 "required": ["network"],
613 "additionalProperties": False
614 }
615
616 network_update_schema = {
617 "title":"network update information schema",
618 "$schema": "http://json-schema.org/draft-04/schema#",
619 "type":"object",
620 "properties":{
621 "network":{
622 "type":"object",
623 "properties":{
624 "name":name_schema,
625 "type":{"type":"string", "enum":["bridge_man","bridge_data","data", "ptp"]},
626 "shared":{"type":"boolean"},
627 "tenant_id":id_schema,
628 "admin_state_up":{"type":"boolean"},
629 "provider:vlan":vlan_schema,
630 "provider:physical":net_bind_schema,
631 "cidr":cidr_schema,
632 "enable_dhcp": {"type":"boolean"},
633 # "dhcp_first_ip": ip_schema,
634 # "dhcp_last_ip": ip_schema,
635 "bind_net":name_schema, #can be name, or uuid
636 "bind_type":{"oneOf":[{"type":"null"},{"type":"string", "pattern":"^vlan:[0-9]{1,4}$"}]}
637 },
638 "minProperties": 1,
639 "additionalProperties": False
640 }
641 },
642 "required": ["network"],
643 "additionalProperties": False
644 }
645
646
647 port_new_schema = {
648 "title":"port creation information schema",
649 "$schema": "http://json-schema.org/draft-04/schema#",
650 "type":"object",
651 "properties":{
652 "port":{
653 "type":"object",
654 "properties":{
655 "id":id_schema,
656 "name":nameshort_schema,
657 "network_id":{"oneOf":[{"type": "null"}, id_schema ]},
658 "tenant_id":id_schema,
659 "mac_address": {"oneOf":[{"type": "null"}, mac_schema] },
660 "admin_state_up":{"type":"boolean"},
661 "bandwidth":bandwidth_schema,
662 "binding:switch_port":nameshort_schema,
663 "binding:vlan": {"oneOf":[{"type": "null"}, vlan_schema ]}
664 },
665 "required": ["name"]
666 }
667 },
668 "required": ["port"],
669 "additionalProperties": False
670 }
671
672 port_update_schema = {
673 "title":"port update information schema",
674 "$schema": "http://json-schema.org/draft-04/schema#",
675 "type":"object",
676 "properties":{
677 "port":{
678 "type":"object",
679 "properties":{
680 "name":nameshort_schema,
681 "network_id":{"anyOf":[{"type":"null"}, id_schema ] }
682 },
683 "minProperties": 1,
684 "additionalProperties": False
685 }
686 },
687 "required": ["port"],
688 "additionalProperties": False
689 }
690
691 localinfo_schema = {
692 "title":"localinfo information schema",
693 "$schema": "http://json-schema.org/draft-04/schema#",
694 "type":"object",
695 "properties":{
696 "files":{ "type": "object"},
697 "inc_files":{ "type": "object"},
698 "server_files":{ "type": "object"}
699 },
700 "required": ["files"]
701 }
702
703 hostinfo_schema = {
704 "title":"host information schema",
705 "$schema": "http://json-schema.org/draft-04/schema#",
706 "type":"object",
707 "properties":{
708 "iface_names":{
709 "type":"object",
710 "patternProperties":{
711 ".":{ "type": "string"}
712 },
713 "minProperties": 1
714 }
715 },
716 "required": ["iface_names"]
717 }
718
719 openflow_controller_schema = {
720 "title": "network creation information schema",
721 "$schema": "http://json-schema.org/draft-04/schema#",
722 "type": "object",
723 "properties": {
724 "ofc": {
725 "type": "object",
726 "properties": {
727 "name": name_schema,
728 "dpid": nameshort_schema,
729 "ip": nameshort_schema,
730 "port": port_schema,
731 "type": nameshort_schema,
732 "version": nametiny_schema,
733 "user": nameshort_schema,
734 "password": nameshort_schema
735 },
736 "required": ["dpid", "type", "ip", "port", "name"]
737 }
738 },
739 "required": ["ofc"],
740 "additionalProperties": False
741 }
742
743 of_port_new_schema = {
744 "title": "OF port mapping",
745 "type": "object",
746 "properties": {
747 "ofc_id": id_schema,
748 "region": nameshort_schema,
749 "compute_node": nameshort_schema,
750 "pci": pci_schema,
751 "switch_dpid": nameshort_schema,
752 "switch_port": nameshort_schema,
753 "switch_mac": mac_schema
754 },
755 "required": ["region", "compute_node", "pci", "switch_dpid"]
756 }
757
758 of_port_map_new_schema = {
759 "title": "OF port mapping",
760 "$schema": "http://json-schema.org/draft-04/schema#",
761 "type": "object",
762 "properties": {
763 "of_port_mapings": {"type": "array", "items": of_port_new_schema, "minLenght":1},
764 },
765 "required": ["of_port_mapings"],
766 "additionalProperties": False
767
768 }