{
    "title": "agents",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "javaType": "com.sos.joc.model.agent.AgentsV",
    "type": "object",
    "required": [
        "deliveryDate"
    ],
    "properties": {
        "deliveryDate": {
            "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
            "type": "string",
            "format": "date-time"
        },
        "surveyDate": {
            "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
            "type": "string",
            "format": "date-time"
        },
        "agents": {
            "type": "array",
            "items": {
                "javaType": "com.sos.joc.model.agent.AgentV",
                "type": "object",
                "required": [
                    "agentId",
                    "agentName",
                    "url"
                ],
                "properties": {
                    "controllerId": {
                        "type": "string",
                        "pattern": "^[^/\\<>?:\"|*]*$",
                        "maxLength": 100
                    },
                    "agentId": {
                        "type": "string",
                        "pattern": "^[^<>]*$",
                        "maxLength": 255
                    },
                    "agentName": {
                        "type": "string",
                        "pattern": "^[^<>]*$",
                        "maxLength": 255
                    },
                    "state": {
                        "javaType": "com.sos.joc.model.agent.AgentState",
                        "type": "object",
                        "required": [
                            "severity",
                            "_text"
                        ],
                        "properties": {
                            "severity": {
                                "description": "0=COUPLED, 1=DECOUPLED, 2=COUPLINGFAILED, 3=UNKNOWN",
                                "type": "integer"
                            },
                            "_text": {
                                "javaType": "com.sos.joc.model.agent.AgentStateText",
                                "type": "string",
                                "enum": [
                                    "COUPLED",
                                    "DECOUPLED",
                                    "COUPLINGFAILED",
                                    "UNKNOWN"
                                ]
                            }
                        }
                    },
                    "errorMessage": {
                        "description": "if state == couplngFailed or unknown",
                        "type": "string"
                    },
                    "orders": {
                        "type": "array",
                        "items": {
                            "javaType": "com.sos.joc.model.order.OrderV",
                            "type": "object",
                            "required": [
                                "orderId",
                                "workflowId",
                                "state"
                            ],
                            "properties": {
                                "deliveryDate": {
                                    "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
                                    "type": "string",
                                    "format": "date-time"
                                },
                                "surveyDate": {
                                    "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
                                    "type": "string",
                                    "format": "date-time"
                                },
                                "orderId": {
                                    "type": "string",
                                    "pattern": "^[^<>]*$",
                                    "maxLength": 255
                                },
                                "arguments": {
                                    "description": "a map for arbitrary key-value pairs",
                                    "javaType": "com.sos.jobscheduler.model.common.Variables",
                                    "type": "object",
                                    "returnCode": {
                                        "type": "integer"
                                    },
                                    "additionalProperties": {
                                        "type": "string"
                                    }
                                },
                                "workflowId": {
                                    "javaType": "com.sos.jobscheduler.model.workflow.WorkflowId",
                                    "type": "object",
                                    "required": [
                                        "path"
                                    ],
                                    "properties": {
                                        "path": {
                                            "description": "absolute path of a JobScheduler object.",
                                            "type": "string",
                                            "pattern": "^(/|(/[^/\\<>?:\"|*]+)+)$",
                                            "maxLength": 255,
                                            "minLength": 1
                                        },
                                        "versionId": {
                                            "type": "string",
                                            "pattern": "^[^<>]*$",
                                            "maxLength": 255
                                        }
                                    },
                                    "additionalProperties": false
                                },
                                "state": {
                                    "javaType": "com.sos.joc.model.order.OrderState",
                                    "type": "object",
                                    "required": [
                                        "severity",
                                        "_text"
                                    ],
                                    "properties": {
                                        "severity": {
                                            "type": "integer"
                                        },
                                        "_text": {
                                            "javaType": "com.sos.joc.model.order.OrderStateText",
                                            "type": "string",
                                            "enum": [
                                                "PLANNED",
                                                "PENDING",
                                                "RUNNING",
                                                "INPROGRESS",
                                                "SUSPENDED",
                                                "FAILED",
                                                "WAITING",
                                                "BLOCKED",
                                                "CANCELLED",
                                                "FINISHED",
                                                "RESUMED",
                                                "SUSPENDMARKED",
                                                "RESUMEMARKED",
                                                "BROKEN",
                                                "UNKNOWN"
                                            ]
                                        }
                                    }
                                },
                                "attachedState": {
                                    "javaType": "com.sos.jobscheduler.model.order.OrderAttachedState",
                                    "type": "object",
                                    "properties": {
                                        "TYPE": {
                                            "description": "Attaching, Attached, ...",
                                            "type": "string"
                                        },
                                        "agentName": {
                                            "type": "string"
                                        }
                                    },
                                    "additionalProperties": false
                                },
                                "position": {
                                    "description": "Actually, each even item is a string, each odd item is an integer",
                                    "type": "array",
                                    "items": {
                                        "type": "null"
                                    }
                                },
                                "scheduledFor": {
                                    "type": "number",
                                    "format": "utc-millisec",
                                    "minimum": 0
                                },
                                "lastOutcome": {
                                    "javaType": "com.sos.jobscheduler.model.common.Outcome",
                                    "type": "object",
                                    "properties": {
                                        "required": [
                                            "TYPE",
                                            "returnCode"
                                        ],
                                        "TYPE": {
                                            "javaType": "com.sos.jobscheduler.model.common.OutcomeType",
                                            "type": "string",
                                            "enum": [
                                                "Succeeded",
                                                "Failed",
                                                "Disrupted",
                                                "Cancelled"
                                            ],
                                            "javaEnumNames": [
                                                "Succeeded",
                                                "Failed",
                                                "Disrupted",
                                                "Cancelled"
                                            ]
                                        },
                                        "namedValues": {
                                            "description": "a map for arbitrary key-value pairs",
                                            "javaType": "com.sos.jobscheduler.model.common.Variables",
                                            "type": "object",
                                            "returnCode": {
                                                "type": "integer"
                                            },
                                            "additionalProperties": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "additionalProperties": false
                                },
                                "historicOutcome": {
                                    "description": "only for compact parameter is false",
                                    "type": "array",
                                    "items": {
                                        "type": "object",
                                        "javaType": "com.sos.jobscheduler.model.workflow.HistoricOutcome",
                                        "properties": {
                                            "position": {
                                                "description": "Actually, each even item is a string, each odd item is an integer",
                                                "type": "array",
                                                "items": {
                                                    "type": "null"
                                                }
                                            },
                                            "outcome": {
                                                "javaType": "com.sos.jobscheduler.model.common.Outcome",
                                                "type": "object",
                                                "properties": {
                                                    "required": [
                                                        "TYPE",
                                                        "returnCode"
                                                    ],
                                                    "TYPE": {
                                                        "javaType": "com.sos.jobscheduler.model.common.OutcomeType",
                                                        "type": "string",
                                                        "enum": [
                                                            "Succeeded",
                                                            "Failed",
                                                            "Disrupted",
                                                            "Cancelled"
                                                        ],
                                                        "javaEnumNames": [
                                                            "Succeeded",
                                                            "Failed",
                                                            "Disrupted",
                                                            "Cancelled"
                                                        ]
                                                    },
                                                    "namedValues": {
                                                        "description": "a map for arbitrary key-value pairs",
                                                        "javaType": "com.sos.jobscheduler.model.common.Variables",
                                                        "type": "object",
                                                        "returnCode": {
                                                            "type": "integer"
                                                        },
                                                        "additionalProperties": {
                                                            "type": "string"
                                                        }
                                                    }
                                                },
                                                "additionalProperties": false
                                            }
                                        },
                                        "additionalProperties": false
                                    }
                                }
                            }
                        }
                    },
                    "runningTasks": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "url": {
                        "type": "string",
                        "pattern": "^[^<>]*$",
                        "maxLength": 255
                    },
                    "isClusterWatcher": {
                        "type": "boolean",
                        "default": false
                    }
                }
            }
        }
    },
    "additionalProperties": false
}