{
    "title": "jobscheduler agent (permanent part)",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "javaType": "com.sos.joc.model.jobscheduler.AgentP",
    "type": "object",
    "required": [
        "surveyDate",
        "version",
        "host",
        "url",
        "os",
        "state",
        "startedAt",
        "clusters"
    ],
    "properties": {
        "surveyDate": {
            "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": {
            "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": {
            "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": {
                    "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": {
            "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
            "type": "string",
            "format": "date-time"
        },
        "clusters": {
            "description": "Collection of process class' paths",
            "type": "array",
            "items": {
                "description": "absolute path based on live folder of a JobScheduler object.",
                "type": "string",
                "pattern": "^(/|(/[^/\\<>?:\"|*]+)+)$",
                "maxLength": 255
            }
        }
    }
}