{
    "title": "components",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "javaType": "com.sos.joc.model.joc.Cockpits",
    "type": "object",
    "required": [
        "deliveryDate",
        "jocs"
    ],
    "properties": {
        "deliveryDate": {
            "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
            "type": "string",
            "format": "date-time"
        },
        "jocs": {
            "type": "array",
            "items": {
                "type": "object",
                "javaType": "com.sos.joc.model.joc.Cockpit",
                "required": [
                    "id",
                    "instanceId",
                    "memberId",
                    "version",
                    "current",
                    "connectionState",
                    "componentState",
                    "clusterNodeState",
                    "controllerConnectionStates"
                ],
                "properties": {
                    "id": {
                        "type": "number",
                        "format": "utc-millisec",
                        "minimum": 0
                    },
                    "instanceId": {
                        "type": "string",
                        "pattern": "^[^<>]*$",
                        "maxLength": 255,
                        "minLength": 1
                    },
                    "memberId": {
                        "type": "string",
                        "pattern": "^[^<>]*$",
                        "maxLength": 255,
                        "minLength": 1
                    },
                    "title": {
                        "type": "string"
                    },
                    "current": {
                        "description": "true if joc is that joc which sends this response",
                        "type": "boolean"
                    },
                    "host": {
                        "type": "string"
                    },
                    "url": {
                        "type": "string"
                    },
                    "startedAt": {
                        "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
                        "type": "string",
                        "format": "date-time"
                    },
                    "version": {
                        "type": "string"
                    },
                    "isApiServer": {
                        "type": "boolean",
                        "default": false
                    },
                    "connectionState": {
                        "javaType": "com.sos.joc.model.controller.ConnectionState",
                        "type": "object",
                        "required": [
                            "severity",
                            "_text"
                        ],
                        "properties": {
                            "severity": {
                                "description": "0=established, 1=unstable, 2=unreachable, 3=unknown",
                                "type": "integer"
                            },
                            "_text": {
                                "javaType": "com.sos.joc.model.controller.ConnectionStateText",
                                "type": "string",
                                "enum": [
                                    "established",
                                    "unstable",
                                    "unreachable",
                                    "unknown"
                                ],
                                "javaEnumNames": [
                                    "established",
                                    "unstable",
                                    "unreachable",
                                    "unknown"
                                ]
                            }
                        }
                    },
                    "componentState": {
                        "javaType": "com.sos.joc.model.controller.ComponentState",
                        "type": "object",
                        "required": [
                            "severity",
                            "_text"
                        ],
                        "properties": {
                            "severity": {
                                "description": "0=operational, 1=limited, 2=inoperable, 3=unknown",
                                "type": "integer"
                            },
                            "_text": {
                                "javaType": "com.sos.joc.model.controller.ComponentStateText",
                                "type": "string",
                                "enum": [
                                    "operational",
                                    "limited",
                                    "inoperable",
                                    "unknown"
                                ],
                                "javaEnumNames": [
                                    "operational",
                                    "limited",
                                    "inoperable",
                                    "unknown"
                                ]
                            }
                        }
                    },
                    "clusterNodeState": {
                        "javaType": "com.sos.joc.model.controller.ClusterNodeState",
                        "type": "object",
                        "required": [
                            "severity",
                            "_text"
                        ],
                        "description": "not relevant for JOC as API server only",
                        "properties": {
                            "severity": {
                                "description": "0=active, 1=inactive, 1=API-server, 3=unknown",
                                "type": "integer"
                            },
                            "_text": {
                                "javaType": "com.sos.joc.model.controller.ClusterNodeStateText",
                                "type": "string",
                                "enum": [
                                    "active",
                                    "inactive",
                                    "api-server",
                                    "unknown"
                                ],
                                "javaEnumNames": [
                                    "active",
                                    "inactive",
                                    "api-server",
                                    "unknown"
                                ]
                            }
                        }
                    },
                    "controllerConnectionStates": {
                        "description": "not relevant for JOC as API server only",
                        "type": "array",
                        "items": {
                            "type": "object",
                            "javaType": "com.sos.joc.model.joc.ControllerConnectionState",
                            "required": [
                                "role",
                                "state"
                            ],
                            "properties": {
                                "role": {
                                    "javaType": "com.sos.joc.model.controller.Role",
                                    "type": "string",
                                    "enum": [
                                        "STANDALONE",
                                        "PRIMARY",
                                        "BACKUP"
                                    ]
                                },
                                "state": {
                                    "javaType": "com.sos.joc.model.controller.ConnectionState",
                                    "type": "object",
                                    "required": [
                                        "severity",
                                        "_text"
                                    ],
                                    "properties": {
                                        "severity": {
                                            "description": "0=established, 1=unstable, 2=unreachable, 3=unknown",
                                            "type": "integer"
                                        },
                                        "_text": {
                                            "javaType": "com.sos.joc.model.controller.ConnectionStateText",
                                            "type": "string",
                                            "enum": [
                                                "established",
                                                "unstable",
                                                "unreachable",
                                                "unknown"
                                            ],
                                            "javaEnumNames": [
                                                "established",
                                                "unstable",
                                                "unreachable",
                                                "unknown"
                                            ]
                                        }
                                    }
                                }
                            },
                            "additionalProperties": false
                        }
                    },
                    "os": {
                        "javaType": "com.sos.joc.model.controller.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"
                            }
                        }
                    },
                    "securityLevel": {
                        "javaType": "com.sos.joc.model.common.JocSecurityLevel",
                        "type": "string",
                        "enum": [
                            "LOW",
                            "MEDIUM",
                            "HIGH"
                        ]
                    },
                    "lastHeartbeat": {
                        "description": "Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ or empty",
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "additionalProperties": false
            }
        }
    },
    "additionalProperties": false
}