{
    "title": "agents with delivery date (volatile part)",
    "id": "schemas/jobscheduler/agents_v",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "javaType": "com.sos.joc.model.jobscheduler.AgentsV",
    "type": "object",
    "required": [
        "deliveryDate",
        "agents"
    ],
    "properties": {
        "deliveryDate": {
            "id": "schemas/common/deliveryDate",
            "description": "Current date of the JOC server/REST service. Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ",
            "type": "string",
            "format": "date-time"
        },
        "agents": {
            "type": "array",
            "items": {
                "id": "schemas/jobscheduler/agentOfCluster_p",
                "javaType": "com.sos.joc.model.jobscheduler.AgentOfCluster",
                "type": "object",
                "required": [
                    "surveyDate",
                    "version",
                    "host",
                    "url",
                    "os",
                    "state",
                    "startedAt"
                ],
                "properties": {
                    "surveyDate": {
                        "id": "schemas/common/surveyDate_p",
                        "description": "Date of the inventory data. Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ",
                        "type": "string",
                        "format": "date-time"
                    },
                    "version": {
                        "type": "string"
                    },
                    "host": {
                        "type": "string"
                    },
                    "url": {
                        "description": "url can be different against host/port if agent behind a proxy",
                        "type": "string",
                        "pattern": "https?://.+"
                    },
                    "os": {
                        "id": "schemas/jobscheduler/os",
                        "javaType": "com.sos.joc.model.jobscheduler.OperatingSystem",
                        "type": "object",
                        "required": [
                            "name",
                            "architecture",
                            "distribution"
                        ],
                        "properties": {
                            "name": {
                                "description": "Windows, Linux, AIX, Solaris, other",
                                "type": "string"
                            },
                            "architecture": {
                                "type": "string"
                            },
                            "distribution": {
                                "description": "e.g. Windows 2012, CentOS Linux release 7.2.1511 (Core)",
                                "type": "string"
                            }
                        }
                    },
                    "state": {
                        "id": "schemas/jobscheduler/state",
                        "javaType": "com.sos.joc.model.jobscheduler.JobSchedulerState",
                        "type": "object",
                        "required": [
                            "severity",
                            "_text"
                        ],
                        "properties": {
                            "severity": {
                                "description": "0=running/starting, 1=paused, 3=waiting_for_activation/terminating, 2=waiting_for_database/dead/unreachable",
                                "type": "integer"
                            },
                            "_text": {
                                "id": "schemas/jobscheduler/stateText",
                                "javaType": "com.sos.joc.model.jobscheduler.JobSchedulerStateText",
                                "type": "string",
                                "enum": [
                                    "STARTING",
                                    "RUNNING",
                                    "PAUSED",
                                    "WAITING_FOR_ACTIVATION",
                                    "TERMINATING",
                                    "WAITING_FOR_DATABASE",
                                    "DEAD",
                                    "UNREACHABLE",
                                    "UNKNOWN_AGENT"
                                ]
                            }
                        }
                    },
                    "startedAt": {
                        "id": "schemas/common/timestamp",
                        "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
                        "type": "string",
                        "format": "date-time"
                    },
                    "runningTasks": {
                        "id": "schemas/common/nonNegativeInteger",
                        "type": "integer",
                        "minimum": 0
                    }
                }
            }
        }
    }
}