|
1 | 1 | {
|
2 |
| - "$schema": "http://json-schema.org/draft-07/schema#", |
| 2 | + "$schema": "http://json-schema.org/draft-03/schema#", |
3 | 3 | "title": "Kimchi API",
|
4 | 4 | "description": "Json schema for Kimchi API",
|
5 | 5 | "type": "object",
|
|
15 | 15 | },
|
16 | 16 | "listen": {
|
17 | 17 | "error": "KCHVM0015E",
|
18 |
| - "anyOf": [ |
| 18 | + "type": [ |
19 | 19 | {
|
20 | 20 | "type": "string",
|
21 | 21 | "format": "ipv4"
|
|
94 | 94 | "interface": {
|
95 | 95 | "description": "Host network interface. This indicates how to configure the host network interface (Ethernet, Bond, VLAN) as direct macvtap or as OVS interface to a VM.",
|
96 | 96 | "type": "object",
|
97 |
| - "required": [ |
98 |
| - "type", |
99 |
| - "name" |
100 |
| - ], |
101 | 97 | "properties": {
|
102 | 98 | "type": {
|
103 |
| - "description": "Host network interface type. Valid types are: 'macvtap' for host network interface (Ethernet, Bond, VLAN) to be connected as direct MacVTap or 'ovs' for openvswitch host network interface to be connected as virtual switch to a VM.", |
104 |
| - "type": "string", |
105 |
| - "pattern": "^(macvtap|ovs)$", |
106 |
| - "error": "KCHTMPL0034E" |
| 99 | + "description": "Host network interface type. Valid types are: 'macvtap' for host network interface (Ethernet, Bond, VLAN) to be connected as direct MacVTap or 'ovs' for openvswitch host network interface to be connected as virtual switch to a VM.", |
| 100 | + "type": "string", |
| 101 | + "required": true, |
| 102 | + "pattern": "^(macvtap|ovs)$", |
| 103 | + "error": "KCHTMPL0034E" |
107 | 104 | },
|
108 | 105 | "name": {
|
109 |
| - "description": "The host network interface name. It should be name of host network interface(Ethernet, Bond, VLAN) for type 'macvtap' and name of host openvswitch bridge interface for type ovs", |
110 |
| - "type": "string", |
111 |
| - "error": "KCHTMPL0035E" |
| 106 | + "description": "The host network interface name. It should be name of host network interface(Ethernet, Bond, VLAN) for type 'macvtap' and name of host openvswitch bridge interface for type ovs", |
| 107 | + "type": "string", |
| 108 | + "required": true, |
| 109 | + "error": "KCHTMPL0035E" |
112 | 110 | },
|
113 | 111 | "mode": {
|
114 |
| - "description": "Only applicable for macvtap interface type. That indicates whether packets will be delivered directly to target device (bridge) or to the external bridge (vepa-capable bridge).", |
115 |
| - "type": "string", |
116 |
| - "pattern": "^(bridge|vepa)$", |
117 |
| - "error": "KCHTMPL0036E" |
| 112 | + "description": "Only applicable for macvtap interface type. That indicates whether packets will be delivered directly to target device (bridge) or to the external bridge (vepa-capable bridge).", |
| 113 | + "type": "string", |
| 114 | + "pattern": "^(bridge|vepa)$", |
| 115 | + "error": "KCHTMPL0036E" |
118 | 116 | }
|
119 | 117 | },
|
120 | 118 | "additionalProperties": false,
|
|
124 | 122 | "properties": {
|
125 | 123 | "storagepools_create": {
|
126 | 124 | "type": "object",
|
127 |
| - "required": [ |
128 |
| - "name", |
129 |
| - "type" |
130 |
| - ], |
131 | 125 | "error": "KCHPOOL0026E",
|
132 | 126 | "properties": {
|
133 | 127 | "name": {
|
134 | 128 | "description": "The name of the Storage Pool",
|
135 | 129 | "type": "string",
|
| 130 | + "required": true, |
136 | 131 | "minLength": 1,
|
137 | 132 | "pattern": "^[^/]*$",
|
138 | 133 | "error": "KCHPOOL0016E"
|
139 | 134 | },
|
140 | 135 | "type": {
|
141 | 136 | "description": "The type of the defined Storage Pool",
|
142 | 137 | "type": "string",
|
| 138 | + "required": true, |
143 | 139 | "pattern": "^dir|netfs|logical|kimchi-iso|iscsi|scsi$",
|
144 | 140 | "error": "KCHPOOL0017E"
|
145 | 141 | },
|
|
275 | 271 | },
|
276 | 272 | "storagevolume_update": {
|
277 | 273 | "type": "object",
|
278 |
| - "required": [ |
279 |
| - "chunk", |
280 |
| - "chunk_size" |
281 |
| - ], |
282 | 274 | "properties": {
|
283 | 275 | "chunk": {
|
284 | 276 | "description": "Upload storage volume chunk",
|
285 |
| - "error": "KCHVOL0024E" |
| 277 | + "error": "KCHVOL0024E", |
| 278 | + "required": true |
286 | 279 | },
|
287 | 280 | "chunk_size": {
|
288 | 281 | "description": "Chunk size of uploaded storage volume",
|
289 | 282 | "type": "string",
|
| 283 | + "required": true, |
290 | 284 | "error": "KCHVOL0024E"
|
291 | 285 | }
|
292 | 286 | },
|
293 | 287 | "additionalProperties": false
|
294 | 288 | },
|
295 | 289 | "vms_create": {
|
296 | 290 | "type": "object",
|
297 |
| - "required": [ |
298 |
| - "template" |
299 |
| - ], |
300 | 291 | "error": "KCHVM0016E",
|
301 | 292 | "properties": {
|
302 | 293 | "name": {
|
|
319 | 310 | "description": "The URI of a template to use when building a VM",
|
320 | 311 | "type": "string",
|
321 | 312 | "pattern": "^/plugins/kimchi/templates/(.*?)/?$",
|
| 313 | + "required": true, |
322 | 314 | "error": "KCHVM0012E"
|
323 | 315 | },
|
324 | 316 | "storagepool": {
|
|
439 | 431 | },
|
440 | 432 | "vm_migrate": {
|
441 | 433 | "type": "object",
|
442 |
| - "required": [ |
443 |
| - "remote_host" |
444 |
| - ], |
445 | 434 | "properties": {
|
446 | 435 | "remote_host": {
|
447 | 436 | "description": "IP address or hostname of the remote server",
|
448 | 437 | "type": "string",
|
449 | 438 | "minLength": 1,
|
| 439 | + "required": true, |
450 | 440 | "error": "KCHVM0060E"
|
451 | 441 | },
|
452 | 442 | "user": {
|
|
470 | 460 | },
|
471 | 461 | "networks_create": {
|
472 | 462 | "type": "object",
|
473 |
| - "required": [ |
474 |
| - "name", |
475 |
| - "connection" |
476 |
| - ], |
477 | 463 | "error": "KCHNET0016E",
|
478 | 464 | "properties": {
|
479 | 465 | "name": {
|
480 | 466 | "description": "The name of the new network",
|
481 | 467 | "type": "string",
|
482 | 468 | "minLength": 1,
|
| 469 | + "required": true, |
483 | 470 | "pattern": "^[^/\"]*$",
|
484 | 471 | "error": "KCHNET0011E"
|
485 | 472 | },
|
486 | 473 | "connection": {
|
487 | 474 | "description": "Specifies how this network should be connected to the other networks",
|
488 | 475 | "type": "string",
|
| 476 | + "required": true, |
489 | 477 | "pattern": "^isolated|nat|bridge|macvtap|vepa|passthrough$",
|
490 | 478 | "error": "KCHNET0012E"
|
491 | 479 | },
|
|
542 | 530 | },
|
543 | 531 | "vmifaces_create": {
|
544 | 532 | "type": "object",
|
545 |
| - "required": [ |
546 |
| - "type" |
547 |
| - ], |
548 | 533 | "error": "KCHVMIF0007E",
|
549 | 534 | "properties": {
|
550 | 535 | "type": {
|
551 | 536 | "description": "The type of VM network interface that libvirt supports. Type 'macvtap' for host network interface (Ethernet, Bond, VLAN) to be connected as direct MacVTap or 'ovs' for openvswitch host network interface to be connected as virtual switch to a VM or 'network' for libvirt virtual network to be connected to VM. ",
|
552 | 537 | "type": "string",
|
| 538 | + "required": true, |
553 | 539 | "pattern": "^network|macvtap|ovs$",
|
554 | 540 | "error": "KCHVMIF0004E"
|
555 | 541 | },
|
|
597 | 583 | },
|
598 | 584 | "templates_create": {
|
599 | 585 | "type": "object",
|
600 |
| - "required": [ |
601 |
| - "source_media" |
602 |
| - ], |
603 | 586 | "error": "KCHTMPL0016E",
|
604 | 587 | "properties": {
|
605 | 588 | "name": {
|
|
630 | 613 | "memory": { "$ref": "#/kimchitype/memory" },
|
631 | 614 | "source_media": {
|
632 | 615 | "type" : "object",
|
633 |
| - "required": [ |
634 |
| - "type" |
635 |
| - ], |
| 616 | + "required": true, |
636 | 617 | "properties" : {
|
637 | 618 | "type": {
|
638 | 619 | "description": "Type of source media: disk or netboot",
|
| 620 | + "required": true, |
639 | 621 | "type": "string",
|
640 | 622 | "pattern": "^disk|netboot$"
|
641 | 623 | },
|
|
747 | 729 | },
|
748 | 730 | "vmstorages_create": {
|
749 | 731 | "type": "object",
|
750 |
| - "required": [ |
751 |
| - "type" |
752 |
| - ], |
753 | 732 | "error": "KCHVMSTOR0012E",
|
754 | 733 | "properties": {
|
755 | 734 | "type": {
|
756 | 735 | "description": "The storage type",
|
757 | 736 | "type": "string",
|
758 | 737 | "pattern": "^cdrom|disk$",
|
| 738 | + "required": true, |
759 | 739 | "error": "KCHVMSTOR0002E"
|
760 | 740 | },
|
761 | 741 | "pool": {
|
|
780 | 760 | },
|
781 | 761 | "vmstorage_update": {
|
782 | 762 | "type": "object",
|
783 |
| - "required": [ |
784 |
| - "path" |
785 |
| - ], |
786 | 763 | "error": "KCHVMSTOR0013E",
|
787 | 764 | "properties": {
|
788 | 765 | "path": {
|
789 | 766 | "description": "Path of iso image file or disk mount point",
|
790 | 767 | "type": "string",
|
| 768 | + "required": true, |
791 | 769 | "pattern": "^(|(/)|(http)[s]?:|[t]?(ftp)[s]?:)+.*$",
|
792 | 770 | "error": "KCHVMSTOR0003E"
|
793 | 771 | }
|
|
932 | 910 | },
|
933 | 911 | "vmhostdevs_create": {
|
934 | 912 | "type": "object",
|
935 |
| - "required": [ |
936 |
| - "name" |
937 |
| - ], |
938 | 913 | "properties": {
|
939 | 914 | "name": {
|
940 | 915 | "description": "Then name of the device to assign to VM",
|
941 | 916 | "type": "string",
|
| 917 | + "required": true, |
942 | 918 | "pattern": "^[_A-Za-z0-9-]+$",
|
943 | 919 | "error": "KCHVMHDEV0004E"
|
944 | 920 | }
|
|
0 commit comments