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_wim": log_level_schema
,
117 "log_level_nfvo": log_level_schema
,
118 "log_level_http": log_level_schema
,
119 "log_level_console": log_level_schema
,
120 "log_level_ovim": log_level_schema
,
121 "log_file_db": path_schema
,
122 "log_file_vim": path_schema
,
123 "log_file_wim": path_schema
,
124 "log_file_nfvo": path_schema
,
125 "log_file_http": path_schema
,
126 "log_file_console": path_schema
,
127 "log_file_ovim": path_schema
,
128 "log_socket_host": nameshort_schema
,
129 "log_socket_port": port_schema
,
130 "log_file": path_schema
,
132 "required": ['db_user', 'db_passwd', 'db_name'],
133 "additionalProperties": False
137 "title":"tenant information schema",
138 "$schema": "http://json-schema.org/draft-04/schema#",
144 "name": nameshort_schema
,
145 "description": description_schema
,
147 "required": ["name"],
148 "additionalProperties": True
151 "required": ["tenant"],
152 "additionalProperties": False
155 tenant_edit_schema
= {
156 "title":"tenant edit information schema",
157 "$schema": "http://json-schema.org/draft-04/schema#",
164 "description": description_schema
,
166 "additionalProperties": False
169 "required": ["tenant"],
170 "additionalProperties": False
173 datacenter_schema_properties
={
175 "description": description_schema
,
176 "type": nameshort_schema
, #currently "openvim" or "openstack", can be enlarged with plugins
177 "vim_url": description_schema
,
178 "vim_url_admin": description_schema
,
179 "config": { "type":"object" }
182 datacenter_schema
= {
183 "title":"datacenter information schema",
184 "$schema": "http://json-schema.org/draft-04/schema#",
189 "properties":datacenter_schema_properties
,
190 "required": ["name", "vim_url"],
191 "additionalProperties": True
194 "required": ["datacenter"],
195 "additionalProperties": False
199 datacenter_edit_schema
= {
200 "title":"datacenter edit nformation schema",
201 "$schema": "http://json-schema.org/draft-04/schema#",
206 "properties":datacenter_schema_properties
,
207 "additionalProperties": False
210 "required": ["datacenter"],
211 "additionalProperties": False
215 netmap_new_schema
= {
216 "title":"netmap new information schema",
217 "$schema": "http://json-schema.org/draft-04/schema#",
220 "netmap":{ #delete from datacenter
223 "name": name_schema
, #name or uuid of net to change
225 "vim_name": name_schema
228 "additionalProperties": False
231 "required": ["netmap"],
232 "additionalProperties": False
235 netmap_edit_schema
= {
236 "title":"netmap edit information schema",
237 "$schema": "http://json-schema.org/draft-04/schema#",
240 "netmap":{ #delete from datacenter
243 "name": name_schema
, #name or uuid of net to change
246 "additionalProperties": False
249 "required": ["netmap"],
250 "additionalProperties": False
253 datacenter_action_schema
= {
254 "title":"datacenter action information schema",
255 "$schema": "http://json-schema.org/draft-04/schema#",
258 "net-update":{"type":"null",},
262 "net": name_schema
, #name or uuid of net to change
264 "description": description_schema
,
265 "shared": {"type": "boolean"}
268 "additionalProperties": False
273 "net": name_schema
, #name or uuid of net to change
276 "additionalProperties": False
281 "additionalProperties": False
285 datacenter_associate_schema
={
286 "title":"datacenter associate information schema",
287 "$schema": "http://json-schema.org/draft-04/schema#",
295 "vim_tenant": name_schema
,
296 "vim_tenant_name": name_schema
,
297 "vim_username": nameshort_schema
,
298 "vim_password": nameshort_schema
,
299 "config": {"type": "object"}
301 # "required": ["vim_tenant"],
302 "additionalProperties": True
305 "required": ["datacenter"],
306 "additionalProperties": False
310 "title": "DHCP schema",
311 "$schema": "http://json-schema.org/draft-04/schema#",
314 "enabled": {"type": "boolean"},
315 "start-address": {"OneOf": [{"type": "null"}, ip_schema
]},
316 "count": integer0_schema
318 # "required": ["start-address", "count"],
321 ip_profile_schema
= {
322 "title": "IP profile schema",
323 "$schema": "http://json-schema.org/draft-04/schema#",
326 "ip-version": {"type": "string", "enum": ["IPv4", "IPv6"]},
327 "subnet-address": ip_prefix_schema
,
328 "gateway-address": ip_schema
,
329 "dns-address": {"oneOf": [ip_schema
, # for backward compatibility
330 {"type": "array", "items": ip_schema
}]},
336 "title": "Key-pair schema for cloud-init configuration schema",
337 "$schema": "http://json-schema.org/draft-04/schema#",
341 "key": {"type":"string"}
344 "additionalProperties": False
347 cloud_config_user_schema
= {
348 "title": "User schema for cloud-init configuration schema",
349 "$schema": "http://json-schema.org/draft-04/schema#",
352 "name": nameshort_schema
,
353 "user-info": {"type":"string"},
354 #"key-pairs": {"type" : "array", "items": key_pair_schema}
355 "key-pairs": {"type" : "array", "items": {"type":"string"}}
357 "required": ["name"],
358 "additionalProperties": False
361 cloud_config_schema
= {
362 "title": "Cloud-init configuration schema",
363 "$schema": "http://json-schema.org/draft-04/schema#",
366 #"key-pairs": {"type" : "array", "items": key_pair_schema},
367 "key-pairs": {"type" : "array", "items": {"type":"string"}},
368 "users": {"type" : "array", "items": cloud_config_user_schema
}
370 "additionalProperties": False
373 internal_connection_element_schema
= {
377 "local_iface_name": name_schema
381 internal_connection_element_schema_v02
= {
385 "local_iface_name": name_schema
,
386 "ip_address": ip_schema
390 internal_connection_schema
= {
394 "description":description_schema
,
395 "type":{"type":"string", "enum":["bridge","data","ptp"]},
396 "elements": {"type" : "array", "items": internal_connection_element_schema
, "minItems":1}
398 "required": ["name", "type", "elements"],
399 "additionalProperties": False
402 internal_connection_schema_v02
= {
406 "description":description_schema
,
407 "type": {"type": "string", "enum":["e-line", "e-lan"]},
408 "implementation": {"type": "string", "enum":["overlay", "underlay"]},
409 "ip-profile": ip_profile_schema
,
410 "elements": {"type" : "array", "items": internal_connection_element_schema_v02
, "minItems":1}
412 "required": ["name", "type", "implementation", "elements"],
413 "additionalProperties": False
416 external_connection_schema
= {
420 "type":{"type":"string", "enum":["mgmt","bridge","data"]},
422 "local_iface_name": name_schema
,
423 "description":description_schema
425 "required": ["name", "type", "VNFC", "local_iface_name"],
426 "additionalProperties": False
430 external_connection_schema_v02
= {
434 "mgmt": {"type":"boolean"},
435 "type": {"type": "string", "enum":["e-line", "e-lan"]},
436 "implementation": {"type": "string", "enum":["overlay", "underlay"]},
438 "local_iface_name": name_schema
,
439 "description":description_schema
441 "required": ["name", "type", "VNFC", "local_iface_name"],
442 "additionalProperties": False
451 "dedicated":{"type":"string","enum":["yes","no","yes:sriov"]},
452 "bandwidth":bandwidth_schema
,
454 "mac_address": mac_schema
456 "additionalProperties": False,
457 "required": ["name","dedicated", "bandwidth"]
461 bridge_interfaces_schema
={
467 "bandwidth":bandwidth_schema
,
469 "mac_address": mac_schema
,
470 "model": {"type":"string", "enum":["virtio","e1000","ne2k_pci","pcnet","rtl8139", "paravirt"]},
471 "port-security": {"type" : "boolean"},
472 "floating-ip": {"type" : "boolean"}
474 "additionalProperties": False,
484 "type":{"type":"string", "enum":["disk","cdrom","xml"] },
485 "image": path_schema
,
486 "image name": name_schema
,
487 "image checksum": checksum_schema
,
488 "image metadata": metadata_schema
,
491 "xml":xml_text_schema
,
494 "additionalProperties": False,
503 "memory":integer1_schema
,
504 "cores":integer1_schema
,
505 "paired-threads":integer1_schema
,
506 "threads":integer1_schema
,
507 "cores-id":{"type":"array","items":integer0_schema
},
508 "paired-threads-id":{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":integer0_schema
}},
509 "threads-id":{"type":"array","items":integer0_schema
},
510 "interfaces":interfaces_schema
512 "additionalProperties": False,
513 #"required": ["memory"]
516 config_files_schema
= {
517 "title": "Config files for cloud init schema",
518 "$schema": "http://json-schema.org/draft-04/schema#",
522 "encoding": {"type": "string", "enum": ["b64", "base64", "gz", "gz+b64", "gz+base64", "gzip+b64", "gzip+base64"]}, #by default text
523 "content": {"type": "string"},
524 "permissions": {"type": "string"}, # tiypically octal notation '0644'
525 "owner": {"type": "string"}, # format: owner:group
528 "additionalProperties": False,
529 "required": ["dest", "content"],
532 boot_data_vdu_schema
= {
533 "title": "Boot data (Cloud-init) configuration schema",
534 "$schema": "http://json-schema.org/draft-04/schema#",
537 "key-pairs": {"type" : "array", "items": {"type":"string"}},
538 "users": {"type" : "array", "items": cloud_config_user_schema
},
539 "user-data": {"type" : "string"}, # scrip to run
540 "config-files": {"type": "array", "items": config_files_schema
},
541 # NOTE: “user-data” are mutually exclusive with users and config-files because user/files are injected using user-data
542 "boot-data-drive": {"type": "boolean"},
544 "additionalProperties": False,
551 "description": description_schema
,
552 "count": integer1_schema
,
553 "image name": name_schema
,
554 "availability_zone": name_schema
,
555 "VNFC image": {"oneOf": [path_schema
, http_schema
]},
556 "image checksum": checksum_schema
,
557 "image metadata": metadata_schema
,
558 #"cloud-config": cloud_config_schema, #common for all vnfs in the scenario
562 "model":description_schema
,
563 "features":{"type":"array","items":nameshort_schema
}
565 "required": ["model"],
566 "additionalProperties": False
571 "type":nameshort_schema
,
572 "version":description_schema
575 "ram":integer0_schema
,
576 "vcpus":integer0_schema
,
577 "disk": integer1_schema
,
582 "bridge-ifaces": bridge_interfaces_schema
,
583 "devices": devices_schema
,
584 "boot-data" : boot_data_vdu_schema
587 "required": ["name"],
589 {"required": ["VNFC image"]},
590 {"required": ["image name"]}
592 "additionalProperties": False
596 "title":"vnfd information schema v0.1",
597 "$schema": "http://json-schema.org/draft-04/schema#",
604 "description": description_schema
,
606 "class": nameshort_schema
,
607 "public": {"type" : "boolean"},
608 "physical": {"type" : "boolean"},
609 "default_user": name_schema
,
610 "tenant_id": id_schema
, #only valid for admin
611 "external-connections": {"type" : "array", "items": external_connection_schema
, "minItems":1},
612 "internal-connections": {"type" : "array", "items": internal_connection_schema
, "minItems":1},
613 "VNFC":{"type" : "array", "items": vnfc_schema
, "minItems":1}
615 "required": ["name","external-connections"],
616 "additionalProperties": True
620 "additionalProperties": False
623 #VNFD schema for OSM R1
625 "title":"vnfd information schema v0.2",
626 "$schema": "http://json-schema.org/draft-04/schema#",
629 "schema_version": {"type": "string", "enum": ["0.2"]},
634 "description": description_schema
,
635 "class": nameshort_schema
,
636 "public": {"type" : "boolean"},
637 "physical": {"type" : "boolean"},
638 "tenant_id": id_schema
, #only valid for admin
639 "external-connections": {"type" : "array", "items": external_connection_schema
, "minItems":1},
640 "internal-connections": {"type" : "array", "items": internal_connection_schema_v02
, "minItems":1},
641 # "cloud-config": cloud_config_schema, #common for all vnfcs
642 "VNFC":{"type" : "array", "items": vnfc_schema
, "minItems":1}
644 "required": ["name"],
645 "additionalProperties": True
648 "required": ["vnf", "schema_version"],
649 "additionalProperties": False
652 #vnfd_schema = vnfd_schema_v01
654 # "title":"vnfd information schema v0.2",
655 # "$schema": "http://json-schema.org/draft-04/schema#",
656 # "oneOf": [vnfd_schema_v01, vnfd_schema_v02]
660 "title":"graphical scenario descriptor information schema",
661 "$schema": "http://json-schema.org/draft-04/schema#",
664 "x": integer0_schema
,
665 "y": integer0_schema
,
669 "left": {"type":"array"},
670 "right": {"type":"array"},
671 "bottom": {"type":"array"},
675 "required": ["x","y"]
679 "title":"network scenario descriptor information schema v0.1",
680 "$schema": "http://json-schema.org/draft-04/schema#",
684 "description": description_schema
,
685 "tenant_id": id_schema
, #only valid for admin
686 "public": {"type": "boolean"},
692 "patternProperties":{
696 "type":{"type":"string", "enum":["VNF", "other_network", "network", "external_network"]},
698 "graph": graph_schema
,
700 "patternProperties":{
701 "^(VNF )?model$": {"type": "string"}
709 "patternProperties":{
713 "nodes":{"oneOf":[{"type":"object", "minProperties":2}, {"type":"array", "minLength":1}]},
714 "type": {"type": "string", "enum":["link", "external_network", "dataplane_net", "bridge_net"]},
715 "graph": graph_schema
717 "required": ["nodes"]
722 "required": ["nodes"],
723 "additionalProperties": False
726 "required": ["name","topology"],
727 "additionalProperties": False
731 "title":"network scenario descriptor information schema v0.2",
732 "$schema": "http://json-schema.org/draft-04/schema#",
735 "schema_version": schema_version_2
,
740 "description": description_schema
,
741 "tenant_id": id_schema
, #only valid for admin
742 "public": {"type": "boolean"},
745 "patternProperties":{
750 "graph": graph_schema
,
751 "vnf_name": name_schema
,
759 "patternProperties":{
763 "interfaces":{"type":"array", "minLength":1},
764 "type": {"type": "string", "enum":["dataplane", "bridge"]},
765 "external" : {"type": "boolean"},
766 "graph": graph_schema
768 "required": ["interfaces"]
774 "required": ["vnfs", "name"],
775 "additionalProperties": False
778 "required": ["scenario","schema_version"],
779 "additionalProperties": False
782 #NSD schema for OSM R1
784 "title":"network scenario descriptor information schema v0.3",
785 "$schema": "http://json-schema.org/draft-04/schema#",
788 "schema_version": {"type": "string", "enum": ["0.3"]},
793 "description": description_schema
,
794 "tenant_id": id_schema
, #only valid for admin
795 "public": {"type": "boolean"},
796 "cloud-config": cloud_config_schema
, #common for all vnfs in the scenario
797 #"datacenter": name_schema,
800 "patternProperties":{
805 "graph": graph_schema
,
806 "vnf_name": name_schema
,
807 #"cloud-config": cloud_config_schema, #particular for a vnf
808 #"datacenter": name_schema,
809 "internal-connections": {
811 "patternProperties": {
815 "ip-profile": ip_profile_schema
,
822 "local_iface_name": name_schema
,
823 "ip_address": ip_schema
,
825 "required": ["VNFC", "local_iface_name"],
839 "patternProperties":{
850 "vnf_interface": name_schema
,
851 "ip_address": ip_schema
853 "required": ["vnf", "vnf_interface"],
856 "type": {"type": "string", "enum":["e-line", "e-lan"]},
857 "implementation": {"type": "string", "enum":["overlay", "underlay"]},
858 "external" : {"type": "boolean"},
859 "graph": graph_schema
,
860 "ip-profile": ip_profile_schema
862 "required": ["interfaces"]
868 "required": ["vnfs", "networks","name"],
869 "additionalProperties": False
872 "required": ["scenario","schema_version"],
873 "additionalProperties": False
876 #scenario_new_schema = {
877 # "title":"new scenario information schema",
878 # "$schema": "http://json-schema.org/draft-04/schema#",
879 # #"oneOf": [nsd_schema_v01, nsd_schema_v02]
880 # "oneOf": [nsd_schema_v01]
883 scenario_edit_schema
= {
884 "title":"edit scenario information schema",
885 "$schema": "http://json-schema.org/draft-04/schema#",
889 "description": description_schema
,
895 "patternProperties":{
896 "^[a-fA-F0-9]{8}(-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}$": {
902 "x": integer0_schema
,
903 "y": integer0_schema
,
904 "ifaces":{ "type": "object"}
907 "description": description_schema
,
914 "required": ["nodes"],
915 "additionalProperties": False
918 "additionalProperties": False
921 scenario_action_schema
= {
922 "title":"scenario action information schema",
923 "$schema": "http://json-schema.org/draft-04/schema#",
929 "instance_name":name_schema
,
930 "description":description_schema
,
931 "datacenter": {"type": "string"}
933 "required": ["instance_name"]
938 "instance_name":name_schema
,
939 "description":description_schema
,
940 "datacenter": {"type": "string"}
942 "required": ["instance_name"]
947 "instance_name":name_schema
,
948 "description":description_schema
,
949 "datacenter": {"type": "string"}
951 "required": ["instance_name"]
956 "instance_name":name_schema
,
957 "description":description_schema
,
958 "datacenter": {"type": "string"}
960 "required": ["instance_name"]
965 "additionalProperties": False
968 instance_scenario_object
= {
969 "title": "scenario object used to create an instance not based on any nsd",
970 "$schema": "http://json-schema.org/draft-04/schema#",
980 "external": {"type": "boolean"},
981 "type": {"enum": ["bridge", "ptp", "data"]}, # for overlay, underlay E-LINE, underlay E-LAN
983 "additionalProperties": False,
984 "required": ["name", "external", "type"]
988 "additionalProperties": False,
992 instance_scenario_create_schema_v01
= {
993 "title": "instance scenario create information schema v0.1",
994 "$schema": "http://json-schema.org/draft-04/schema#",
997 "schema_version": {"type": "string", "enum": ["0.1"]},
1001 "mgmt_keys": {"type": "array", "items": {"type":"string"}},
1002 "vduImage": name_schema
,
1003 "name": name_schema
,
1004 "description":description_schema
,
1005 "datacenter": name_schema
,
1006 "scenario" : {"oneOff": [name_schema
, instance_scenario_object
]}, # can be an UUID or name or a dict
1007 "action":{"enum": ["deploy","reserve","verify" ]},
1008 "connect_mgmt_interfaces": {"oneOf": [{"type":"boolean"}, {"type":"object"}]},# can be true or a dict with datacenter: net_name
1009 "cloud-config": cloud_config_schema
, #common to all vnfs in the instance scenario
1010 "vnfs":{ #mapping from scenario to datacenter
1012 "patternProperties":{
1016 "name": name_schema
, #override vnf name
1017 "datacenter": name_schema
,
1018 #"metadata": {"type": "object"},
1019 #"user_data": {"type": "string"}
1020 #"cloud-config": cloud_config_schema, #particular for a vnf
1023 "patternProperties": {
1027 "name": name_schema
, # overrides vdu name schema
1028 "mgmt_keys": {"type": "array", "items": {"type": "string"}},
1029 "vduImage": name_schema
,
1032 "patternProperties": {
1034 "vim_id": name_schema
,
1040 "patternProperties": {
1042 "ip_address": ip_schema
,
1043 "mac_address": mac_schema
,
1044 "floating-ip": {"type": "boolean"},
1054 "patternProperties": {
1058 "vim-network-name": name_schema
,
1059 "vim-network-id": name_schema
,
1060 "ip-profile": ip_profile_schema
,
1061 "name": name_schema
,
1070 "networks":{ #mapping from scenario to datacenter
1072 "patternProperties":{
1082 "ip_address": ip_schema
,
1083 "datacenter": name_schema
,
1084 "vim-network-name": name_schema
,
1085 "vim-network-id": name_schema
1087 "patternProperties":{
1088 ".": {"type": "string"}
1092 "ip-profile": ip_profile_schema
,
1093 #if the network connects VNFs deployed at different sites, you must specify one entry per site that this network connect to
1100 # By default for an scenario 'external' network openmano looks for an existing VIM network to map this external scenario network,
1101 # for other networks openamno creates at VIM
1102 # Use netmap-create to force to create an external scenario network
1103 "netmap-create": {"oneOf":[name_schema
,{"type": "null"}]}, #datacenter network to use. Null if must be created as an internal net
1104 #netmap-use: Indicates an existing VIM network that must be used for this scenario network.
1105 #Can use both the VIM network name (if it is not ambiguous) or the VIM net UUID
1106 #If both 'netmap-create' and 'netmap-use'are supplied, netmap-use precedes, but if fails openmano follows the netmap-create
1107 #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)
1108 "netmap-use": name_schema
, #
1109 "vim-network-name": name_schema
, #override network name
1110 "vim-network-id": name_schema
,
1111 #"ip-profile": ip_profile_schema,
1112 "datacenter": name_schema
,
1121 "additionalProperties": False,
1122 "required": ["name"]
1125 "required": ["instance"],
1126 "additionalProperties": False
1129 instance_scenario_action_schema
= {
1130 "title": "instance scenario action information schema",
1131 "$schema": "http://json-schema.org/draft-04/schema#",
1134 "start": {"type": "null"},
1135 "pause": {"type": "null"},
1136 "resume": {"type": "null"},
1137 "shutoff": {"type": "null"},
1138 "shutdown": {"type": "null"},
1139 "forceOff": {"type": "null"},
1140 "rebuild": {"type": "null"},
1142 "type": ["object", "null"],
1144 "add_public_key": description_schema
,
1145 "console": {"type": ["string", "null"], "enum": ["novnc", "xvpvnc", "rdp-html5", "spice-html5", None]},
1151 "vdu-id": id_schema
,
1152 "osm_vdu_id": name_schema
,
1153 "member-vnf-index": name_schema
,
1154 "count": integer1_schema
,
1155 "type": {"enum": ["create", "delete"]}
1157 "additionalProperties": False,
1159 "required": ["type"]
1162 "vnfs": {"type": "array", "items": {"type": "string"}},
1163 "vms": {"type": "array", "items": {"type": "string"}}
1166 #"maxProperties": 1,
1167 "additionalProperties": False
1170 sdn_controller_properties
={
1171 "name": name_schema
,
1172 "dpid": {"type":"string", "pattern":"^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){7}$"},
1174 "port": port_schema
,
1175 "type": {"type": "string", "enum": ["opendaylight","floodlight","onos"]},
1176 "version": {"type" : "string", "minLength":1, "maxLength":12},
1177 "user": nameshort_schema
,
1178 "password": passwd_schema
1180 sdn_controller_schema
= {
1181 "title":"sdn controller information schema",
1182 "$schema": "http://json-schema.org/draft-04/schema#",
1187 "properties":sdn_controller_properties
,
1188 "required": ["name", "port", 'ip', 'dpid', 'type'],
1189 "additionalProperties": False
1192 "required": ["sdn_controller"],
1193 "additionalProperties": False
1196 sdn_controller_edit_schema
= {
1197 "title":"sdn controller update information schema",
1198 "$schema": "http://json-schema.org/draft-04/schema#",
1203 "properties":sdn_controller_properties
,
1204 "additionalProperties": False
1207 "required": ["sdn_controller"],
1208 "additionalProperties": False
1211 sdn_port_mapping_schema
= {
1212 "$schema": "http://json-schema.org/draft-04/schema#",
1213 "title":"sdn port mapping information schema",
1216 "sdn_port_mapping": {
1221 "compute_node": nameshort_schema
,
1227 "pci": pci_extended_schema
, # pci_schema,
1228 "switch_port": nameshort_schema
,
1229 "switch_mac": mac_schema
1235 "required": ["compute_node", "ports"]
1239 "required": ["sdn_port_mapping"]
1242 sdn_external_port_schema
= {
1243 "$schema": "http://json-schema.org/draft-04/schema#",
1244 "title":"External port ingformation",
1247 "port": {"type" : "string", "minLength":1, "maxLength":60},
1248 "vlan": vlan_schema
,
1251 "required": ["port"]