{
    "title": "jobsFilter",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "javaType": "com.sos.joc.model.job.JobsFilter",
    "type": "object",
    "required": [
        "controllerId"
    ],
    "properties": {
        "controllerId": {
            "type": "string"
        },
        "jobs": {
            "type": "array",
            "items": {
                "javaType": "com.sos.joc.model.job.JobPath",
                "type": "object",
                "required": [
                    "workflowPath"
                ],
                "properties": {
                    "workflowPath": {
                        "description": "absolute path of a JobScheduler object.",
                        "type": "string",
                        "pattern": "^(/|(/[^/\\<>?:\"|*]+)+)$",
                        "maxLength": 255,
                        "minLength": 1
                    },
                    "job": {
                        "description": "if job undefined or empty then all jobs of specified workflow are requested",
                        "type": "string"
                    }
                }
            }
        },
        "excludeJobs": {
            "type": "array",
            "items": {
                "javaType": "com.sos.joc.model.job.JobPath",
                "type": "object",
                "required": [
                    "workflowPath"
                ],
                "properties": {
                    "workflowPath": {
                        "description": "absolute path of a JobScheduler object.",
                        "type": "string",
                        "pattern": "^(/|(/[^/\\<>?:\"|*]+)+)$",
                        "maxLength": 255,
                        "minLength": 1
                    },
                    "job": {
                        "description": "if job undefined or empty then all jobs of specified workflow are requested",
                        "type": "string"
                    }
                }
            }
        },
        "orders": {
            "type": "array",
            "items": {
                "javaType": "com.sos.joc.model.job.OrderPath",
                "type": "object",
                "required": [
                    "workflow"
                ],
                "properties": {
                    "workflowPath": {
                        "description": "absolute path of a JobScheduler object.",
                        "type": "string",
                        "pattern": "^(/|(/[^/\\<>?:\"|*]+)+)$",
                        "maxLength": 255,
                        "minLength": 1
                    },
                    "orderId": {
                        "description": "if orderId undefined or empty then all orders of specified job chain are requested",
                        "type": "string"
                    },
                    "position": {
                        "type": "string"
                    }
                }
            }
        },
        "compact": {
            "description": "controls if the object's data is compact or detailed",
            "type": "boolean",
            "default": false
        },
        "compactView": {
            "type": "boolean",
            "default": false
        },
        "regex": {
            "description": "regular expression to filter JobScheduler objects by matching the path",
            "type": "string"
        },
        "dateFrom": {
            "type": "string",
            "pattern": "^(0|([0-9-]+[smhdwMy])+|\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(,\\d{1,3})?)(Z|[+-]\\d{2}(:?\\d{2})?)?$"
        },
        "dateTo": {
            "type": "string",
            "pattern": "^(0|([0-9-]+[smhdwMy])+|\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(,\\d{1,3})?)(Z|[+-]\\d{2}(:?\\d{2})?)?$"
        },
        "timeZone": {
            "description": "see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones",
            "type": "string"
        },
        "folders": {
            "type": "array",
            "items": {
                "javaType": "com.sos.joc.model.common.Folder",
                "type": "object",
                "required": [
                    "folder"
                ],
                "properties": {
                    "folder": {
                        "description": "absolute path of a JobScheduler object.",
                        "type": "string",
                        "pattern": "^(/|(/[^/\\<>?:\"|*]+)+)$",
                        "maxLength": 255,
                        "minLength": 1
                    },
                    "recursive": {
                        "type": "boolean",
                        "default": true
                    }
                }
            }
        },
        "limit": {
            "description": "only for db history urls to restrict the number of responsed records; -1=unlimited",
            "type": "integer",
            "default": 10000
        },
        "historyStates": {
            "type": "array",
            "items": {
                "javaType": "com.sos.joc.model.common.HistoryStateText",
                "type": "string",
                "enum": [
                    "SUCCESSFUL",
                    "INCOMPLETE",
                    "FAILED"
                ]
            }
        },
        "criticalities": {
            "type": "array",
            "items": {
                "javaType": "com.sos.joc.model.job.JobCriticalities",
                "type": "string",
                "description": "Criticality of a job",
                "enum": [
                    "NORMAL",
                    "MINOR",
                    "MAJOR"
                ]
            }
        },
        "taskIds": {
            "type": "array",
            "items": {
                "type": "number",
                "format": "utc-millisec",
                "minimum": 0
            }
        },
        "historyIds": {
            "type": "array",
            "items": {
                "description": "Only relevant for order jobs; cause=order resp.",
                "javaType": "com.sos.joc.model.job.TaskIdOfOrder",
                "type": "object",
                "required": [
                    "historyId",
                    "position"
                ],
                "properties": {
                    "historyId": {
                        "type": "number",
                        "format": "utc-millisec",
                        "minimum": 0
                    },
                    "position": {
                        "type": "string"
                    }
                }
            }
        }
    }
}