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 "db_ovim_host": nameshort_schema
,
90 "db_ovim_user": nameshort_schema
,
91 "db_ovim_passwd": {"type":"string"},
92 "db_ovim_name": nameshort_schema
,
93 # Next fields will disappear once the MANO API includes appropriate primitives
94 "vim_url": http_schema
,
95 "vim_url_admin": http_schema
,
96 "vim_name": nameshort_schema
,
97 "vim_tenant_name": nameshort_schema
,
98 "mano_tenant_name": nameshort_schema
,
99 "mano_tenant_id": id_schema
,
100 "http_console_proxy": {"type":"boolean"},
101 "http_console_host": nameshort_schema
,
102 "http_console_ports": {
104 "items": {"OneOf" : [
106 {"type":"object", "properties":{"from": port_schema
, "to": port_schema
}, "required": ["from","to"]}
109 "log_level": log_level_schema
,
110 "log_socket_level": log_level_schema
,
111 "log_level_db": log_level_schema
,
112 "log_level_vim": log_level_schema
,
113 "log_level_nfvo": log_level_schema
,
114 "log_level_http": log_level_schema
,
115 "log_level_console": log_level_schema
,
116 "log_level_ovim": log_level_schema
,
117 "log_file_db": path_schema
,
118 "log_file_vim": path_schema
,
119 "log_file_nfvo": path_schema
,
120 "log_file_http": path_schema
,
121 "log_file_console": path_schema
,
122 "log_file_ovim": path_schema
,
123 "log_socket_host": nameshort_schema
,
124 "log_socket_port": port_schema
,
125 "log_file": path_schema
,
127 "required": ['db_user', 'db_passwd', 'db_name'],
128 "additionalProperties": False
132 "title":"tenant information schema",
133 "$schema": "http://json-schema.org/draft-04/schema#",
139 "name": nameshort_schema
,
140 "description": description_schema
,
142 "required": ["name"],
143 "additionalProperties": True
146 "required": ["tenant"],
147 "additionalProperties": False
150 tenant_edit_schema
= {
151 "title":"tenant edit information schema",
152 "$schema": "http://json-schema.org/draft-04/schema#",
159 "description": description_schema
,
161 "additionalProperties": False
164 "required": ["tenant"],
165 "additionalProperties": False
168 datacenter_schema_properties
={
170 "description": description_schema
,
171 "type": nameshort_schema
, #currently "openvim" or "openstack", can be enlarged with plugins
172 "vim_url": description_schema
,
173 "vim_url_admin": description_schema
,
174 "config": { "type":"object" }
177 datacenter_schema
= {
178 "title":"datacenter information schema",
179 "$schema": "http://json-schema.org/draft-04/schema#",
184 "properties":datacenter_schema_properties
,
185 "required": ["name", "vim_url"],
186 "additionalProperties": True
189 "required": ["datacenter"],
190 "additionalProperties": False
194 datacenter_edit_schema
= {
195 "title":"datacenter edit nformation schema",
196 "$schema": "http://json-schema.org/draft-04/schema#",
201 "properties":datacenter_schema_properties
,
202 "additionalProperties": False
205 "required": ["datacenter"],
206 "additionalProperties": False
210 netmap_new_schema
= {
211 "title":"netmap new information schema",
212 "$schema": "http://json-schema.org/draft-04/schema#",
215 "netmap":{ #delete from datacenter
218 "name": name_schema
, #name or uuid of net to change
220 "vim_name": name_schema
223 "additionalProperties": False
226 "required": ["netmap"],
227 "additionalProperties": False
230 netmap_edit_schema
= {
231 "title":"netmap edit information schema",
232 "$schema": "http://json-schema.org/draft-04/schema#",
235 "netmap":{ #delete from datacenter
238 "name": name_schema
, #name or uuid of net to change
241 "additionalProperties": False
244 "required": ["netmap"],
245 "additionalProperties": False
248 datacenter_action_schema
= {
249 "title":"datacenter action information schema",
250 "$schema": "http://json-schema.org/draft-04/schema#",
253 "net-update":{"type":"null",},
257 "net": name_schema
, #name or uuid of net to change
259 "description": description_schema
,
260 "shared": {"type": "boolean"}
263 "additionalProperties": False
268 "net": name_schema
, #name or uuid of net to change
271 "additionalProperties": False
276 "additionalProperties": False
280 datacenter_associate_schema
={
281 "title":"datacenter associate information schema",
282 "$schema": "http://json-schema.org/draft-04/schema#",
288 "vim_tenant": name_schema
,
289 "vim_tenant_name": name_schema
,
290 "vim_username": nameshort_schema
,
291 "vim_password": nameshort_schema
,
292 "config": {"type": "object"}
294 # "required": ["vim_tenant"],
295 "additionalProperties": True
298 "required": ["datacenter"],
299 "additionalProperties": False
303 "title":"DHCP schema",
304 "$schema": "http://json-schema.org/draft-04/schema#",
307 "enabled": {"type": "boolean"},
308 "start-address": ip_schema
,
309 "count": integer1_schema
311 "required": ["enabled", "start-address", "count"],
314 ip_profile_schema
= {
315 "title":"IP profile schema",
316 "$schema": "http://json-schema.org/draft-04/schema#",
319 "ip-version": {"type": "string", "enum": ["IPv4","IPv6"]},
320 "subnet-address": ip_prefix_schema
,
321 "gateway-address": ip_schema
,
322 "dns-address": {"oneOf": [ip_schema
, # for backward compatibility
323 {"type": "array", "items": ip_schema
}]},
329 "title": "Key-pair schema for cloud-init configuration schema",
330 "$schema": "http://json-schema.org/draft-04/schema#",
334 "key": {"type":"string"}
337 "additionalProperties": False
340 cloud_config_user_schema
= {
341 "title": "User schema for cloud-init configuration schema",
342 "$schema": "http://json-schema.org/draft-04/schema#",
345 "name": nameshort_schema
,
346 "user-info": {"type":"string"},
347 #"key-pairs": {"type" : "array", "items": key_pair_schema}
348 "key-pairs": {"type" : "array", "items": {"type":"string"}}
350 "required": ["name"],
351 "additionalProperties": False
354 cloud_config_schema
= {
355 "title": "Cloud-init configuration schema",
356 "$schema": "http://json-schema.org/draft-04/schema#",
359 #"key-pairs": {"type" : "array", "items": key_pair_schema},
360 "key-pairs": {"type" : "array", "items": {"type":"string"}},
361 "users": {"type" : "array", "items": cloud_config_user_schema
}
363 "additionalProperties": False
366 internal_connection_element_schema
= {
370 "local_iface_name": name_schema
374 internal_connection_element_schema_v02
= {
378 "local_iface_name": name_schema
,
379 "ip_address": ip_schema
383 internal_connection_schema
= {
387 "description":description_schema
,
388 "type":{"type":"string", "enum":["bridge","data","ptp"]},
389 "elements": {"type" : "array", "items": internal_connection_element_schema
, "minItems":1}
391 "required": ["name", "type", "elements"],
392 "additionalProperties": False
395 internal_connection_schema_v02
= {
399 "description":description_schema
,
400 "type": {"type": "string", "enum":["e-line", "e-lan"]},
401 "implementation": {"type": "string", "enum":["overlay", "underlay"]},
402 "ip-profile": ip_profile_schema
,
403 "elements": {"type" : "array", "items": internal_connection_element_schema_v02
, "minItems":1}
405 "required": ["name", "type", "implementation", "elements"],
406 "additionalProperties": False
409 external_connection_schema
= {
413 "type":{"type":"string", "enum":["mgmt","bridge","data"]},
415 "local_iface_name": name_schema
,
416 "description":description_schema
418 "required": ["name", "type", "VNFC", "local_iface_name"],
419 "additionalProperties": False
423 external_connection_schema_v02
= {
427 "mgmt": {"type":"boolean"},
428 "type": {"type": "string", "enum":["e-line", "e-lan"]},
429 "implementation": {"type": "string", "enum":["overlay", "underlay"]},
431 "local_iface_name": name_schema
,
432 "description":description_schema
434 "required": ["name", "type", "VNFC", "local_iface_name"],
435 "additionalProperties": False
444 "dedicated":{"type":"string","enum":["yes","no","yes:sriov"]},
445 "bandwidth":bandwidth_schema
,
447 "mac_address": mac_schema
449 "additionalProperties": False,
450 "required": ["name","dedicated", "bandwidth"]
454 bridge_interfaces_schema
={
460 "bandwidth":bandwidth_schema
,
462 "mac_address": mac_schema
,
463 "model": {"type":"string", "enum":["virtio","e1000","ne2k_pci","pcnet","rtl8139"]},
464 "port-security": {"type" : "boolean"},
465 "floating-ip": {"type" : "boolean"}
467 "additionalProperties": False,
477 "type":{"type":"string", "enum":["disk","cdrom","xml"] },
478 "image": path_schema
,
479 "image name": name_schema
,
480 "image checksum": checksum_schema
,
481 "image metadata": metadata_schema
,
484 "xml":xml_text_schema
,
486 "additionalProperties": False,
495 "memory":integer1_schema
,
496 "cores":integer1_schema
,
497 "paired-threads":integer1_schema
,
498 "threads":integer1_schema
,
499 "cores-id":{"type":"array","items":integer0_schema
},
500 "paired-threads-id":{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":integer0_schema
}},
501 "threads-id":{"type":"array","items":integer0_schema
},
502 "interfaces":interfaces_schema
504 "additionalProperties": False,
505 #"required": ["memory"]
508 config_files_schema
= {
509 "title": "Config files for cloud init schema",
510 "$schema": "http://json-schema.org/draft-04/schema#",
514 "encoding": {"type": "string", "enum": ["b64", "base64", "gz", "gz+b64", "gz+base64", "gzip+b64", "gzip+base64"]}, #by default text
515 "content": {"type": "string"},
516 "permissions": {"type": "string"}, # tiypically octal notation '0644'
517 "owner": {"type": "string"}, # format: owner:group
520 "additionalProperties": False,
521 "required": ["dest", "content"],
524 boot_data_vdu_schema
= {
525 "title": "Boot data (Cloud-init) configuration schema",
526 "$schema": "http://json-schema.org/draft-04/schema#",
529 "key-pairs": {"type" : "array", "items": {"type":"string"}},
530 "users": {"type" : "array", "items": cloud_config_user_schema
},
531 "user-data": {"type" : "string"}, # scrip to run
532 "config-files": {"type": "array", "items": config_files_schema
},
533 # NOTE: “user-data” are mutually exclusive with users and config-files because user/files are injected using user-data
534 "boot-data-drive": {"type": "boolean"},
536 "additionalProperties": False,
543 "description": description_schema
,
544 "count": integer1_schema
,
545 "image name": name_schema
,
546 "availability_zone": name_schema
,
547 "VNFC image": {"oneOf": [path_schema
, http_schema
]},
548 "image checksum": checksum_schema
,
549 "image metadata": metadata_schema
,
550 #"cloud-config": cloud_config_schema, #common for all vnfs in the scenario
554 "model":description_schema
,
555 "features":{"type":"array","items":nameshort_schema
}
557 "required": ["model"],
558 "additionalProperties": False
563 "type":nameshort_schema
,
564 "version":description_schema
567 "ram":integer0_schema
,
568 "vcpus":integer0_schema
,
569 "disk": integer1_schema
,
574 "bridge-ifaces": bridge_interfaces_schema
,
575 "devices": devices_schema
,
576 "boot-data" : boot_data_vdu_schema
579 "required": ["name"],
581 {"required": ["VNFC image"]},
582 {"required": ["image name"]}
584 "additionalProperties": False
588 "title":"vnfd information schema v0.1",
589 "$schema": "http://json-schema.org/draft-04/schema#",
596 "description": description_schema
,
598 "class": nameshort_schema
,
599 "public": {"type" : "boolean"},
600 "physical": {"type" : "boolean"},
601 "default_user": name_schema
,
602 "tenant_id": id_schema
, #only valid for admin
603 "external-connections": {"type" : "array", "items": external_connection_schema
, "minItems":1},
604 "internal-connections": {"type" : "array", "items": internal_connection_schema
, "minItems":1},
605 "VNFC":{"type" : "array", "items": vnfc_schema
, "minItems":1}
607 "required": ["name","external-connections"],
608 "additionalProperties": True
612 "additionalProperties": False
615 #VNFD schema for OSM R1
617 "title":"vnfd information schema v0.2",
618 "$schema": "http://json-schema.org/draft-04/schema#",
621 "schema_version": {"type": "string", "enum": ["0.2"]},
626 "description": description_schema
,
627 "class": nameshort_schema
,
628 "public": {"type" : "boolean"},
629 "physical": {"type" : "boolean"},
630 "tenant_id": id_schema
, #only valid for admin
631 "external-connections": {"type" : "array", "items": external_connection_schema
, "minItems":1},
632 "internal-connections": {"type" : "array", "items": internal_connection_schema_v02
, "minItems":1},
633 # "cloud-config": cloud_config_schema, #common for all vnfcs
634 "VNFC":{"type" : "array", "items": vnfc_schema
, "minItems":1}
636 "required": ["name"],
637 "additionalProperties": True
640 "required": ["vnf", "schema_version"],
641 "additionalProperties": False
644 #vnfd_schema = vnfd_schema_v01
646 # "title":"vnfd information schema v0.2",
647 # "$schema": "http://json-schema.org/draft-04/schema#",
648 # "oneOf": [vnfd_schema_v01, vnfd_schema_v02]
652 "title":"graphical scenario descriptor information schema",
653 "$schema": "http://json-schema.org/draft-04/schema#",
656 "x": integer0_schema
,
657 "y": integer0_schema
,
661 "left": {"type":"array"},
662 "right": {"type":"array"},
663 "bottom": {"type":"array"},
667 "required": ["x","y"]
671 "title":"network scenario descriptor information schema v0.1",
672 "$schema": "http://json-schema.org/draft-04/schema#",
676 "description": description_schema
,
677 "tenant_id": id_schema
, #only valid for admin
678 "public": {"type": "boolean"},
684 "patternProperties":{
688 "type":{"type":"string", "enum":["VNF", "other_network", "network", "external_network"]},
690 "graph": graph_schema
,
692 "patternProperties":{
693 "^(VNF )?model$": {"type": "string"}
701 "patternProperties":{
705 "nodes":{"oneOf":[{"type":"object", "minProperties":2}, {"type":"array", "minLength":1}]},
706 "type": {"type": "string", "enum":["link", "external_network", "dataplane_net", "bridge_net"]},
707 "graph": graph_schema
709 "required": ["nodes"]
714 "required": ["nodes"],
715 "additionalProperties": False
718 "required": ["name","topology"],
719 "additionalProperties": False
723 "title":"network scenario descriptor information schema v0.2",
724 "$schema": "http://json-schema.org/draft-04/schema#",
727 "schema_version": schema_version_2
,
732 "description": description_schema
,
733 "tenant_id": id_schema
, #only valid for admin
734 "public": {"type": "boolean"},
737 "patternProperties":{
742 "graph": graph_schema
,
743 "vnf_name": name_schema
,
751 "patternProperties":{
755 "interfaces":{"type":"array", "minLength":1},
756 "type": {"type": "string", "enum":["dataplane", "bridge"]},
757 "external" : {"type": "boolean"},
758 "graph": graph_schema
760 "required": ["interfaces"]
766 "required": ["vnfs", "name"],
767 "additionalProperties": False
770 "required": ["scenario","schema_version"],
771 "additionalProperties": False
774 #NSD schema for OSM R1
776 "title":"network scenario descriptor information schema v0.3",
777 "$schema": "http://json-schema.org/draft-04/schema#",
780 "schema_version": {"type": "string", "enum": ["0.3"]},
785 "description": description_schema
,
786 "tenant_id": id_schema
, #only valid for admin
787 "public": {"type": "boolean"},
788 "cloud-config": cloud_config_schema
, #common for all vnfs in the scenario
789 #"datacenter": name_schema,
792 "patternProperties":{
797 "graph": graph_schema
,
798 "vnf_name": name_schema
,
799 #"cloud-config": cloud_config_schema, #particular for a vnf
800 #"datacenter": name_schema,
801 "internal-connections": {
803 "patternProperties": {
807 "ip-profile": ip_profile_schema
,
814 "local_iface_name": name_schema
,
815 "ip_address": ip_schema
817 "required": ["VNFC", "local_iface_name"],
831 "patternProperties":{
842 "vnf_interface": name_schema
,
843 "ip_address": ip_schema
845 "required": ["vnf", "vnf_interface"],
848 "type": {"type": "string", "enum":["e-line", "e-lan"]},
849 "implementation": {"type": "string", "enum":["overlay", "underlay"]},
850 "external" : {"type": "boolean"},
851 "graph": graph_schema
,
852 "ip-profile": ip_profile_schema
854 "required": ["interfaces"]
860 "required": ["vnfs", "networks","name"],
861 "additionalProperties": False
864 "required": ["scenario","schema_version"],
865 "additionalProperties": False
868 #scenario_new_schema = {
869 # "title":"new scenario information schema",
870 # "$schema": "http://json-schema.org/draft-04/schema#",
871 # #"oneOf": [nsd_schema_v01, nsd_schema_v02]
872 # "oneOf": [nsd_schema_v01]
875 scenario_edit_schema
= {
876 "title":"edit scenario information schema",
877 "$schema": "http://json-schema.org/draft-04/schema#",
881 "description": description_schema
,
887 "patternProperties":{
888 "^[a-fA-F0-9]{8}(-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}$": {
894 "x": integer0_schema
,
895 "y": integer0_schema
,
896 "ifaces":{ "type": "object"}
899 "description": description_schema
,
906 "required": ["nodes"],
907 "additionalProperties": False
910 "additionalProperties": False
913 scenario_action_schema
= {
914 "title":"scenario action information schema",
915 "$schema": "http://json-schema.org/draft-04/schema#",
921 "instance_name":name_schema
,
922 "description":description_schema
,
923 "datacenter": {"type": "string"}
925 "required": ["instance_name"]
930 "instance_name":name_schema
,
931 "description":description_schema
,
932 "datacenter": {"type": "string"}
934 "required": ["instance_name"]
939 "instance_name":name_schema
,
940 "description":description_schema
,
941 "datacenter": {"type": "string"}
943 "required": ["instance_name"]
948 "instance_name":name_schema
,
949 "description":description_schema
,
950 "datacenter": {"type": "string"}
952 "required": ["instance_name"]
957 "additionalProperties": False
960 instance_scenario_create_schema_v01
= {
961 "title":"instance scenario create information schema v0.1",
962 "$schema": "http://json-schema.org/draft-04/schema#",
965 "schema_version": {"type": "string", "enum": ["0.1"]},
970 "description":description_schema
,
971 "datacenter": name_schema
,
972 "scenario" : name_schema
, #can be an UUID or name
973 "action":{"enum": ["deploy","reserve","verify" ]},
974 "connect_mgmt_interfaces": {"oneOf": [{"type":"boolean"}, {"type":"object"}]},# can be true or a dict with datacenter: net_name
975 "cloud-config": cloud_config_schema
, #common to all vnfs in the instance scenario
976 "vnfs":{ #mapping from scenario to datacenter
978 "patternProperties":{
982 "name": name_schema
, #override vnf name
983 "datacenter": name_schema
,
984 #"metadata": {"type": "object"},
985 #"user_data": {"type": "string"}
986 #"cloud-config": cloud_config_schema, #particular for a vnf
987 "external-connections": {
989 "patternProperties": {
993 "vim-network-name": name_schema
,
994 "ip_address": ip_schema
999 "internal-connections": {
1001 "patternProperties": {
1005 "ip-profile": ip_profile_schema
,
1011 "VNFC": name_schema
,
1012 "local_iface_name": name_schema
,
1013 "ip_address": ip_schema
1015 "required": ["VNFC", "local_iface_name"],
1026 "networks":{ #mapping from scenario to datacenter
1028 "patternProperties":{
1038 "ip_address": ip_schema
,
1039 "datacenter": name_schema
,
1040 "vim-network-name": name_schema
1042 "patternProperties":{
1043 ".": {"type": "string"}
1047 "ip-profile": ip_profile_schema
,
1048 #if the network connects VNFs deployed at different sites, you must specify one entry per site that this network connect to
1055 # By default for an scenario 'external' network openmano looks for an existing VIM network to map this external scenario network,
1056 # for other networks openamno creates at VIM
1057 # Use netmap-create to force to create an external scenario network
1058 "netmap-create": {"oneOf":[name_schema
,{"type": "null"}]}, #datacenter network to use. Null if must be created as an internal net
1059 #netmap-use: Indicates an existing VIM network that must be used for this scenario network.
1060 #Can use both the VIM network name (if it is not ambiguous) or the VIM net UUID
1061 #If both 'netmap-create' and 'netmap-use'are supplied, netmap-use precedes, but if fails openmano follows the netmap-create
1062 #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)
1063 "netmap-use": name_schema
, #
1064 "vim-network-name": name_schema
, #override network name
1065 #"ip-profile": ip_profile_schema,
1066 "datacenter": name_schema
,
1078 "additionalProperties": False,
1079 "required": ["name"]
1082 "required": ["instance"],
1083 "additionalProperties": False
1086 instance_scenario_action_schema
= {
1087 "title":"instance scenario action information schema",
1088 "$schema": "http://json-schema.org/draft-04/schema#",
1091 "start":{"type": "null"},
1092 "pause":{"type": "null"},
1093 "resume":{"type": "null"},
1094 "shutoff":{"type": "null"},
1095 "shutdown":{"type": "null"},
1096 "forceOff":{"type": "null"},
1097 "rebuild":{"type": "null"},
1099 "type": ["object","null"],
1101 "add_public_key": description_schema
,
1102 "console": {"type": ["string", "null"], "enum": ["novnc", "xvpvnc", "rdp-html5", "spice-html5", None]},
1108 "vdu-id": id_schema
,
1109 "count": integer1_schema
,
1111 "additionalProperties": False,
1112 "required": ["vdu-id"]
1120 "vdu-id": id_schema
,
1121 "transaction-id": id_schema
,
1123 "additionalProperties": False,
1128 "vnfs":{"type": "array", "items":{"type":"string"}},
1129 "vms":{"type": "array", "items":{"type":"string"}}
1132 #"maxProperties": 1,
1133 "additionalProperties": False
1136 sdn_controller_properties
={
1137 "name": name_schema
,
1138 "dpid": {"type":"string", "pattern":"^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){7}$"},
1140 "port": port_schema
,
1141 "type": {"type": "string", "enum": ["opendaylight","floodlight","onos"]},
1142 "version": {"type" : "string", "minLength":1, "maxLength":12},
1143 "user": nameshort_schema
,
1144 "password": passwd_schema
1146 sdn_controller_schema
= {
1147 "title":"sdn controller information schema",
1148 "$schema": "http://json-schema.org/draft-04/schema#",
1153 "properties":sdn_controller_properties
,
1154 "required": ["name", "port", 'ip', 'dpid', 'type'],
1155 "additionalProperties": False
1158 "required": ["sdn_controller"],
1159 "additionalProperties": False
1162 sdn_controller_edit_schema
= {
1163 "title":"sdn controller update information schema",
1164 "$schema": "http://json-schema.org/draft-04/schema#",
1169 "properties":sdn_controller_properties
,
1170 "additionalProperties": False
1173 "required": ["sdn_controller"],
1174 "additionalProperties": False
1177 sdn_port_mapping_schema
= {
1178 "$schema": "http://json-schema.org/draft-04/schema#",
1179 "title":"sdn port mapping information schema",
1182 "sdn_port_mapping": {
1187 "compute_node": nameshort_schema
,
1194 "switch_port": nameshort_schema
,
1195 "switch_mac": mac_schema
1201 "required": ["compute_node", "ports"]
1205 "required": ["sdn_port_mapping"]
1208 sdn_external_port_schema
= {
1209 "$schema": "http://json-schema.org/draft-04/schema#",
1210 "title":"External port ingformation",
1213 "port": {"type" : "string", "minLength":1, "maxLength":60},
1214 "vlan": vlan_schema
,
1217 "required": ["port"]