{
    "title": "jobscheduler (volatile part)",
    "id": "schemas/jobscheduler/jobscheduler_v",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "javaType": "com.sos.joc.model.jobscheduler.JobSchedulerV",
    "type": "object",
    "oneOf": [
        {
            "description": "if state.text=unreachable",
            "required": [
                "jobschedulerId",
                "host",
                "port",
                "state"
            ]
        },
        {
            "required": [
                "surveyDate",
                "jobschedulerId",
                "host",
                "port",
                "state",
                "startedAt"
            ]
        }
    ],
    "properties": {
        "surveyDate": {
            "id": "schemas/common/surveyDate_v",
            "description": "Current date of the JobScheduler Master/Agent. Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ",
            "type": "string",
            "format": "date-time"
        },
        "jobschedulerId": {
            "type": "string"
        },
        "host": {
            "type": "string"
        },
        "port": {
            "id": "schemas/common/port",
            "type": "integer",
            "minimum": 0,
            "maximum": 65535
        },
        "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"
                    ]
                }
            }
        },
        "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"
        },
        "error": {
            "id": "schemas/common/error",
            "javaType": "com.sos.joc.model.common.Err",
            "type": "object",
            "required": [
                "code",
                "message"
            ],
            "properties": {
                "code": {
                    "type": "string"
                },
                "message": {
                    "type": "string"
                }
            }
        }
    }
}