{
    "$schema": "http://json-schema.org/draft-04/schema",
    "id": "http://schema.mesos/state-01/summary",
    "title": "Mesos State Summary",
    "type": "object",
    "properties": {
        "cluster": {
            "title": "Cluster name",
            "type": "string"
        },
        "frameworks": {
            "title": "Active frameworks",
            "description": "A list of all frameworks currently running.",
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "id": {
                        "title": "Framework ID",
                        "type": "string"
                    },
                    "name": {
                        "title": "Framework Name",
                        "type": "string"
                    },
                    "offered_resources": {
                        "title": "Resources offered to framework",
                        "type": "object",
                        "properties": {
                            "cpus": {
                                "type": "number"
                            },
                            "disk": {
                                "type": "number"
                            },
                            "mem": {
                                "type": "number"
                            }
                        },
                        "required": [
                            "cpus",
                            "disk",
                            "mem"
                        ]
                    },
                    "used_resources": {
                        "title": "Resources used by framework",
                        "type": "object",
                        "properties": {
                            "cpus": {
                                "type": "number"
                            },
                            "disk": {
                                "type": "number"
                            },
                            "mem": {
                                "type": "number"
                            }
                        },
                        "required": [
                            "cpus",
                            "disk",
                            "mem"
                        ]
                    },
                    "slave_ids": {
                        "title": "Slave IDs",
                        "description": "A list of slave ids in which this framework is running in.",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "TASK_STAGING": {
                        "title": "A sum of staging tasks.",
                        "type": "integer"
                    },
                    "TASK_STARTING": {
                        "title": "A sum of starting tasks.",
                        "type": "integer"
                    },
                    "TASK_RUNNING": {
                        "title": "A sum of running tasks.",
                        "type": "integer"
                    },
                    "TASK_FINISHED": {
                        "title": "A sum of finished tasks.",
                        "type": "integer"
                    },
                    "TASK_KILLED": {
                        "title": "A sum of killed tasks.",
                        "type": "integer"
                    },
                    "TASK_FAILED": {
                        "title": "A sum of failed tasks.",
                        "type": "integer"
                    },
                    "TASK_LOST": {
                        "title": "A sum of lost tasks.",
                        "type": "integer"
                    },
                    "TASK_ERROR": {
                        "title": "A sum of errored tasks.",
                        "type": "integer"
                    },
                    "webui_url": {
                        "title": "Framework's URL endpoint",
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "name",
                    "offered_resources",
                    "used_resources",
                    "slave_ids",
                    "webui_url",
                    "TASK_STAGING",
                    "TASK_STARTING",
                    "TASK_RUNNING",
                    "TASK_FINISHED",
                    "TASK_KILLED",
                    "TASK_FAILED",
                    "TASK_LOST",
                    "TASK_ERROR"
                ]
            }
        },
        "hostname": {
            "title": "Hostname of cluster",
            "type": "string"
        },
        "slaves": {
            "title": "Active slaves",
            "description": "A list of all slaves in the cluster.",
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "active": {
                        "title": "Wether the slave is active or not",
                        "type": "boolean"
                    },
                    "attributes": {
                        "title": "Any slave attributes",
                        "type": "object"
                    },
                    "hostname": {
                        "title": "Hostname of slave",
                        "type": "string"
                    },
                    "id": {
                        "title": "Slave ID",
                        "type": "string"
                    },
                    "resources": {
                        "title": "Resources available in slave",
                        "type": "object",
                        "properties": {
                            "cpus": {
                                "type": "number"
                            },
                            "disk": {
                                "type": "number"
                            },
                            "mem": {
                                "type": "number"
                            }
                        },
                        "required": [
                            "cpus",
                            "disk",
                            "mem"
                        ]
                    },
                    "used_resources": {
                        "title": "Used resources in slave",
                        "type": "object",
                        "properties": {
                            "cpus": {
                                "type": "number"
                            },
                            "disk": {
                                "type": "number"
                            },
                            "mem": {
                                "type": "number"
                            }
                        },
                        "required": [
                            "cpus",
                            "disk",
                            "mem"
                        ]
                    },
                    "TASK_STAGING": {
                        "title": "A sum of staging tasks.",
                        "type": "integer"
                    },
                    "TASK_STARTING": {
                        "title": "A sum of starting tasks.",
                        "type": "integer"
                    },
                    "TASK_RUNNING": {
                        "title": "A sum of running tasks.",
                        "type": "integer"
                    },
                    "TASK_FINISHED": {
                        "title": "A sum of finished tasks.",
                        "type": "integer"
                    },
                    "TASK_KILLED": {
                        "title": "A sum of killed tasks.",
                        "type": "integer"
                    },
                    "TASK_FAILED": {
                        "title": "A sum of failed tasks.",
                        "type": "integer"
                    },
                    "TASK_LOST": {
                        "title": "A sum of lost tasks.",
                        "type": "integer"
                    },
                    "TASK_ERROR": {
                        "title": "A sum of errored tasks.",
                        "type": "integer"
                    }
                },
                "required": [
                    "active",
                    "attributes",
                    "hostname",
                    "id",
                    "resources",
                    "used_resources",
                    "TASK_STAGING",
                    "TASK_STARTING",
                    "TASK_RUNNING",
                    "TASK_FINISHED",
                    "TASK_KILLED",
                    "TASK_FAILED",
                    "TASK_LOST",
                    "TASK_ERROR"
                ]
            }
        }
    },
    "required": [
        "cluster",
        "frameworks",
        "hostname",
        "slaves"
    ]
}