{
    "definitions": {
        "fileservertype": {
            "links": [
                {
                    "href": "/fileservers",
                    "method": "GET",
                    "rel": "list-all",
                    "targetSchema": {
                        "items": {
                            "$ref": "#/definitions/fileservertype"
                        },
                        "type": "array"
                    },
                    "title": "List existing file server types"
                }
            ],
            "type": "string"
        },
        "mount": {
            "definitions": {
                "id": {
                    "type": "string"
                },
                "source": {
                    "type": "string"
                },
                "target": {
                    "type": "string"
                }
            },
            "links": [
                {
                    "href": "/servers/{(#/definitions/server/definitions/port)}/mounts",
                    "method": "GET",
                    "rel": "list-all",
                    "targetSchema": {
                        "items": {
                            "$ref": "#/definitions/mount"
                        },
                        "type": "array"
                    },
                    "title": "List existing mounts for a server"
                },
                {
                    "href": "/servers/{(#/definitions/server/definitions/port)}/mounts",
                    "method": "POST",
                    "rel": "create",
                    "schema": {
                        "properties": {
                            "fs_params": {
                                "patternProperties": {
                                    ".+": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            },
                            "fs_type": {
                                "type": "string"
                            },
                            "source": {
                                "$ref": "#/definitions/mount/definitions/source"
                            },
                            "target": {
                                "$ref": "#/definitions/mount/definitions/target"
                            }
                        }
                    },
                    "targetSchema": {
                        "$ref": "#/definitions/mount"
                    },
                    "title": "Create a new mount on a server"
                },
                {
                    "href": "/servers/{(#/definitions/server/definitions/port)}/mounts",
                    "method": "DELETE",
                    "rel": "delete-all",
                    "targetSchema": {
                        "items": {
                            "$ref": "#/definitions/mount"
                        },
                        "type": "array"
                    },
                    "title": "Delete all existing mounts of a server"
                },
                {
                    "href": "/servers/{(#/definitions/server/definitions/port)}/mounts/{(#/definitions/mount/definitions/id)}",
                    "method": "GET",
                    "rel": "self",
                    "targetSchema": {
                        "$ref": "#/definitions/mount"
                    },
                    "title": "Info for a mount"
                },
                {
                    "href": "/servers/{(#/definitions/server/definitions/port)}/mounts/{(#/definitions/mount/definitions/id)}",
                    "method": "DELETE",
                    "rel": "delete",
                    "targetSchema": {
                        "$ref": "#/definitions/mount"
                    },
                    "title": "Delete an existing mount on a server"
                }
            ],
            "properties": {
                "id": {
                    "$ref": "#/definitions/mount/definitions/id"
                },
                "source": {
                    "$ref": "#/definitions/mount/definitions/source"
                },
                "target": {
                    "$ref": "#/definitions/mount/definitions/target"
                }
            },
            "type": "object"
        },
        "server": {
            "definitions": {
                "bindaddress": {
                    "type": "string"
                },
                "mounts": {
                    "items": {
                        "$ref": "#/definitions/mount"
                    },
                    "type": "array"
                },
                "port": {
                    "type": "integer"
                }
            },
            "links": [
                {
                    "href": "/servers",
                    "method": "GET",
                    "rel": "list-all",
                    "targetSchema": {
                        "items": {
                            "$ref": "#/definitions/server"
                        },
                        "type": "array"
                    },
                    "title": "List existing servers"
                },
                {
                    "href": "/servers",
                    "method": "POST",
                    "rel": "create-random",
                    "schema": {
                        "properties": {
                            "bind_address": {
                                "$ref": "#/definitions/server/definitions/bindaddress"
                            }
                        }
                    },
                    "targetSchema": {
                        "$ref": "#/definitions/server"
                    },
                    "title": "Create a new server listening on a random port"
                },
                {
                    "href": "/servers",
                    "method": "DELETE",
                    "rel": "delete-all",
                    "targetSchema": {
                        "items": {
                            "$ref": "#/definitions/server"
                        },
                        "type": "array"
                    },
                    "title": "Delete all existing servers and all their mounts"
                },
                {
                    "href": "/servers/{(#/definitions/server/definitions/port)}",
                    "method": "GET",
                    "rel": "self",
                    "targetSchema": {
                        "$ref": "#/definitions/server"
                    },
                    "title": "Info for a server"
                },
                {
                    "href": "/servers/{(#/definitions/server/definitions/port)}",
                    "method": "PUT",
                    "rel": "create",
                    "schema": {
                        "properties": {
                            "bind_address": {
                                "$ref": "#/definitions/server/definitions/bindaddress"
                            }
                        }
                    },
                    "targetSchema": {
                        "$ref": "#/definitions/server"
                    },
                    "title": "Create a new server listening on a specific port"
                },
                {
                    "href": "/servers/{(#/definitions/server/definitions/port)}",
                    "method": "DELETE",
                    "rel": "delete",
                    "targetSchema": {
                        "$ref": "#/definitions/server"
                    },
                    "title": "Delete an existing server and all its mounts"
                }
            ],
            "properties": {
                "bind_address": {
                    "$ref": "#/definitions/server/definitions/bindaddress"
                },
                "mounts": {
                    "$ref": "#/definitions/server/definitions/mounts"
                },
                "port": {
                    "$ref": "#/definitions/server/definitions/port"
                }
            },
            "type": "object"
        }
    },
    "properties": {
        "file-server-type": {
            "$ref": "#/definitions/fileservertype"
        },
        "mount": {
            "$ref": "#/definitions/mount"
        },
        "server": {
            "$ref": "#/definitions/server"
        }
    },
    "title": "Kraken API",
    "type": "object"
}