1 # -*- coding: utf-8 -*-
4 # Copyright 2015 Telefónica Investigación 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 http_schema
={"type":"string", "pattern":"^https?://[^'\"=]+$"}
41 bandwidth_schema
={"type":"string", "pattern" : "^[0-9]+ *([MG]bps)?$"}
42 memory_schema
={"type":"string", "pattern" : "^[0-9]+ *([MG]i?[Bb])?$"}
43 integer0_schema
={"type":"integer","minimum":0}
44 integer1_schema
={"type":"integer","minimum":1}
45 path_schema
={"type":"string", "pattern":"^(\.){0,2}(/[^/\"':{}\(\)]+)+$"}
46 vlan_schema
={"type":"integer","minimum":1,"maximum":4095}
47 vlan1000_schema
={"type":"integer","minimum":1000,"maximum":4095}
48 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
49 #mac_schema={"type":"string", "pattern":"^([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}$"}
50 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]?)$"}
51 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])$"}
52 port_schema
={"type":"integer","minimum":1,"maximum":65534}
53 object_schema
={"type":"object"}
54 schema_version_2
={"type":"integer","minimum":2,"maximum":2}
55 #schema_version_string={"type":"string","enum": ["0.1", "2", "0.2", "3", "0.3"]}
56 log_level_schema
={"type":"string", "enum":["DEBUG", "INFO", "WARNING","ERROR","CRITICAL"]}
57 checksum_schema
={"type":"string", "pattern":"^[0-9a-fA-F]{32}$"}
58 size_schema
={"type":"integer","minimum":1,"maximum":100}
63 "architecture": {"type":"string"},
64 "use_incremental": {"type":"string","enum":["yes","no"]},
66 "os_distro": {"type":"string"},
67 "os_type": {"type":"string"},
68 "os_version": {"type":"string"},
69 "bus": {"type":"string"},
70 "topology": {"type":"string", "enum": ["oneSocket"]}
74 #Schema for the configuration file
76 "title":"configuration response information schema",
77 "$schema": "http://json-schema.org/draft-04/schema#",
80 "http_port": port_schema
,
81 "http_admin_port": port_schema
,
82 "http_host": nameshort_schema
,
83 "auto_push_VNF_to_VIMs": {"type":"boolean"},
84 "vnf_repository": path_schema
,
85 "db_host": nameshort_schema
,
86 "db_user": nameshort_schema
,
87 "db_passwd": {"type":"string"},
88 "db_name": nameshort_schema
,
89 # Next fields will disappear once the MANO API includes appropriate primitives
90 "vim_url": http_schema
,
91 "vim_url_admin": http_schema
,
92 "vim_name": nameshort_schema
,
93 "vim_tenant_name": nameshort_schema
,
94 "mano_tenant_name": nameshort_schema
,
95 "mano_tenant_id": id_schema
,
96 "http_console_proxy": {"type":"boolean"},
97 "http_console_host": nameshort_schema
,
98 "http_console_ports": {
100 "items": {"OneOf" : [
102 {"type":"object", "properties":{"from": port_schema
, "to": port_schema
}, "required": ["from","to"]}
105 "log_level": log_level_schema
,
106 "log_socket_level": log_level_schema
,
107 "log_level_db": log_level_schema
,
108 "log_level_vim": log_level_schema
,
109 "log_level_nfvo": log_level_schema
,
110 "log_level_http": log_level_schema
,
111 "log_level_console": log_level_schema
,
112 "log_file_db": path_schema
,
113 "log_file_vim": path_schema
,
114 "log_file_nfvo": path_schema
,
115 "log_file_http": path_schema
,
116 "log_file_console": path_schema
,
117 "log_socket_host": nameshort_schema
,
118 "log_socket_port": port_schema
,
119 "log_file": path_schema
,
121 "required": ['db_host', 'db_user', 'db_passwd', 'db_name'],
122 "additionalProperties": False
126 "title":"tenant information schema",
127 "$schema": "http://json-schema.org/draft-04/schema#",
133 "name": nameshort_schema
,
134 "description": description_schema
,
136 "required": ["name"],
137 "additionalProperties": True
140 "required": ["tenant"],
141 "additionalProperties": False
144 tenant_edit_schema
= {
145 "title":"tenant edit information schema",
146 "$schema": "http://json-schema.org/draft-04/schema#",
153 "description": description_schema
,
155 "additionalProperties": False
158 "required": ["tenant"],
159 "additionalProperties": False
162 datacenter_schema_properties
={
164 "description": description_schema
,
165 "type": nameshort_schema
, #currently "openvim" or "openstack", can be enlarged with plugins
166 "vim_url": description_schema
,
167 "vim_url_admin": description_schema
,
168 "config": { "type":"object" }
171 datacenter_schema
= {
172 "title":"datacenter information schema",
173 "$schema": "http://json-schema.org/draft-04/schema#",
178 "properties":datacenter_schema_properties
,
179 "required": ["name", "vim_url"],
180 "additionalProperties": True
183 "required": ["datacenter"],
184 "additionalProperties": False
188 datacenter_edit_schema
= {
189 "title":"datacenter edit nformation schema",
190 "$schema": "http://json-schema.org/draft-04/schema#",
195 "properties":datacenter_schema_properties
,
196 "additionalProperties": False
199 "required": ["datacenter"],
200 "additionalProperties": False
204 netmap_new_schema
= {
205 "title":"netmap new information schema",
206 "$schema": "http://json-schema.org/draft-04/schema#",
209 "netmap":{ #delete from datacenter
212 "name": name_schema
, #name or uuid of net to change
214 "vim_name": name_schema
217 "additionalProperties": False
220 "required": ["netmap"],
221 "additionalProperties": False
224 netmap_edit_schema
= {
225 "title":"netmap edit information schema",
226 "$schema": "http://json-schema.org/draft-04/schema#",
229 "netmap":{ #delete from datacenter
232 "name": name_schema
, #name or uuid of net to change
235 "additionalProperties": False
238 "required": ["netmap"],
239 "additionalProperties": False
242 datacenter_action_schema
= {
243 "title":"datacenter action information schema",
244 "$schema": "http://json-schema.org/draft-04/schema#",
247 "net-update":{"type":"null",},
251 "net": name_schema
, #name or uuid of net to change
253 "description": description_schema
,
254 "shared": {"type": "boolean"}
257 "additionalProperties": False
262 "net": name_schema
, #name or uuid of net to change
265 "additionalProperties": False
270 "additionalProperties": False
274 datacenter_associate_schema
={
275 "title":"datacenter associate information schema",
276 "$schema": "http://json-schema.org/draft-04/schema#",
282 "vim_tenant": name_schema
,
283 "vim_tenant_name": name_schema
,
284 "vim_username": nameshort_schema
,
285 "vim_password": nameshort_schema
,
286 "config": {"type": "object"}
288 # "required": ["vim_tenant"],
289 "additionalProperties": True
292 "required": ["datacenter"],
293 "additionalProperties": False
297 "title":"DHCP schema",
298 "$schema": "http://json-schema.org/draft-04/schema#",
301 "enabled": {"type": "boolean"},
302 "start-address": ip_schema
,
303 "count": integer1_schema
305 "required": ["enabled", "start-address", "count"],
308 ip_profile_schema
= {
309 "title":"IP profile schema",
310 "$schema": "http://json-schema.org/draft-04/schema#",
313 "ip-version": {"type":"string", "enum":["IPv4","IPv6"]},
314 "subnet-address": ip_prefix_schema
,
315 "gateway-address": ip_schema
,
316 "dns-address": ip_schema
,
322 "title": "Key-pair schema for cloud-init configuration schema",
323 "$schema": "http://json-schema.org/draft-04/schema#",
327 "key": {"type":"string"}
330 "additionalProperties": False
333 cloud_config_user_schema
= {
334 "title": "User schema for cloud-init configuration schema",
335 "$schema": "http://json-schema.org/draft-04/schema#",
338 "name": nameshort_schema
,
339 "user-info": {"type":"string"},
340 #"key-pairs": {"type" : "array", "items": key_pair_schema}
341 "key-pairs": {"type" : "array", "items": {"type":"string"}}
343 "required": ["name"],
344 "additionalProperties": False
347 cloud_config_schema
= {
348 "title": "Cloud-init configuration schema",
349 "$schema": "http://json-schema.org/draft-04/schema#",
352 #"key-pairs": {"type" : "array", "items": key_pair_schema},
353 "key-pairs": {"type" : "array", "items": {"type":"string"}},
354 "users": {"type" : "array", "items": cloud_config_user_schema
}
356 "additionalProperties": False
359 internal_connection_element_schema
= {
363 "local_iface_name": name_schema
367 internal_connection_element_schema_v02
= {
371 "local_iface_name": name_schema
,
372 "ip_address": ip_schema
376 internal_connection_schema
= {
380 "description":description_schema
,
381 "type":{"type":"string", "enum":["bridge","data","ptp"]},
382 "elements": {"type" : "array", "items": internal_connection_element_schema
, "minItems":2}
384 "required": ["name", "type", "elements"],
385 "additionalProperties": False
388 internal_connection_schema_v02
= {
392 "description":description_schema
,
393 "type": {"type": "string", "enum":["e-line", "e-lan"]},
394 "implementation": {"type": "string", "enum":["overlay", "underlay"]},
395 "ip-profile": ip_profile_schema
,
396 "elements": {"type" : "array", "items": internal_connection_element_schema_v02
, "minItems":2}
398 "required": ["name", "type", "implementation", "elements"],
399 "additionalProperties": False
402 external_connection_schema
= {
406 "type":{"type":"string", "enum":["mgmt","bridge","data"]},
408 "local_iface_name": name_schema
,
409 "description":description_schema
411 "required": ["name", "type", "VNFC", "local_iface_name"],
412 "additionalProperties": False
416 external_connection_schema_v02
= {
420 "mgmt": {"type":"boolean"},
421 "type": {"type": "string", "enum":["e-line", "e-lan"]},
422 "implementation": {"type": "string", "enum":["overlay", "underlay"]},
424 "local_iface_name": name_schema
,
425 "description":description_schema
427 "required": ["name", "type", "VNFC", "local_iface_name"],
428 "additionalProperties": False
437 "dedicated":{"type":"string","enum":["yes","no","yes:sriov"]},
438 "bandwidth":bandwidth_schema
,
440 "mac_address": mac_schema
442 "additionalProperties": False,
443 "required": ["name","dedicated", "bandwidth"]
447 bridge_interfaces_schema
={
453 "bandwidth":bandwidth_schema
,
455 "mac_address": mac_schema
,
456 "model": {"type":"string", "enum":["virtio","e1000","ne2k_pci","pcnet","rtl8139"]},
457 "port-security": {"type" : "boolean"},
458 "floating-ip": {"type" : "boolean"}
460 "additionalProperties": False,
470 "type":{"type":"string", "enum":["disk","cdrom","xml"] },
471 "image": path_schema
,
472 "image name": name_schema
,
473 "image checksum": checksum_schema
,
474 "image metadata": metadata_schema
,
477 "xml":xml_text_schema
,
479 "additionalProperties": False,
488 "memory":integer1_schema
,
489 "cores":integer1_schema
,
490 "paired-threads":integer1_schema
,
491 "threads":integer1_schema
,
492 "cores-id":{"type":"array","items":integer0_schema
},
493 "paired-threads-id":{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":integer0_schema
}},
494 "threads-id":{"type":"array","items":integer0_schema
},
495 "interfaces":interfaces_schema
497 "additionalProperties": False,
498 #"required": ["memory"]
501 config_files_schema
= {
502 "title": "Config files for cloud init schema",
503 "$schema": "http://json-schema.org/draft-04/schema#",
507 "encoding": {"type": "string", "enum": ["b64", "base64", "gz", "gz+b64", "gz+base64", "gzip+b64", "gzip+base64"]}, #by default text
508 "content": {"type": "string"},
509 "permissions": {"type": "string"}, # tiypically octal notation '0644'
510 "owner": {"type": "string"}, # format: owner:group
513 "additionalProperties": False,
514 "required": ["dest", "content"],
517 boot_data_vdu_schema
= {
518 "title": "Boot data (Cloud-init) configuration schema",
519 "$schema": "http://json-schema.org/draft-04/schema#",
522 "key-pairs": {"type" : "array", "items": {"type":"string"}},
523 "users": {"type" : "array", "items": cloud_config_user_schema
},
524 "user-data": {"type" : "string"}, # scrip to run
525 "config-files": {"type": "array", "items": config_files_schema
},
526 # NOTE: “user-data” are mutually exclusive with users and config-files because user/files are injected using user-data
527 "boot-data-drive": {"type": "boolean"},
529 "additionalProperties": False,
536 "description": description_schema
,
537 "VNFC image": {"oneOf": [path_schema
, http_schema
]},
538 "image name": name_schema
,
539 "image checksum": checksum_schema
,
540 "image metadata": metadata_schema
,
541 #"cloud-config": cloud_config_schema, #common for all vnfs in the scenario
545 "model":description_schema
,
546 "features":{"type":"array","items":nameshort_schema
}
548 "required": ["model"],
549 "additionalProperties": False
554 "type":nameshort_schema
,
555 "version":description_schema
558 "ram":integer0_schema
,
559 "vcpus":integer0_schema
,
560 "disk": integer1_schema
,
565 "bridge-ifaces": bridge_interfaces_schema
,
566 "devices": devices_schema
,
567 "boot-data" : boot_data_vdu_schema
570 "required": ["name"],
572 {"required": ["VNFC image"]},
573 {"required": ["image name"]}
575 "additionalProperties": False
579 "title":"vnfd information schema v0.1",
580 "$schema": "http://json-schema.org/draft-04/schema#",
587 "description": description_schema
,
588 "class": nameshort_schema
,
589 "public": {"type" : "boolean"},
590 "physical": {"type" : "boolean"},
591 "tenant_id": id_schema
, #only valid for admin
592 "external-connections": {"type" : "array", "items": external_connection_schema
, "minItems":1},
593 "internal-connections": {"type" : "array", "items": internal_connection_schema
, "minItems":1},
594 "VNFC":{"type" : "array", "items": vnfc_schema
, "minItems":1}
596 "required": ["name","external-connections"],
597 "additionalProperties": True
601 "additionalProperties": False
604 #VNFD schema for OSM R1
606 "title":"vnfd information schema v0.2",
607 "$schema": "http://json-schema.org/draft-04/schema#",
610 "schema_version": {"type": "string", "enum": ["0.2"]},
615 "description": description_schema
,
616 "class": nameshort_schema
,
617 "public": {"type" : "boolean"},
618 "physical": {"type" : "boolean"},
619 "tenant_id": id_schema
, #only valid for admin
620 "external-connections": {"type" : "array", "items": external_connection_schema
, "minItems":1},
621 "internal-connections": {"type" : "array", "items": internal_connection_schema_v02
, "minItems":1},
622 # "cloud-config": cloud_config_schema, #common for all vnfcs
623 "VNFC":{"type" : "array", "items": vnfc_schema
, "minItems":1}
625 "required": ["name"],
626 "additionalProperties": True
629 "required": ["vnf", "schema_version"],
630 "additionalProperties": False
633 #vnfd_schema = vnfd_schema_v01
635 # "title":"vnfd information schema v0.2",
636 # "$schema": "http://json-schema.org/draft-04/schema#",
637 # "oneOf": [vnfd_schema_v01, vnfd_schema_v02]
641 "title":"graphical scenario descriptor information schema",
642 "$schema": "http://json-schema.org/draft-04/schema#",
645 "x": integer0_schema
,
646 "y": integer0_schema
,
650 "left": {"type":"array"},
651 "right": {"type":"array"},
652 "bottom": {"type":"array"},
656 "required": ["x","y"]
660 "title":"network scenario descriptor information schema v0.1",
661 "$schema": "http://json-schema.org/draft-04/schema#",
665 "description": description_schema
,
666 "tenant_id": id_schema
, #only valid for admin
667 "public": {"type": "boolean"},
673 "patternProperties":{
677 "type":{"type":"string", "enum":["VNF", "other_network", "network", "external_network"]},
679 "graph": graph_schema
,
681 "patternProperties":{
682 "^(VNF )?model$": {"type": "string"}
690 "patternProperties":{
694 "nodes":{"oneOf":[{"type":"object", "minProperties":2}, {"type":"array", "minLength":1}]},
695 "type": {"type": "string", "enum":["link", "external_network", "dataplane_net", "bridge_net"]},
696 "graph": graph_schema
698 "required": ["nodes"]
703 "required": ["nodes"],
704 "additionalProperties": False
707 "required": ["name","topology"],
708 "additionalProperties": False
712 "title":"network scenario descriptor information schema v0.2",
713 "$schema": "http://json-schema.org/draft-04/schema#",
716 "schema_version": schema_version_2
,
721 "description": description_schema
,
722 "tenant_id": id_schema
, #only valid for admin
723 "public": {"type": "boolean"},
726 "patternProperties":{
731 "graph": graph_schema
,
732 "vnf_name": name_schema
,
740 "patternProperties":{
744 "interfaces":{"type":"array", "minLength":1},
745 "type": {"type": "string", "enum":["dataplane", "bridge"]},
746 "external" : {"type": "boolean"},
747 "graph": graph_schema
749 "required": ["interfaces"]
755 "required": ["vnfs", "name"],
756 "additionalProperties": False
759 "required": ["scenario","schema_version"],
760 "additionalProperties": False
763 #NSD schema for OSM R1
765 "title":"network scenario descriptor information schema v0.3",
766 "$schema": "http://json-schema.org/draft-04/schema#",
769 "schema_version": {"type": "string", "enum": ["0.3"]},
774 "description": description_schema
,
775 "tenant_id": id_schema
, #only valid for admin
776 "public": {"type": "boolean"},
777 "cloud-config": cloud_config_schema
, #common for all vnfs in the scenario
778 #"datacenter": name_schema,
781 "patternProperties":{
786 "graph": graph_schema
,
787 "vnf_name": name_schema
,
788 #"cloud-config": cloud_config_schema, #particular for a vnf
789 #"datacenter": name_schema,
790 "internal-connections": {
792 "patternProperties": {
796 "ip-profile": ip_profile_schema
,
803 "local_iface_name": name_schema
,
804 "ip_address": ip_schema
806 "required": ["VNFC", "local_iface_name"],
820 "patternProperties":{
831 "vnf_interface": name_schema
,
832 "ip_address": ip_schema
834 "required": ["vnf", "vnf_interface"],
837 "type": {"type": "string", "enum":["e-line", "e-lan"]},
838 "implementation": {"type": "string", "enum":["overlay", "underlay"]},
839 "external" : {"type": "boolean"},
840 "graph": graph_schema
,
841 "ip-profile": ip_profile_schema
843 "required": ["interfaces"]
849 "required": ["vnfs", "networks","name"],
850 "additionalProperties": False
853 "required": ["scenario","schema_version"],
854 "additionalProperties": False
857 #scenario_new_schema = {
858 # "title":"new scenario information schema",
859 # "$schema": "http://json-schema.org/draft-04/schema#",
860 # #"oneOf": [nsd_schema_v01, nsd_schema_v02]
861 # "oneOf": [nsd_schema_v01]
864 scenario_edit_schema
= {
865 "title":"edit scenario information schema",
866 "$schema": "http://json-schema.org/draft-04/schema#",
870 "description": description_schema
,
876 "patternProperties":{
877 "^[a-fA-F0-9]{8}(-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}$": {
883 "x": integer0_schema
,
884 "y": integer0_schema
,
885 "ifaces":{ "type": "object"}
888 "description": description_schema
,
895 "required": ["nodes"],
896 "additionalProperties": False
899 "additionalProperties": False
902 scenario_action_schema
= {
903 "title":"scenario action information schema",
904 "$schema": "http://json-schema.org/draft-04/schema#",
910 "instance_name":name_schema
,
911 "description":description_schema
,
912 "datacenter": {"type": "string"}
914 "required": ["instance_name"]
919 "instance_name":name_schema
,
920 "description":description_schema
,
921 "datacenter": {"type": "string"}
923 "required": ["instance_name"]
928 "instance_name":name_schema
,
929 "description":description_schema
,
930 "datacenter": {"type": "string"}
932 "required": ["instance_name"]
937 "instance_name":name_schema
,
938 "description":description_schema
,
939 "datacenter": {"type": "string"}
941 "required": ["instance_name"]
946 "additionalProperties": False
949 instance_scenario_create_schema_v01
= {
950 "title":"instance scenario create information schema v0.1",
951 "$schema": "http://json-schema.org/draft-04/schema#",
954 "schema_version": {"type": "string", "enum": ["0.1"]},
959 "description":description_schema
,
960 "datacenter": name_schema
,
961 "scenario" : name_schema
, #can be an UUID or name
962 "action":{"enum": ["deploy","reserve","verify" ]},
963 "connect_mgmt_interfaces": {"oneOf": [{"type":"boolean"}, {"type":"object"}]},# can be true or a dict with datacenter: net_name
964 "cloud-config": cloud_config_schema
, #common to all vnfs in the instance scenario
965 "vnfs":{ #mapping from scenario to datacenter
967 "patternProperties":{
971 "name": name_schema
, #override vnf name
972 "datacenter": name_schema
,
973 #"metadata": {"type": "object"},
974 #"user_data": {"type": "string"}
975 #"cloud-config": cloud_config_schema, #particular for a vnf
976 "external-connections": {
978 "patternProperties": {
982 "vim-network-name": name_schema
,
983 "ip_address": ip_schema
988 "internal-connections": {
990 "patternProperties": {
994 "ip-profile": ip_profile_schema
,
1000 "VNFC": name_schema
,
1001 "local_iface_name": name_schema
,
1002 "ip_address": ip_schema
1004 "required": ["VNFC", "local_iface_name"],
1015 "networks":{ #mapping from scenario to datacenter
1017 "patternProperties":{
1027 "ip_address": ip_schema
,
1028 "datacenter": name_schema
,
1029 "vim-network-name": name_schema
1031 "patternProperties":{
1032 ".": {"type": "string"}
1036 "ip-profile": ip_profile_schema
,
1037 #if the network connects VNFs deployed at different sites, you must specify one entry per site that this network connect to
1044 # By default for an scenario 'external' network openmano looks for an existing VIM network to map this external scenario network,
1045 # for other networks openamno creates at VIM
1046 # Use netmap-create to force to create an external scenario network
1047 "netmap-create": {"oneOf":[name_schema
,{"type": "null"}]}, #datacenter network to use. Null if must be created as an internal net
1048 #netmap-use: Indicates an existing VIM network that must be used for this scenario network.
1049 #Can use both the VIM network name (if it is not ambiguous) or the VIM net UUID
1050 #If both 'netmap-create' and 'netmap-use'are supplied, netmap-use precedes, but if fails openmano follows the netmap-create
1051 #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)
1052 "netmap-use": name_schema
, #
1053 "vim-network-name": name_schema
, #override network name
1054 #"ip-profile": ip_profile_schema,
1055 "datacenter": name_schema
,
1067 "additionalProperties": False,
1068 "required": ["name"]
1071 "required": ["instance"],
1072 "additionalProperties": False
1075 instance_scenario_action_schema
= {
1076 "title":"instance scenario action information schema",
1077 "$schema": "http://json-schema.org/draft-04/schema#",
1080 "start":{"type": "null"},
1081 "pause":{"type": "null"},
1082 "resume":{"type": "null"},
1083 "shutoff":{"type": "null"},
1084 "shutdown":{"type": "null"},
1085 "forceOff":{"type": "null"},
1086 "rebuild":{"type": "null"},
1088 "type": ["object","null"],
1090 "console": {"type": ["string", "null"], "enum": ["novnc", "xvpvnc", "rdp-html5", "spice-html5", None]},
1091 "vnfs":{"type": "array", "items":{"type":"string"}},
1092 "vms":{"type": "array", "items":{"type":"string"}}
1095 #"maxProperties": 1,
1096 "additionalProperties": False
1099 sdn_controller_properties
={
1100 "name": name_schema
,
1101 "dpid": {"type":"string", "pattern":"^[0-9a-fA-F][02468aceACE](:[0-9a-fA-F]{2}){7}$"},
1103 "port": port_schema
,
1104 "type": {"type": "string", "enum": ["opendaylight","floodlight","onos"]},
1105 "version": {"type" : "string", "minLength":1, "maxLength":12},
1106 "user": nameshort_schema
,
1107 "password": passwd_schema
1109 sdn_controller_schema
= {
1110 "title":"sdn controller information schema",
1111 "$schema": "http://json-schema.org/draft-04/schema#",
1116 "properties":sdn_controller_properties
,
1117 "required": ["name", "port", 'ip', 'dpid', 'type'],
1118 "additionalProperties": False
1121 "required": ["sdn_controller"],
1122 "additionalProperties": False
1125 sdn_controller_edit_schema
= {
1126 "title":"sdn controller update information schema",
1127 "$schema": "http://json-schema.org/draft-04/schema#",
1132 "properties":sdn_controller_properties
,
1133 "additionalProperties": False
1136 "required": ["sdn_controller"],
1137 "additionalProperties": False
1140 sdn_port_mapping_schema
= {
1141 "$schema": "http://json-schema.org/draft-04/schema#",
1142 "title":"sdn port mapping information schema",
1145 "sdn_port_mapping": {
1150 "compute_node": nameshort_schema
,
1157 "switch_port": nameshort_schema
,
1158 "switch_mac": mac_schema
1164 "required": ["compute_node", "ports"]
1168 "required": ["sdn_port_mapping"]