{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "definitions": {
        "dynamips_slot": {
            "enum": [
                "C2600-MB-2FE",
                "C2600-MB-1E",
                "PA-A1",
                "PA-8E",
                "C1700-MB-1FE",
                "PA-8T",
                "PA-2FE-TX",
                "PA-FE-TX",
                "PA-GE",
                "C2600-MB-2E",
                "C7200-IO-FE",
                "NM-4T",
                "C2600-MB-1FE",
                "C7200-IO-2FE",
                "PA-POS-OC3",
                "PA-4T+",
                "C1700-MB-WIC1",
                "NM-16ESW",
                "C7200-IO-GE-E",
                "NM-4E",
                "GT96100-FE",
                "NM-1FE-TX",
                "Leopard-2FE",
                "NM-1E",
                "PA-4E",
                ""
            ]
        },
        "dynamips_wic": {
            "enum": [
                "WIC-1ENET",
                "WIC-1T",
                "WIC-2T",
                ""
            ]
        }
    },
    "properties": {
        "availability": {
            "enum": [
                "free",
                "with-registration",
                "free-to-try",
                "service-contract"
            ],
            "title": "About image availability: can be downloaded directly; download requires a free registration; paid but a trial version (time or feature limited) is available; not available publicly"
        },
        "category": {
            "enum": [
                "router",
                "multilayer_switch",
                "firewall",
                "guest"
            ],
            "title": "Category of the appliance"
        },
        "description": {
            "title": "Description of the appliance. Could be a marketing description",
            "type": "string"
        },
        "docker": {
            "properties": {
                "adapters": {
                    "title": "Number of ethernet adapters",
                    "type": "integer"
                },
                "console_http_path": {
                    "description": "Path of the web interface",
                    "type": "string"
                },
                "console_http_port": {
                    "description": "Internal port in the container of the HTTP server",
                    "type": "integer"
                },
                "console_type": {
                    "enum": [
                        "telnet",
                        "vnc",
                        "http",
                        "https"
                    ],
                    "title": "Type of console connection for the administration of the appliance"
                },
                "environment": {
                    "title": "One KEY=VAR environment by line",
                    "type": "string"
                },
                "image": {
                    "title": "Docker image in the Docker Hub",
                    "type": "string"
                },
                "start_command": {
                    "title": "Command executed when the container start. Empty will use the default",
                    "type": "string"
                }
            },
            "required": [
                "adapters",
                "image"
            ],
            "title": "Docker specific options",
            "type": "object"
        },
        "documentation_url": {
            "_format": "uri",
            "title": "An optional documentation for using the appliance on vendor website",
            "type": "string"
        },
        "dynamips": {
            "properties": {
                "chassis": {
                    "enum": [
                        "1720",
                        "1721",
                        "1750",
                        "1751",
                        "1760",
                        "2610",
                        "2620",
                        "2610XM",
                        "2620XM",
                        "2650XM",
                        "2621",
                        "2611XM",
                        "2621XM",
                        "2651XM",
                        "3620",
                        "3640",
                        "3660",
                        ""
                    ],
                    "title": "Chassis type"
                },
                "midplane": {
                    "enum": [
                        "std",
                        "vxr"
                    ]
                },
                "npe": {
                    "enum": [
                        "npe-100",
                        "npe-150",
                        "npe-175",
                        "npe-200",
                        "npe-225",
                        "npe-300",
                        "npe-400",
                        "npe-g2"
                    ]
                },
                "nvram": {
                    "minimum": 1,
                    "title": "Amount of nvram",
                    "type": "integer"
                },
                "platform": {
                    "enum": [
                        "c1700",
                        "c2600",
                        "c2691",
                        "c3725",
                        "c3745",
                        "c3600",
                        "c7200"
                    ],
                    "title": "Platform type"
                },
                "ram": {
                    "minimum": 1,
                    "title": "Amount of ram",
                    "type": "integer"
                },
                "slot0": {
                    "$ref": "#/definitions/dynamips_slot"
                },
                "slot1": {
                    "$ref": "#/definitions/dynamips_slot"
                },
                "slot2": {
                    "$ref": "#/definitions/dynamips_slot"
                },
                "slot3": {
                    "$ref": "#/definitions/dynamips_slot"
                },
                "slot4": {
                    "$ref": "#/definitions/dynamips_slot"
                },
                "slot5": {
                    "$ref": "#/definitions/dynamips_slot"
                },
                "slot6": {
                    "$ref": "#/definitions/dynamips_slot"
                },
                "startup_config": {
                    "title": "Config loaded at startup",
                    "type": "string"
                },
                "wic0": {
                    "$ref": "#/definitions/dynamips_wic"
                },
                "wic1": {
                    "$ref": "#/definitions/dynamips_wic"
                },
                "wic2": {
                    "$ref": "#/definitions/dynamips_wic"
                }
            },
            "required": [
                "platform",
                "ram",
                "nvram"
            ],
            "title": "Dynamips specific options",
            "type": "object"
        },
        "first_port_name": {
            "title": "Optional name of the first networking port example: eth0",
            "type": "string"
        },
        "images": {
            "items": {
                "properties": {
                    "compression": {
                        "enum": [
                            "bzip2",
                            "gzip",
                            "lzma",
                            "xz",
                            "rar",
                            "zip",
                            "7z"
                        ],
                        "title": "Optional, compression type of direct download url image."
                    },
                    "direct_download_url": {
                        "_format": "uri",
                        "title": "Optional. Non authenticated url to the image file where you can download the image.",
                        "type": "string"
                    },
                    "download_url": {
                        "_format": "uri",
                        "title": "Download url where you can download the appliance from a browser",
                        "type": "string"
                    },
                    "filename": {
                        "title": "Filename",
                        "type": "string"
                    },
                    "filesize": {
                        "title": "File size in bytes",
                        "type": "integer"
                    },
                    "md5sum": {
                        "pattern": "^[a-f0-9]{32}$",
                        "title": "md5sum of the file",
                        "type": "string"
                    },
                    "version": {
                        "title": "Version of the file",
                        "type": "string"
                    }
                },
                "required": [
                    "filename",
                    "version",
                    "md5sum",
                    "filesize"
                ],
                "title": "An image file",
                "type": "object"
            },
            "title": "Images for this appliance",
            "type": "array"
        },
        "iou": {
            "properties": {
                "ethernet_adapters": {
                    "title": "Number of ethernet adapters",
                    "type": "integer"
                },
                "nvram": {
                    "title": "Host NVRAM",
                    "type": "integer"
                },
                "ram": {
                    "title": "Host RAM",
                    "type": "integer"
                },
                "serial_adapters": {
                    "title": "Number of serial adapters",
                    "type": "integer"
                },
                "startup_config": {
                    "title": "Config loaded at startup",
                    "type": "string"
                }
            },
            "required": [
                "ethernet_adapters",
                "serial_adapters",
                "nvram",
                "ram",
                "startup_config"
            ],
            "title": "IOU specific options",
            "type": "object"
        },
        "linked_clone": {
            "title": "False if you don't want to use a single image for all nodes",
            "type": "boolean"
        },
        "maintainer": {
            "title": "Maintainer name",
            "type": "string"
        },
        "maintainer_email": {
            "_format": "email",
            "title": "Maintainer email",
            "type": "string"
        },
        "name": {
            "title": "Appliance name",
            "type": "string"
        },
        "port_name_format": {
            "title": "Optional formating of the networking port example: eth{0}",
            "type": "string"
        },
        "port_segment_size": {
            "title": "Optional port segment size. A port segment is a block of port. For example Ethernet0/0 Ethernet0/1 is the module 0 with a port segment size of 2",
            "type": "integer"
        },
        "product_name": {
            "title": "Product name",
            "type": "string"
        },
        "product_url": {
            "_format": "uri",
            "title": "An optional product url on vendor website",
            "type": "string"
        },
        "qemu": {
            "properties": {
                "adapter_type": {
                    "enum": [
                        "e1000",
                        "i82550",
                        "i82551",
                        "i82557a",
                        "i82557b",
                        "i82557c",
                        "i82558a",
                        "i82558b",
                        "i82559a",
                        "i82559b",
                        "i82559c",
                        "i82559er",
                        "i82562",
                        "i82801",
                        "ne2k_pci",
                        "pcnet",
                        "rtl8139",
                        "virtio",
                        "virtio-net-pci",
                        "vmxnet3"
                    ],
                    "title": "Type of network adapter"
                },
                "adapters": {
                    "title": "Number of adapters",
                    "type": "integer"
                },
                "arch": {
                    "enum": [
                        "aarch64",
                        "alpha",
                        "arm",
                        "cris",
                        "i386",
                        "lm32",
                        "m68k",
                        "microblaze",
                        "microblazeel",
                        "mips",
                        "mips64",
                        "mips64el",
                        "mipsel",
                        "moxie",
                        "or32",
                        "ppc",
                        "ppc64",
                        "ppcemb",
                        "s390x",
                        "sh4",
                        "sh4eb",
                        "sparc",
                        "sparc64",
                        "tricore",
                        "unicore32",
                        "x86_64",
                        "xtensa",
                        "xtensaeb"
                    ],
                    "title": "Architecture emulated"
                },
                "boot_priority": {
                    "enum": [
                        "d",
                        "c",
                        "dc",
                        "cd",
                        "n",
                        "nc",
                        "nd",
                        "cn",
                        "dn"
                    ],
                    "title": "Optional define the disk boot priory. Refer to -boot option in qemu manual for more details."
                },
                "console_type": {
                    "enum": [
                        "telnet",
                        "vnc",
                        "spice"
                    ],
                    "title": "Type of console connection for the administration of the appliance"
                },
                "cpu_throttling": {
                    "maximum": 100,
                    "minimum": 0,
                    "title": "Throttle the CPU",
                    "type": "number"
                },
                "cpus": {
                    "title": "Number of Virtual CPU",
                    "type": "integer"
                },
                "custom_adapters": {
                    "items": {
                        "properties": {
                            "adapter_number": {
                                "title": "Adapter number",
                                "type": "integer"
                            },
                            "adapter_type": {
                                "enum": [
                                    "e1000",
                                    "i82550",
                                    "i82551",
                                    "i82557a",
                                    "i82557b",
                                    "i82557c",
                                    "i82558a",
                                    "i82558b",
                                    "i82559a",
                                    "i82559b",
                                    "i82559c",
                                    "i82559er",
                                    "i82562",
                                    "i82801",
                                    "ne2k_pci",
                                    "pcnet",
                                    "rtl8139",
                                    "virtio",
                                    "virtio-net-pci",
                                    "vmxnet3"
                                ],
                                "title": "Custom adapter type",
                                "type": "string"
                            },
                            "mac_address": {
                                "minimum": 1,
                                "pattern": "^([0-9a-fA-F]{2}[:]){5}([0-9a-fA-F]{2})$",
                                "title": "Custom MAC address",
                                "type": "string"
                            },
                            "port_name": {
                                "minimum": 1,
                                "title": "Custom port name",
                                "type": "string"
                            }
                        },
                        "required": [
                            "adapter_number"
                        ],
                        "type": "object"
                    },
                    "title": "Custom adapters",
                    "type": "array"
                },
                "hda_disk_interface": {
                    "enum": [
                        "ide",
                        "scsi",
                        "sd",
                        "mtd",
                        "floppy",
                        "pflash",
                        "virtio",
                        "sata"
                    ],
                    "title": "Disk interface for the installed hda_disk_image"
                },
                "hdb_disk_interface": {
                    "enum": [
                        "ide",
                        "scsi",
                        "sd",
                        "mtd",
                        "floppy",
                        "pflash",
                        "virtio",
                        "sata"
                    ],
                    "title": "Disk interface for the installed hdb_disk_image"
                },
                "hdc_disk_interface": {
                    "enum": [
                        "ide",
                        "scsi",
                        "sd",
                        "mtd",
                        "floppy",
                        "pflash",
                        "virtio",
                        "sata"
                    ],
                    "title": "Disk interface for the installed hdc_disk_image"
                },
                "hdd_disk_interface": {
                    "enum": [
                        "ide",
                        "scsi",
                        "sd",
                        "mtd",
                        "floppy",
                        "pflash",
                        "virtio",
                        "sata"
                    ],
                    "title": "Disk interface for the installed hdd_disk_image"
                },
                "kernel_command_line": {
                    "title": "Command line parameters send to the kernel",
                    "type": "string"
                },
                "kvm": {
                    "enum": [
                        "require",
                        "allow",
                        "disable"
                    ],
                    "title": "KVM requirements"
                },
                "options": {
                    "title": "Optional additional qemu command line options",
                    "type": "string"
                },
                "process_priority": {
                    "enum": [
                        "realtime",
                        "very high",
                        "high",
                        "normal",
                        "low",
                        "very low",
                        "null"
                    ],
                    "title": "Process priority for QEMU"
                },
                "ram": {
                    "title": "Ram allocated to the appliance (MB)",
                    "type": "integer"
                }
            },
            "required": [
                "adapter_type",
                "adapters",
                "ram",
                "arch",
                "console_type",
                "kvm"
            ],
            "title": "Qemu specific options",
            "type": "object"
        },
        "registry_version": {
            "enum": [
                1,
                2,
                3,
                4,
                5,
                6
            ],
            "title": "Version of the registry compatible with this appliance"
        },
        "status": {
            "enum": [
                "stable",
                "experimental",
                "broken"
            ],
            "title": "Document if the appliance is working or not"
        },
        "symbol": {
            "title": "An optional symbol for the appliance",
            "type": "string"
        },
        "usage": {
            "title": "How to use the appliance",
            "type": "string"
        },
        "vendor_name": {
            "title": "Name of the vendor",
            "type": "string"
        },
        "vendor_url": {
            "_format": "uri",
            "title": "Website of the vendor",
            "type": "string"
        },
        "versions": {
            "items": {
                "properties": {
                    "idlepc": {
                        "pattern": "^0x[0-9a-f]{8}",
                        "type": "string"
                    },
                    "images": {
                        "properties": {
                            "bios_image": {
                                "title": "Bios image",
                                "type": "string"
                            },
                            "cdrom_image": {
                                "title": "cdrom image",
                                "type": "string"
                            },
                            "hda_disk_image": {
                                "title": "Hda disk image",
                                "type": "string"
                            },
                            "hdb_disk_image": {
                                "title": "Hdc disk image",
                                "type": "string"
                            },
                            "hdc_disk_image": {
                                "title": "Hdd disk image",
                                "type": "string"
                            },
                            "hdd_disk_image": {
                                "title": "Hdd diskimage",
                                "type": "string"
                            },
                            "image": {
                                "title": "OS image",
                                "type": "string"
                            },
                            "initrd": {
                                "title": "Initrd disk image",
                                "type": "string"
                            },
                            "kernel_image": {
                                "title": "Kernel image",
                                "type": "string"
                            }
                        },
                        "title": "Images used for this version",
                        "type": "object"
                    },
                    "name": {
                        "title": "Name of the version",
                        "type": "string"
                    }
                },
                "required": [
                    "name"
                ],
                "title": "A version of the appliance",
                "type": "object"
            },
            "title": "Versions of the appliance",
            "type": "array"
        }
    },
    "required": [
        "name",
        "category",
        "description",
        "vendor_name",
        "vendor_url",
        "product_name",
        "registry_version",
        "status",
        "maintainer",
        "maintainer_email"
    ],
    "title": "JSON schema validating a GNS3 appliance",
    "type": "object"
}