| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 1 | # -*- coding: utf-8 -*- |
| 2 | |
| 3 | ## |
| 4 | # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. |
| 5 | # This file is part of openmano |
| 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 | ''' |
| 25 | JSON schemas used by openmano httpserver.py module to parse the different files and messages sent through the API |
| 26 | ''' |
| 27 | __author__="Alfonso Tierno, Gerardo Garcia" |
| 28 | __date__ ="$09-oct-2014 09:09:48$" |
| 29 | |
| 30 | #Basis schemas |
| tierno | 392f285 | 2016-05-13 12:28:55 +0200 | [diff] [blame] | 31 | patern_name="^[ -~]+$" |
| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 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} |
| tierno | 392f285 | 2016-05-13 12:28:55 +0200 | [diff] [blame] | 45 | path_schema={"type":"string", "pattern":"^(\.){0,2}(/[^/\"':{}\(\)]+)+$"} |
| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 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}$"} |
| garciadeblas | fec35df | 2016-08-25 11:33:57 +0200 | [diff] [blame] | 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])$"} |
| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 52 | port_schema={"type":"integer","minimum":1,"maximum":65534} |
| 53 | object_schema={"type":"object"} |
| tierno | 392f285 | 2016-05-13 12:28:55 +0200 | [diff] [blame] | 54 | schema_version_2={"type":"integer","minimum":2,"maximum":2} |
| garciadeblas | fec35df | 2016-08-25 11:33:57 +0200 | [diff] [blame] | 55 | #schema_version_string={"type":"string","enum": ["0.1", "2", "0.2", "3", "0.3"]} |
| tierno | ae4a8d1 | 2016-07-08 12:30:39 +0200 | [diff] [blame] | 56 | log_level_schema={"type":"string", "enum":["DEBUG", "INFO", "WARNING","ERROR","CRITICAL"]} |
| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 57 | |
| 58 | metadata_schema={ |
| 59 | "type":"object", |
| 60 | "properties":{ |
| 61 | "architecture": {"type":"string"}, |
| 62 | "use_incremental": {"type":"string","enum":["yes","no"]}, |
| 63 | "vpci": pci_schema, |
| 64 | "os_distro": {"type":"string"}, |
| 65 | "os_type": {"type":"string"}, |
| 66 | "os_version": {"type":"string"}, |
| 67 | "bus": {"type":"string"}, |
| 68 | "topology": {"type":"string", "enum": ["oneSocket"]} |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | #Schema for the configuration file |
| 73 | config_schema = { |
| 74 | "title":"configuration response information schema", |
| 75 | "$schema": "http://json-schema.org/draft-04/schema#", |
| 76 | "type":"object", |
| 77 | "properties":{ |
| 78 | "http_port": port_schema, |
| 79 | "http_admin_port": port_schema, |
| 80 | "http_host": nameshort_schema, |
| 81 | "vnf_repository": path_schema, |
| 82 | "db_host": nameshort_schema, |
| 83 | "db_user": nameshort_schema, |
| 84 | "db_passwd": {"type":"string"}, |
| 85 | "db_name": nameshort_schema, |
| 86 | # Next fields will disappear once the MANO API includes appropriate primitives |
| 87 | "vim_url": http_schema, |
| 88 | "vim_url_admin": http_schema, |
| 89 | "vim_name": nameshort_schema, |
| 90 | "vim_tenant_name": nameshort_schema, |
| 91 | "mano_tenant_name": nameshort_schema, |
| 92 | "mano_tenant_id": id_schema, |
| tierno | 20fc2a2 | 2016-08-19 17:02:35 +0200 | [diff] [blame] | 93 | "http_console_proxy": {"type":"boolean"}, |
| 94 | "http_console_host": nameshort_schema, |
| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 95 | "http_console_ports": { |
| 96 | "type": "array", |
| 97 | "items": {"OneOf" : [ |
| 98 | port_schema, |
| 99 | {"type":"object", "properties":{"from": port_schema, "to": port_schema}, "required": ["from","to"]} |
| 100 | ]} |
| 101 | }, |
| tierno | ae4a8d1 | 2016-07-08 12:30:39 +0200 | [diff] [blame] | 102 | "log_level": log_level_schema, |
| tierno | 72f35a5 | 2016-07-15 13:18:30 +0200 | [diff] [blame] | 103 | "log_socket_level": log_level_schema, |
| tierno | ae4a8d1 | 2016-07-08 12:30:39 +0200 | [diff] [blame] | 104 | "log_level_db": log_level_schema, |
| tierno | f97fd27 | 2016-07-11 14:32:37 +0200 | [diff] [blame] | 105 | "log_level_vimconn": log_level_schema, |
| 106 | "log_level_nfvo": log_level_schema, |
| tierno | 72f35a5 | 2016-07-15 13:18:30 +0200 | [diff] [blame] | 107 | "log_socket_host": nameshort_schema, |
| 108 | "log_socket_port": port_schema, |
| tierno | f97fd27 | 2016-07-11 14:32:37 +0200 | [diff] [blame] | 109 | "log_file": path_schema, |
| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 110 | }, |
| 111 | "required": ['db_host', 'db_user', 'db_passwd', 'db_name'], |
| 112 | "additionalProperties": False |
| 113 | } |
| 114 | |
| 115 | tenant_schema = { |
| 116 | "title":"tenant information schema", |
| 117 | "$schema": "http://json-schema.org/draft-04/schema#", |
| 118 | "type":"object", |
| 119 | "properties":{ |
| 120 | "tenant":{ |
| 121 | "type":"object", |
| 122 | "properties":{ |
| 123 | "name": nameshort_schema, |
| 124 | "description": description_schema, |
| 125 | }, |
| 126 | "required": ["name"], |
| 127 | "additionalProperties": True |
| 128 | } |
| 129 | }, |
| 130 | "required": ["tenant"], |
| 131 | "additionalProperties": False |
| 132 | } |
| garciadeblas | fec35df | 2016-08-25 11:33:57 +0200 | [diff] [blame] | 133 | |
| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 134 | tenant_edit_schema = { |
| 135 | "title":"tenant edit information schema", |
| 136 | "$schema": "http://json-schema.org/draft-04/schema#", |
| 137 | "type":"object", |
| 138 | "properties":{ |
| 139 | "tenant":{ |
| 140 | "type":"object", |
| 141 | "properties":{ |
| 142 | "name": name_schema, |
| 143 | "description": description_schema, |
| 144 | }, |
| 145 | "additionalProperties": False |
| 146 | } |
| 147 | }, |
| 148 | "required": ["tenant"], |
| 149 | "additionalProperties": False |
| 150 | } |
| 151 | |
| 152 | datacenter_schema_properties={ |
| garciadeblas | fec35df | 2016-08-25 11:33:57 +0200 | [diff] [blame] | 153 | "name": name_schema, |
| 154 | "description": description_schema, |
| 155 | "type": nameshort_schema, #currently "openvim" or "openstack", can be enlarged with plugins |
| 156 | "vim_url": description_schema, |
| 157 | "vim_url_admin": description_schema, |
| 158 | "config": { "type":"object" } |
| 159 | } |
| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 160 | |
| 161 | datacenter_schema = { |
| 162 | "title":"datacenter information schema", |
| 163 | "$schema": "http://json-schema.org/draft-04/schema#", |
| 164 | "type":"object", |
| 165 | "properties":{ |
| 166 | "datacenter":{ |
| 167 | "type":"object", |
| 168 | "properties":datacenter_schema_properties, |
| 169 | "required": ["name", "vim_url"], |
| 170 | "additionalProperties": True |
| 171 | } |
| 172 | }, |
| 173 | "required": ["datacenter"], |
| 174 | "additionalProperties": False |
| 175 | } |
| 176 | |
| 177 | |
| 178 | datacenter_edit_schema = { |
| 179 | "title":"datacenter edit nformation schema", |
| 180 | "$schema": "http://json-schema.org/draft-04/schema#", |
| 181 | "type":"object", |
| 182 | "properties":{ |
| 183 | "datacenter":{ |
| 184 | "type":"object", |
| 185 | "properties":datacenter_schema_properties, |
| 186 | "additionalProperties": False |
| 187 | } |
| 188 | }, |
| 189 | "required": ["datacenter"], |
| 190 | "additionalProperties": False |
| 191 | } |
| 192 | |
| 193 | |
| 194 | netmap_new_schema = { |
| 195 | "title":"netmap new information schema", |
| 196 | "$schema": "http://json-schema.org/draft-04/schema#", |
| 197 | "type":"object", |
| 198 | "properties":{ |
| 199 | "netmap":{ #delete from datacenter |
| 200 | "type":"object", |
| 201 | "properties":{ |
| 202 | "name": name_schema, #name or uuid of net to change |
| 203 | "vim_id": id_schema, |
| 204 | "vim_name": name_schema |
| 205 | }, |
| 206 | "minProperties": 1, |
| 207 | "additionalProperties": False |
| 208 | }, |
| 209 | }, |
| 210 | "required": ["netmap"], |
| 211 | "additionalProperties": False |
| 212 | } |
| 213 | |
| 214 | netmap_edit_schema = { |
| 215 | "title":"netmap edit information schema", |
| 216 | "$schema": "http://json-schema.org/draft-04/schema#", |
| 217 | "type":"object", |
| 218 | "properties":{ |
| 219 | "netmap":{ #delete from datacenter |
| 220 | "type":"object", |
| 221 | "properties":{ |
| 222 | "name": name_schema, #name or uuid of net to change |
| 223 | }, |
| 224 | "minProperties": 1, |
| 225 | "additionalProperties": False |
| 226 | }, |
| 227 | }, |
| 228 | "required": ["netmap"], |
| 229 | "additionalProperties": False |
| 230 | } |
| 231 | |
| 232 | datacenter_action_schema = { |
| 233 | "title":"datacenter action information schema", |
| 234 | "$schema": "http://json-schema.org/draft-04/schema#", |
| 235 | "type":"object", |
| 236 | "properties":{ |
| 237 | "net-update":{"type":"null",}, |
| 238 | "net-edit":{ |
| 239 | "type":"object", |
| 240 | "properties":{ |
| 241 | "net": name_schema, #name or uuid of net to change |
| 242 | "name": name_schema, |
| 243 | "description": description_schema, |
| 244 | "shared": {"type": "boolean"} |
| 245 | }, |
| 246 | "minProperties": 1, |
| 247 | "additionalProperties": False |
| 248 | }, |
| 249 | "net-delete":{ |
| 250 | "type":"object", |
| 251 | "properties":{ |
| 252 | "net": name_schema, #name or uuid of net to change |
| 253 | }, |
| 254 | "required": ["net"], |
| 255 | "additionalProperties": False |
| 256 | }, |
| 257 | }, |
| 258 | "minProperties": 1, |
| 259 | "maxProperties": 1, |
| 260 | "additionalProperties": False |
| 261 | } |
| 262 | |
| 263 | |
| 264 | datacenter_associate_schema={ |
| 265 | "title":"datacenter associate information schema", |
| 266 | "$schema": "http://json-schema.org/draft-04/schema#", |
| 267 | "type":"object", |
| 268 | "properties":{ |
| 269 | "datacenter":{ |
| 270 | "type":"object", |
| 271 | "properties":{ |
| 272 | "vim_tenant": id_schema, |
| 273 | "vim_tenant_name": nameshort_schema, |
| 274 | "vim_username": nameshort_schema, |
| 275 | "vim_password": nameshort_schema, |
| 276 | }, |
| 277 | # "required": ["vim_tenant"], |
| 278 | "additionalProperties": True |
| 279 | } |
| 280 | }, |
| 281 | "required": ["datacenter"], |
| 282 | "additionalProperties": False |
| 283 | } |
| 284 | |
| garciadeblas | fec35df | 2016-08-25 11:33:57 +0200 | [diff] [blame] | 285 | dhcp_schema = { |
| 286 | "title":"DHCP schema", |
| 287 | "$schema": "http://json-schema.org/draft-04/schema#", |
| 288 | "type":"object", |
| 289 | "properties":{ |
| 290 | "enabled": {"type": "boolean"}, |
| 291 | "start-address": ip_schema, |
| 292 | "count": integer1_schema |
| 293 | } |
| 294 | } |
| 295 | |
| 296 | ip_profile_schema = { |
| 297 | "title":"IP profile schema", |
| 298 | "$schema": "http://json-schema.org/draft-04/schema#", |
| 299 | "type":"object", |
| 300 | "properties":{ |
| 301 | "ip-version": {"type":"string", "enum":["IPv4","IPv6"]}, |
| 302 | "subnet-address": ip_prefix_schema, |
| 303 | "gateway-address": ip_schema, |
| 304 | "security-group": {"type":"string"}, |
| 305 | "dns-address": ip_schema, |
| 306 | "dhcp": dhcp_schema |
| 307 | }, |
| 308 | } |
| 309 | |
| 310 | key_pair_schema = { |
| 311 | "title": "Key-pair schema for cloud-init configuration schema", |
| 312 | "$schema": "http://json-schema.org/draft-04/schema#", |
| 313 | "type":"object", |
| 314 | "properties":{ |
| 315 | "name": name_schema, |
| 316 | "key": {"type":"string"} |
| 317 | }, |
| 318 | "required": ["key"], |
| 319 | "additionalProperties": False |
| 320 | } |
| 321 | |
| 322 | cloud_config_user_schema = { |
| 323 | "title": "User schema for cloud-init configuration schema", |
| 324 | "$schema": "http://json-schema.org/draft-04/schema#", |
| 325 | "type":"object", |
| 326 | "properties":{ |
| 327 | "name": nameshort_schema, |
| 328 | "user-info": {"type":"string"}, |
| 329 | #"key-pairs": {"type" : "array", "items": key_pair_schema} |
| 330 | "key-pairs": {"type" : "array", "items": {"type":"string"}} |
| 331 | }, |
| 332 | "required": ["name"], |
| 333 | "additionalProperties": False |
| 334 | } |
| 335 | |
| 336 | cloud_config_schema = { |
| 337 | "title": "Cloud-init configuration schema", |
| 338 | "$schema": "http://json-schema.org/draft-04/schema#", |
| 339 | "type":"object", |
| 340 | "properties":{ |
| 341 | #"key-pairs": {"type" : "array", "items": key_pair_schema}, |
| 342 | "key-pairs": {"type" : "array", "items": {"type":"string"}}, |
| 343 | "users": {"type" : "array", "items": cloud_config_user_schema} |
| 344 | }, |
| 345 | "additionalProperties": False |
| 346 | } |
| 347 | |
| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 348 | internal_connection_element_schema = { |
| 349 | "type":"object", |
| 350 | "properties":{ |
| 351 | "VNFC": name_schema, |
| 352 | "local_iface_name": name_schema |
| 353 | } |
| 354 | } |
| 355 | |
| garciadeblas | fec35df | 2016-08-25 11:33:57 +0200 | [diff] [blame] | 356 | internal_connection_element_schema_v02 = { |
| 357 | "type":"object", |
| 358 | "properties":{ |
| 359 | "VNFC": name_schema, |
| 360 | "local_iface_name": name_schema, |
| garciadeblas | 0c317ee | 2016-08-29 12:33:06 +0200 | [diff] [blame] | 361 | "ip_address": ip_schema |
| garciadeblas | fec35df | 2016-08-25 11:33:57 +0200 | [diff] [blame] | 362 | } |
| 363 | } |
| 364 | |
| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 365 | internal_connection_schema = { |
| 366 | "type":"object", |
| 367 | "properties":{ |
| 368 | "name": name_schema, |
| 369 | "description":description_schema, |
| 370 | "type":{"type":"string", "enum":["bridge","data","ptp"]}, |
| 371 | "elements": {"type" : "array", "items": internal_connection_element_schema, "minItems":2} |
| 372 | }, |
| 373 | "required": ["name", "type", "elements"], |
| 374 | "additionalProperties": False |
| 375 | } |
| 376 | |
| garciadeblas | fec35df | 2016-08-25 11:33:57 +0200 | [diff] [blame] | 377 | internal_connection_schema_v02 = { |
| 378 | "type":"object", |
| 379 | "properties":{ |
| 380 | "name": name_schema, |
| 381 | "description":description_schema, |
| 382 | "type": {"type": "string", "enum":["e-line", "e-lan"]}, |
| 383 | "implementation": {"type": "string", "enum":["virtual", "underlay"]}, |
| 384 | "ip-profile": ip_profile_schema, |
| 385 | "elements": {"type" : "array", "items": internal_connection_element_schema_v02, "minItems":2} |
| 386 | }, |
| 387 | "required": ["name", "type", "elements"], |
| 388 | "additionalProperties": False |
| 389 | } |
| 390 | |
| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 391 | external_connection_schema = { |
| 392 | "type":"object", |
| 393 | "properties":{ |
| 394 | "name": name_schema, |
| 395 | "type":{"type":"string", "enum":["mgmt","bridge","data"]}, |
| 396 | "VNFC": name_schema, |
| 397 | "local_iface_name": name_schema , |
| 398 | "description":description_schema |
| 399 | }, |
| 400 | "required": ["name", "type", "VNFC", "local_iface_name"], |
| 401 | "additionalProperties": False |
| 402 | } |
| 403 | |
| garciadeblas | fec35df | 2016-08-25 11:33:57 +0200 | [diff] [blame] | 404 | external_connection_schema_v02 = { |
| 405 | "type":"object", |
| 406 | "properties":{ |
| 407 | "name": name_schema, |
| 408 | "VNFC": name_schema, |
| 409 | "local_iface_name": name_schema , |
| 410 | "description":description_schema |
| 411 | }, |
| 412 | "required": ["name", "VNFC", "local_iface_name"], |
| 413 | "additionalProperties": False |
| 414 | } |
| 415 | |
| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 416 | interfaces_schema={ |
| 417 | "type":"array", |
| 418 | "items":{ |
| 419 | "type":"object", |
| 420 | "properties":{ |
| 421 | "name":name_schema, |
| 422 | "dedicated":{"type":"string","enum":["yes","no","yes:sriov"]}, |
| 423 | "bandwidth":bandwidth_schema, |
| 424 | "vpci":pci_schema, |
| 425 | "mac_address": mac_schema |
| 426 | }, |
| 427 | "additionalProperties": False, |
| 428 | "required": ["name","dedicated", "bandwidth"] |
| 429 | } |
| 430 | } |
| 431 | |
| 432 | bridge_interfaces_schema={ |
| 433 | "type":"array", |
| 434 | "items":{ |
| 435 | "type":"object", |
| 436 | "properties":{ |
| 437 | "name": name_schema, |
| 438 | "bandwidth":bandwidth_schema, |
| 439 | "vpci":pci_schema, |
| 440 | "mac_address": mac_schema, |
| 441 | "model": {"type":"string", "enum":["virtio","e1000","ne2k_pci","pcnet","rtl8139"]} |
| 442 | }, |
| 443 | "additionalProperties": False, |
| 444 | "required": ["name"] |
| 445 | } |
| 446 | } |
| 447 | |
| 448 | devices_schema={ |
| 449 | "type":"array", |
| 450 | "items":{ |
| 451 | "type":"object", |
| 452 | "properties":{ |
| 453 | "type":{"type":"string", "enum":["disk","cdrom","xml"] }, |
| 454 | "image": path_schema, |
| 455 | "image metadata": metadata_schema, |
| 456 | "vpci":pci_schema, |
| 457 | "xml":xml_text_schema, |
| 458 | }, |
| 459 | "additionalProperties": False, |
| 460 | "required": ["type"] |
| 461 | } |
| 462 | } |
| 463 | |
| 464 | |
| 465 | numa_schema = { |
| 466 | "type": "object", |
| 467 | "properties": { |
| 468 | "memory":integer1_schema, |
| 469 | "cores":integer1_schema, |
| 470 | "paired-threads":integer1_schema, |
| 471 | "threads":integer1_schema, |
| 472 | "cores-id":{"type":"array","items":integer0_schema}, |
| 473 | "paired-threads-id":{"type":"array","items":{"type":"array","minItems":2,"maxItems":2,"items":integer0_schema}}, |
| 474 | "threads-id":{"type":"array","items":integer0_schema}, |
| 475 | "interfaces":interfaces_schema |
| 476 | }, |
| 477 | "additionalProperties": False, |
| 478 | #"required": ["memory"] |
| 479 | } |
| 480 | |
| 481 | vnfc_schema = { |
| 482 | "type":"object", |
| 483 | "properties":{ |
| 484 | "name": name_schema, |
| 485 | "description": description_schema, |
| 486 | "VNFC image": {"oneOf": [path_schema, http_schema]}, |
| 487 | "image metadata": metadata_schema, |
| garciadeblas | fec35df | 2016-08-25 11:33:57 +0200 | [diff] [blame] | 488 | #"cloud-config": cloud_config_schema, #common for all vnfs in the scenario |
| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 489 | "processor": { |
| 490 | "type":"object", |
| 491 | "properties":{ |
| 492 | "model":description_schema, |
| 493 | "features":{"type":"array","items":nameshort_schema} |
| 494 | }, |
| 495 | "required": ["model"], |
| 496 | "additionalProperties": False |
| 497 | }, |
| 498 | "hypervisor": { |
| 499 | "type":"object", |
| 500 | "properties":{ |
| 501 | "type":nameshort_schema, |
| 502 | "version":description_schema |
| 503 | }, |
| 504 | }, |
| 505 | "ram":integer0_schema, |
| 506 | "vcpus":integer0_schema, |
| 507 | "disk": integer1_schema, |
| 508 | "numas": { |
| 509 | "type": "array", |
| garciadeblas | fec35df | 2016-08-25 11:33:57 +0200 | [diff] [blame] | 510 | "items": numa_schema |
| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 511 | }, |
| 512 | "bridge-ifaces": bridge_interfaces_schema, |
| 513 | "devices": devices_schema |
| garciadeblas | fec35df | 2016-08-25 11:33:57 +0200 | [diff] [blame] | 514 | |
| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 515 | }, |
| 516 | "required": ["name", "VNFC image"], |
| 517 | "additionalProperties": False |
| 518 | } |
| 519 | |
| 520 | vnfd_schema_v01 = { |
| 521 | "title":"vnfd information schema v0.1", |
| 522 | "$schema": "http://json-schema.org/draft-04/schema#", |
| 523 | "type":"object", |
| 524 | "properties":{ |
| 525 | "vnf":{ |
| 526 | "type":"object", |
| 527 | "properties":{ |
| 528 | "name": name_schema, |
| 529 | "description": description_schema, |
| 530 | "class": nameshort_schema, |
| 531 | "public": {"type" : "boolean"}, |
| 532 | "physical": {"type" : "boolean"}, |
| 533 | "tenant_id": id_schema, #only valid for admin |
| 534 | "external-connections": {"type" : "array", "items": external_connection_schema, "minItems":1}, |
| 535 | "internal-connections": {"type" : "array", "items": internal_connection_schema, "minItems":1}, |
| 536 | "VNFC":{"type" : "array", "items": vnfc_schema, "minItems":1} |
| 537 | }, |
| 538 | "required": ["name","external-connections"], |
| 539 | "additionalProperties": True |
| 540 | } |
| 541 | }, |
| 542 | "required": ["vnf"], |
| 543 | "additionalProperties": False |
| 544 | } |
| 545 | |
| garciadeblas | fec35df | 2016-08-25 11:33:57 +0200 | [diff] [blame] | 546 | #VNFD schema for OSM R1 |
| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 547 | vnfd_schema_v02 = { |
| 548 | "title":"vnfd information schema v0.2", |
| 549 | "$schema": "http://json-schema.org/draft-04/schema#", |
| 550 | "type":"object", |
| 551 | "properties":{ |
| garciadeblas | fec35df | 2016-08-25 11:33:57 +0200 | [diff] [blame] | 552 | "schema_version": {"type": "string", "enum": ["0.2"]}, |
| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 553 | "vnf":{ |
| 554 | "type":"object", |
| 555 | "properties":{ |
| 556 | "name": name_schema, |
| garciadeblas | fec35df | 2016-08-25 11:33:57 +0200 | [diff] [blame] | 557 | "description": description_schema, |
| 558 | "class": nameshort_schema, |
| 559 | "public": {"type" : "boolean"}, |
| 560 | "physical": {"type" : "boolean"}, |
| 561 | "tenant_id": id_schema, #only valid for admin |
| 562 | "external-connections": {"type" : "array", "items": external_connection_schema_v02, "minItems":1}, |
| 563 | "internal-connections": {"type" : "array", "items": internal_connection_schema_v02, "minItems":1}, |
| 564 | # "cloud-config": cloud_config_schema, #common for all vnfcs |
| 565 | "VNFC":{"type" : "array", "items": vnfc_schema, "minItems":1} |
| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 566 | }, |
| 567 | "required": ["name"], |
| 568 | "additionalProperties": True |
| 569 | } |
| 570 | }, |
| tierno | 392f285 | 2016-05-13 12:28:55 +0200 | [diff] [blame] | 571 | "required": ["vnf", "schema_version"], |
| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 572 | "additionalProperties": False |
| 573 | } |
| 574 | |
| 575 | #vnfd_schema = vnfd_schema_v01 |
| 576 | #{ |
| 577 | # "title":"vnfd information schema v0.2", |
| 578 | # "$schema": "http://json-schema.org/draft-04/schema#", |
| 579 | # "oneOf": [vnfd_schema_v01, vnfd_schema_v02] |
| 580 | #} |
| 581 | |
| 582 | graph_schema = { |
| 583 | "title":"graphical scenario descriptor information schema", |
| 584 | "$schema": "http://json-schema.org/draft-04/schema#", |
| 585 | "type":"object", |
| 586 | "properties":{ |
| 587 | "x": integer0_schema, |
| 588 | "y": integer0_schema, |
| 589 | "ifaces": { |
| 590 | "type":"object", |
| 591 | "properties":{ |
| 592 | "left": {"type":"array"}, |
| 593 | "right": {"type":"array"}, |
| 594 | "bottom": {"type":"array"}, |
| 595 | } |
| 596 | } |
| 597 | }, |
| 598 | "required": ["x","y"] |
| 599 | } |
| 600 | |
| 601 | nsd_schema_v01 = { |
| 602 | "title":"network scenario descriptor information schema v0.1", |
| 603 | "$schema": "http://json-schema.org/draft-04/schema#", |
| 604 | "type":"object", |
| 605 | "properties":{ |
| 606 | "name":name_schema, |
| 607 | "description": description_schema, |
| 608 | "tenant_id": id_schema, #only valid for admin |
| tierno | 392f285 | 2016-05-13 12:28:55 +0200 | [diff] [blame] | 609 | "public": {"type": "boolean"}, |
| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 610 | "topology":{ |
| 611 | "type":"object", |
| 612 | "properties":{ |
| 613 | "nodes": { |
| 614 | "type":"object", |
| 615 | "patternProperties":{ |
| 616 | ".": { |
| 617 | "type": "object", |
| 618 | "properties":{ |
| 619 | "type":{"type":"string", "enum":["VNF", "other_network", "network", "external_network"]}, |
| 620 | "vnf_id": id_schema, |
| 621 | "graph": graph_schema, |
| 622 | }, |
| 623 | "patternProperties":{ |
| 624 | "^(VNF )?model$": {"type": "string"} |
| 625 | }, |
| 626 | "required": ["type"] |
| 627 | } |
| 628 | } |
| 629 | }, |
| 630 | "connections": { |
| 631 | "type":"object", |
| 632 | "patternProperties":{ |
| 633 | ".": { |
| 634 | "type": "object", |
| 635 | "properties":{ |
| 636 | "nodes":{"oneOf":[{"type":"object", "minProperties":2}, {"type":"array", "minLength":1}]}, |
| 637 | "type": {"type": "string", "enum":["link", "external_network", "dataplane_net", "bridge_net"]}, |
| 638 | "graph": graph_schema |
| 639 | }, |
| 640 | "required": ["nodes"] |
| 641 | }, |
| 642 | } |
| 643 | } |
| 644 | }, |
| 645 | "required": ["nodes"], |
| 646 | "additionalProperties": False |
| 647 | } |
| 648 | }, |
| 649 | "required": ["name","topology"], |
| 650 | "additionalProperties": False |
| 651 | } |
| 652 | |
| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 653 | nsd_schema_v02 = { |
| 654 | "title":"network scenario descriptor information schema v0.2", |
| 655 | "$schema": "http://json-schema.org/draft-04/schema#", |
| 656 | "type":"object", |
| 657 | "properties":{ |
| garciadeblas | 0c317ee | 2016-08-29 12:33:06 +0200 | [diff] [blame] | 658 | "schema_version": schema_version_2, |
| tierno | 392f285 | 2016-05-13 12:28:55 +0200 | [diff] [blame] | 659 | "scenario":{ |
| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 660 | "type":"object", |
| tierno | 392f285 | 2016-05-13 12:28:55 +0200 | [diff] [blame] | 661 | "properties":{ |
| garciadeblas | fec35df | 2016-08-25 11:33:57 +0200 | [diff] [blame] | 662 | "name": name_schema, |
| tierno | 392f285 | 2016-05-13 12:28:55 +0200 | [diff] [blame] | 663 | "description": description_schema, |
| 664 | "tenant_id": id_schema, #only valid for admin |
| 665 | "public": {"type": "boolean"}, |
| 666 | "vnfs": { |
| 667 | "type":"object", |
| 668 | "patternProperties":{ |
| 669 | ".": { |
| 670 | "type": "object", |
| 671 | "properties":{ |
| 672 | "vnf_id": id_schema, |
| 673 | "graph": graph_schema, |
| 674 | "vnf_name": name_schema, |
| 675 | }, |
| 676 | } |
| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 677 | }, |
| tierno | 392f285 | 2016-05-13 12:28:55 +0200 | [diff] [blame] | 678 | "minProperties": 1 |
| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 679 | }, |
| tierno | 392f285 | 2016-05-13 12:28:55 +0200 | [diff] [blame] | 680 | "networks": { |
| 681 | "type":"object", |
| 682 | "patternProperties":{ |
| 683 | ".": { |
| 684 | "type": "object", |
| 685 | "properties":{ |
| 686 | "interfaces":{"type":"array", "minLength":1}, |
| 687 | "type": {"type": "string", "enum":["dataplane", "bridge"]}, |
| 688 | "external" : {"type": "boolean"}, |
| 689 | "graph": graph_schema |
| 690 | }, |
| 691 | "required": ["interfaces"] |
| 692 | }, |
| 693 | } |
| 694 | }, |
| 695 | |
| 696 | }, |
| garciadeblas | fec35df | 2016-08-25 11:33:57 +0200 | [diff] [blame] | 697 | "required": ["vnfs", "name"], |
| 698 | "additionalProperties": False |
| 699 | } |
| 700 | }, |
| 701 | "required": ["scenario","schema_version"], |
| 702 | "additionalProperties": False |
| 703 | } |
| 704 | |
| 705 | #NSD schema for OSM R1 |
| 706 | nsd_schema_v03 = { |
| 707 | "title":"network scenario descriptor information schema v0.3", |
| 708 | "$schema": "http://json-schema.org/draft-04/schema#", |
| 709 | "type":"object", |
| 710 | "properties":{ |
| 711 | "schema_version": {"type": "string", "enum": ["0.3"]}, |
| 712 | "scenario":{ |
| 713 | "type":"object", |
| 714 | "properties":{ |
| 715 | "name": name_schema, |
| 716 | "description": description_schema, |
| 717 | "tenant_id": id_schema, #only valid for admin |
| 718 | "public": {"type": "boolean"}, |
| 719 | "cloud-config": cloud_config_schema, #common for all vnfs in the scenario |
| garciadeblas | 0c317ee | 2016-08-29 12:33:06 +0200 | [diff] [blame] | 720 | #"datacenter": name_schema, |
| garciadeblas | fec35df | 2016-08-25 11:33:57 +0200 | [diff] [blame] | 721 | "vnfs": { |
| 722 | "type":"object", |
| 723 | "patternProperties":{ |
| 724 | ".": { |
| 725 | "type": "object", |
| 726 | "properties":{ |
| 727 | "vnf_id": id_schema, |
| 728 | "graph": graph_schema, |
| 729 | "vnf_name": name_schema, |
| garciadeblas | 0c317ee | 2016-08-29 12:33:06 +0200 | [diff] [blame] | 730 | #"cloud-config": cloud_config_schema, #particular for a vnf |
| 731 | #"datacenter": name_schema, |
| garciadeblas | fec35df | 2016-08-25 11:33:57 +0200 | [diff] [blame] | 732 | "internal-connections": { |
| 733 | "type": "object", |
| 734 | "patternProperties": { |
| 735 | ".": { |
| 736 | "type": "object", |
| 737 | "properties": { |
| 738 | "ip-profile": ip_profile_schema, |
| 739 | "elements": { |
| 740 | "type" : "array", |
| 741 | "items":{ |
| 742 | "type":"object", |
| 743 | "properties":{ |
| 744 | "VNFC": name_schema, |
| 745 | "local_iface_name": name_schema, |
| garciadeblas | 0c317ee | 2016-08-29 12:33:06 +0200 | [diff] [blame] | 746 | "ip_address": ip_schema |
| garciadeblas | fec35df | 2016-08-25 11:33:57 +0200 | [diff] [blame] | 747 | }, |
| 748 | "required": ["VNFC", "local_iface_name"], |
| 749 | } |
| 750 | } |
| 751 | } |
| 752 | } |
| 753 | } |
| 754 | } |
| 755 | }, |
| 756 | } |
| 757 | }, |
| 758 | "minProperties": 1 |
| 759 | }, |
| 760 | "networks": { |
| 761 | "type":"object", |
| 762 | "patternProperties":{ |
| 763 | ".": { |
| 764 | "type": "object", |
| 765 | "properties":{ |
| 766 | "interfaces":{ |
| 767 | "type":"array", |
| 768 | "minLength":1, |
| 769 | "items":{ |
| 770 | "type":"object", |
| 771 | "properties":{ |
| garciadeblas | 0c317ee | 2016-08-29 12:33:06 +0200 | [diff] [blame] | 772 | "ip_address": ip_schema |
| garciadeblas | fec35df | 2016-08-25 11:33:57 +0200 | [diff] [blame] | 773 | }, |
| 774 | "patternProperties":{ |
| 775 | ".": {"type": "string"} |
| 776 | } |
| 777 | } |
| 778 | }, |
| 779 | "type": {"type": "string", "enum":["e-line", "e-lan"]}, |
| 780 | "implementation": {"type": "string", "enum":["virtual", "underlay"]}, |
| 781 | "external" : {"type": "boolean"}, |
| 782 | "graph": graph_schema, |
| 783 | "ip-profile": ip_profile_schema |
| 784 | }, |
| 785 | "required": ["interfaces"] |
| 786 | }, |
| 787 | } |
| 788 | }, |
| 789 | |
| 790 | }, |
| tierno | 392f285 | 2016-05-13 12:28:55 +0200 | [diff] [blame] | 791 | "required": ["vnfs", "networks","name"], |
| 792 | "additionalProperties": False |
| 793 | } |
| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 794 | }, |
| tierno | 392f285 | 2016-05-13 12:28:55 +0200 | [diff] [blame] | 795 | "required": ["scenario","schema_version"], |
| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 796 | "additionalProperties": False |
| 797 | } |
| 798 | |
| 799 | #scenario_new_schema = { |
| 800 | # "title":"new scenario information schema", |
| 801 | # "$schema": "http://json-schema.org/draft-04/schema#", |
| 802 | # #"oneOf": [nsd_schema_v01, nsd_schema_v02] |
| 803 | # "oneOf": [nsd_schema_v01] |
| 804 | #} |
| 805 | |
| 806 | scenario_edit_schema = { |
| 807 | "title":"edit scenario information schema", |
| 808 | "$schema": "http://json-schema.org/draft-04/schema#", |
| 809 | "type":"object", |
| 810 | "properties":{ |
| 811 | "name":name_schema, |
| 812 | "description": description_schema, |
| 813 | "topology":{ |
| 814 | "type":"object", |
| 815 | "properties":{ |
| 816 | "nodes": { |
| 817 | "type":"object", |
| 818 | "patternProperties":{ |
| 819 | "^[a-fA-F0-9]{8}(-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}$": { |
| 820 | "type":"object", |
| 821 | "properties":{ |
| 822 | "graph":{ |
| 823 | "type": "object", |
| 824 | "properties":{ |
| 825 | "x": integer0_schema, |
| 826 | "y": integer0_schema, |
| 827 | "ifaces":{ "type": "object"} |
| 828 | } |
| 829 | }, |
| 830 | "description": description_schema, |
| 831 | "name": name_schema |
| 832 | } |
| 833 | } |
| 834 | } |
| 835 | } |
| 836 | }, |
| 837 | "required": ["nodes"], |
| 838 | "additionalProperties": False |
| 839 | } |
| 840 | }, |
| 841 | "additionalProperties": False |
| 842 | } |
| 843 | |
| 844 | scenario_action_schema = { |
| 845 | "title":"scenario action information schema", |
| 846 | "$schema": "http://json-schema.org/draft-04/schema#", |
| 847 | "type":"object", |
| 848 | "properties":{ |
| 849 | "start":{ |
| 850 | "type": "object", |
| 851 | "properties": { |
| 852 | "instance_name":name_schema, |
| 853 | "description":description_schema, |
| 854 | "datacenter": {"type": "string"} |
| 855 | }, |
| 856 | "required": ["instance_name"] |
| 857 | }, |
| 858 | "deploy":{ |
| 859 | "type": "object", |
| 860 | "properties": { |
| 861 | "instance_name":name_schema, |
| 862 | "description":description_schema, |
| 863 | "datacenter": {"type": "string"} |
| 864 | }, |
| 865 | "required": ["instance_name"] |
| 866 | }, |
| 867 | "reserve":{ |
| 868 | "type": "object", |
| 869 | "properties": { |
| 870 | "instance_name":name_schema, |
| 871 | "description":description_schema, |
| 872 | "datacenter": {"type": "string"} |
| 873 | }, |
| 874 | "required": ["instance_name"] |
| 875 | }, |
| 876 | "verify":{ |
| 877 | "type": "object", |
| 878 | "properties": { |
| 879 | "instance_name":name_schema, |
| 880 | "description":description_schema, |
| 881 | "datacenter": {"type": "string"} |
| 882 | }, |
| 883 | "required": ["instance_name"] |
| 884 | } |
| 885 | }, |
| 886 | "minProperties": 1, |
| 887 | "maxProperties": 1, |
| 888 | "additionalProperties": False |
| 889 | } |
| 890 | |
| garciadeblas | fec35df | 2016-08-25 11:33:57 +0200 | [diff] [blame] | 891 | instance_scenario_create_schema_v01 = { |
| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 892 | "title":"instance scenario create information schema v0.1", |
| 893 | "$schema": "http://json-schema.org/draft-04/schema#", |
| 894 | "type":"object", |
| 895 | "properties":{ |
| 896 | "schema_version": {"type": "string", "enum": ["0.1"]}, |
| 897 | "instance":{ |
| 898 | "type":"object", |
| 899 | "properties":{ |
| 900 | "name":name_schema, |
| 901 | "description":description_schema, |
| garciadeblas | 0c317ee | 2016-08-29 12:33:06 +0200 | [diff] [blame] | 902 | "datacenter": name_schema, |
| 903 | "scenario" : name_schema, #can be an UUID or name |
| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 904 | "action":{"enum": ["deploy","reserve","verify" ]}, |
| garciadeblas | fec35df | 2016-08-25 11:33:57 +0200 | [diff] [blame] | 905 | "connect_mgmt_interfaces": {"oneOf": [{"type":"boolean"}, {"type":"object"}]},# can be true or a dict with datacenter: net_name |
| 906 | "cloud-config": cloud_config_schema, #common to all vnfs in the instance scenario |
| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 907 | "vnfs":{ #mapping from scenario to datacenter |
| 908 | "type": "object", |
| 909 | "patternProperties":{ |
| 910 | ".": { |
| 911 | "type": "object", |
| 912 | "properties":{ |
| garciadeblas | fec35df | 2016-08-25 11:33:57 +0200 | [diff] [blame] | 913 | "name": name_schema, #override vnf name |
| garciadeblas | 0c317ee | 2016-08-29 12:33:06 +0200 | [diff] [blame] | 914 | "datacenter": name_schema, |
| garciadeblas | fec35df | 2016-08-25 11:33:57 +0200 | [diff] [blame] | 915 | #"metadata": {"type": "object"}, |
| 916 | #"user_data": {"type": "string"} |
| garciadeblas | 0c317ee | 2016-08-29 12:33:06 +0200 | [diff] [blame] | 917 | #"cloud-config": cloud_config_schema, #particular for a vnf |
| garciadeblas | fec35df | 2016-08-25 11:33:57 +0200 | [diff] [blame] | 918 | "external-connections": { |
| 919 | "type": "object", |
| 920 | "patternProperties": { |
| 921 | ".": { |
| 922 | "type": "object", |
| 923 | "properties": { |
| 924 | "vim-network-name": name_schema, |
| garciadeblas | 0c317ee | 2016-08-29 12:33:06 +0200 | [diff] [blame] | 925 | "ip_address": ip_schema |
| garciadeblas | fec35df | 2016-08-25 11:33:57 +0200 | [diff] [blame] | 926 | } |
| 927 | } |
| 928 | } |
| 929 | }, |
| 930 | "internal-connections": { |
| 931 | "type": "object", |
| 932 | "patternProperties": { |
| 933 | ".": { |
| 934 | "type": "object", |
| 935 | "properties": { |
| 936 | "ip-profile": ip_profile_schema, |
| 937 | "elements": { |
| 938 | "type" : "array", |
| 939 | "items":{ |
| 940 | "type":"object", |
| 941 | "properties":{ |
| 942 | "VNFC": name_schema, |
| 943 | "local_iface_name": name_schema, |
| garciadeblas | 0c317ee | 2016-08-29 12:33:06 +0200 | [diff] [blame] | 944 | "ip_address": ip_schema |
| garciadeblas | fec35df | 2016-08-25 11:33:57 +0200 | [diff] [blame] | 945 | }, |
| 946 | "required": ["VNFC", "local_iface_name"], |
| 947 | } |
| 948 | } |
| 949 | } |
| 950 | } |
| 951 | } |
| 952 | } |
| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 953 | } |
| 954 | } |
| 955 | }, |
| 956 | }, |
| 957 | "networks":{ #mapping from scenario to datacenter |
| 958 | "type": "object", |
| 959 | "patternProperties":{ |
| 960 | ".": { |
| 961 | "type": "object", |
| 962 | "properties":{ |
| garciadeblas | fec35df | 2016-08-25 11:33:57 +0200 | [diff] [blame] | 963 | "interfaces":{ |
| 964 | "type":"array", |
| 965 | "minLength":1, |
| 966 | "items":{ |
| 967 | "type":"object", |
| 968 | "properties":{ |
| garciadeblas | 0c317ee | 2016-08-29 12:33:06 +0200 | [diff] [blame] | 969 | "ip_address": ip_schema |
| garciadeblas | fec35df | 2016-08-25 11:33:57 +0200 | [diff] [blame] | 970 | }, |
| 971 | "patternProperties":{ |
| 972 | ".": {"type": "string"} |
| 973 | } |
| 974 | } |
| 975 | }, |
| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 976 | "netmap-create": {"oneOf":[name_schema,{"type": "null"}]}, #datacenter network to use. Null if must be created as an internal net |
| 977 | "netmap-use": name_schema, |
| garciadeblas | 0c317ee | 2016-08-29 12:33:06 +0200 | [diff] [blame] | 978 | #"name": name_schema, #override network name |
| garciadeblas | fec35df | 2016-08-25 11:33:57 +0200 | [diff] [blame] | 979 | "ip-profile": ip_profile_schema, |
| garciadeblas | 0c317ee | 2016-08-29 12:33:06 +0200 | [diff] [blame] | 980 | #"datacenter": name_schema, |
| garciadeblas | fec35df | 2016-08-25 11:33:57 +0200 | [diff] [blame] | 981 | "vim-network-name": name_schema |
| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 982 | } |
| 983 | } |
| 984 | }, |
| 985 | }, |
| 986 | }, |
| 987 | "additionalProperties": False, |
| garciadeblas | fec35df | 2016-08-25 11:33:57 +0200 | [diff] [blame] | 988 | "required": ["name"] |
| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 989 | }, |
| 990 | }, |
| 991 | "required": ["instance"], |
| 992 | "additionalProperties": False |
| tierno | 7edb675 | 2016-03-21 17:37:52 +0100 | [diff] [blame] | 993 | } |
| 994 | |
| 995 | instance_scenario_action_schema = { |
| 996 | "title":"instance scenario action information schema", |
| 997 | "$schema": "http://json-schema.org/draft-04/schema#", |
| 998 | "type":"object", |
| 999 | "properties":{ |
| 1000 | "start":{"type": "null"}, |
| 1001 | "pause":{"type": "null"}, |
| 1002 | "resume":{"type": "null"}, |
| 1003 | "shutoff":{"type": "null"}, |
| 1004 | "shutdown":{"type": "null"}, |
| 1005 | "forceOff":{"type": "null"}, |
| 1006 | "rebuild":{"type": "null"}, |
| 1007 | "reboot":{ |
| 1008 | "type": ["object","null"], |
| 1009 | }, |
| 1010 | "console": {"type": ["string", "null"], "enum": ["novnc", "xvpvnc", "rdp-html5", "spice-html5", None]}, |
| 1011 | "vnfs":{"type": "array", "items":{"type":"string"}}, |
| 1012 | "vms":{"type": "array", "items":{"type":"string"}} |
| 1013 | }, |
| 1014 | "minProperties": 1, |
| 1015 | #"maxProperties": 1, |
| 1016 | "additionalProperties": False |
| 1017 | } |