{
    "title": "history collection of tasks",
    "id": "schemas/job/history",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "one item per started task",
    "javaType": "com.sos.joc.model.job.TaskHistory",
    "type": "object",
    "required": [
        "deliveryDate",
        "history"
    ],
    "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"
        },
        "history": {
            "type": "array",
            "items": {
                "id": "schemas/job/historyItem",
                "javaType": "com.sos.joc.model.job.TaskHistoryItem",
                "type": "object",
                "required": [
                    "surveyDate",
                    "job",
                    "startTime",
                    "state",
                    "taskId"
                ],
                "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"
                    },
                    "job": {
                        "type": "string"
                    },
                    "startTime": {
                        "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"
                    },
                    "endTime": {
                        "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"
                    },
                    "state": {
                        "id": "schemas/common/historyState",
                        "javaType": "com.sos.joc.model.common.HistoryState",
                        "type": "object",
                        "required": [
                            "severity",
                            "_text"
                        ],
                        "properties": {
                            "severity": {
                                "description": "0=successful, 1=incomplete, 2=failed with a green/yellow/red representation",
                                "type": "integer"
                            },
                            "_text": {
                                "id": "schemas/common/historyStateText",
                                "javaType": "com.sos.joc.model.common.HistoryStateText",
                                "type": "string",
                                "enum": [
                                    "SUCCESSFUL",
                                    "INCOMPLETE",
                                    "FAILED"
                                ]
                            }
                        }
                    },
                    "taskId": {
                        "type": "string"
                    },
                    "clusterMember": {
                        "type": "string"
                    },
                    "steps": {
                        "id": "schemas/common/nonNegativeInteger",
                        "type": "integer",
                        "minimum": 0
                    },
                    "exitCode": {
                        "id": "schemas/common/nonNegativeInteger",
                        "type": "integer",
                        "minimum": 0
                    },
                    "error": {
                        "id": "schemas/common/error",
                        "javaType": "com.sos.joc.model.common.Err",
                        "type": "object",
                        "required": [
                            "code",
                            "message"
                        ],
                        "properties": {
                            "code": {
                                "type": "string"
                            },
                            "message": {
                                "type": "string"
                            }
                        }
                    },
                    "agent": {
                        "description": "agent url",
                        "type": "string"
                    }
                }
            }
        }
    }
}