{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "definitions": {
        "diskDevice": {
            "additionalProperties": false,
            "properties": {
                "device": {
                    "pattern": "^/dev/[^/]+(/[^/]+)*$",
                    "type": "string"
                },
                "type": {
                    "enum": [
                        "disk"
                    ]
                }
            },
            "required": [
                "type",
                "device"
            ]
        },
        "diskUUID": {
            "additionalProperties": false,
            "properties": {
                "label": {
                    "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}$",
                    "type": "string"
                },
                "type": {
                    "enum": [
                        "disk"
                    ]
                }
            },
            "required": [
                "type",
                "label"
            ]
        },
        "nfs": {
            "additionalProperties": false,
            "properties": {
                "remotePath": {
                    "pattern": "^(/[^/]+)+$",
                    "type": "string"
                },
                "server": {
                    "oneOf": [
                        {
                            "format": "hostname"
                        },
                        {
                            "format": "ipv4"
                        },
                        {
                            "format": "ipv6"
                        }
                    ],
                    "type": "string"
                },
                "type": {
                    "enum": [
                        "nfs"
                    ]
                }
            },
            "required": [
                "type",
                "server",
                "remotePath"
            ],
            "type": "object"
        },
        "tmpfs": {
            "additionalProperties": false,
            "properties": {
                "sizeInMB": {
                    "maximum": 512,
                    "minimum": 16,
                    "type": "integer"
                },
                "type": {
                    "enum": [
                        "tmpfs"
                    ]
                }
            },
            "required": [
                "type",
                "sizeInMB"
            ]
        }
    },
    "description": "schema for an fstab entry",
    "id": "http://some.site.somewhere/entry-schema#",
    "properties": {
        "fstype": {
            "enum": [
                "ext3",
                "ext4",
                "btrfs"
            ]
        },
        "options": {
            "items": {
                "type": "string"
            },
            "minItems": 1,
            "type": "array",
            "_uniqueItems": true
        },
        "readonly": {
            "type": "boolean"
        },
        "storage": {
            "oneOf": [
                {
                    "$ref": "#/definitions/diskDevice"
                },
                {
                    "$ref": "#/definitions/diskUUID"
                },
                {
                    "$ref": "#/definitions/nfs"
                },
                {
                    "$ref": "#/definitions/tmpfs"
                }
            ],
            "type": "object"
        }
    },
    "required": [
        "storage"
    ],
    "type": "object"
}