{
    "title": "Controller Reference Descriptor",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "javaType": "com.sos.inventory.model.descriptor.agent.ControllerRefDescriptor",
    "description": "JS7 Controller Reference Descriptor Schema",
    "type": "object",
    "required": [
        "controllerId",
        "members"
    ],
    "additionalProperties": false,
    "properties": {
        "controllerId": {
            "type": "string"
        },
        "members": {
            "type": "array",
            "minItems": 1,
            "items": {
                "javaType": "com.sos.inventory.model.descriptor.agent.AgentDescriptor",
                "description": "JS7 Agent Descriptor Schema",
                "type": "object",
                "required": [
                    "agentId",
                    "media",
                    "installation"
                ],
                "additionalProperties": false,
                "properties": {
                    "agentId": {
                        "type": "string"
                    },
                    "target": {
                        "javaType": "com.sos.inventory.model.descriptor.common.Target",
                        "description": "JS7 Deployment Descriptor Target Schema",
                        "type": "object",
                        "required": [
                            "connection",
                            "authentication",
                            "packageLocation"
                        ],
                        "additionalProperties": false,
                        "properties": {
                            "connection": {
                                "javaType": "com.sos.inventory.model.descriptor.common.Connection",
                                "description": "JS7 Deployment Descriptor Connection Schema",
                                "type": "object",
                                "required": [
                                    "host"
                                ],
                                "additionalProperties": false,
                                "properties": {
                                    "host": {
                                        "type": "string"
                                    },
                                    "port": {
                                        "type": "integer"
                                    }
                                }
                            },
                            "authentication": {
                                "javaType": "com.sos.inventory.model.descriptor.common.Authentication",
                                "description": "JS7 Deployment Descriptor Authentication Schema",
                                "type": "object",
                                "required": [
                                    "method",
                                    "user"
                                ],
                                "additionalProperties": false,
                                "properties": {
                                    "method": {
                                        "type": "string",
                                        "enum": [
                                            "publickey"
                                        ]
                                    },
                                    "user": {
                                        "type": "string"
                                    },
                                    "keyFile": {
                                        "type": "string"
                                    }
                                }
                            },
                            "packageLocation": {
                                "type": "string"
                            },
                            "execPre": {
                                "type": "string"
                            },
                            "execPost": {
                                "type": "string"
                            },
                            "makeService": {
                                "type": "boolean"
                            },
                            "forceSudo": {
                                "type": "boolean"
                            },
                            "serviceName": {
                                "type": "string"
                            },
                            "serviceDir": {
                                "type": "string"
                            }
                        }
                    },
                    "media": {
                        "javaType": "com.sos.inventory.model.descriptor.common.Media",
                        "description": "JS7 Deployment Descriptor Media Schema",
                        "type": "object",
                        "required": [
                            "release",
                            "tarball"
                        ],
                        "additionalProperties": false,
                        "properties": {
                            "release": {
                                "type": "string"
                            },
                            "tarball": {
                                "type": "string"
                            }
                        }
                    },
                    "installation": {
                        "javaType": "com.sos.inventory.model.descriptor.common.Installation",
                        "description": "JS7 Deployment Descriptor Installation Schema",
                        "type": "object",
                        "anyOf": [
                            {
                                "required": [
                                    "httpPort",
                                    "home",
                                    "data"
                                ]
                            },
                            {
                                "required": [
                                    "httpsPort",
                                    "home",
                                    "data"
                                ]
                            }
                        ],
                        "additionalProperties": false,
                        "properties": {
                            "home": {
                                "type": "string"
                            },
                            "data": {
                                "type": "string"
                            },
                            "homeOwner": {
                                "type": "string"
                            },
                            "dataOwner": {
                                "type": "string"
                            },
                            "runUser": {
                                "type": "string"
                            },
                            "httpPort": {
                                "type": "string"
                            },
                            "httpsPort": {
                                "type": "string"
                            },
                            "javaHome": {
                                "type": "string"
                            },
                            "javaOptions": {
                                "type": "string"
                            }
                        }
                    },
                    "configuration": {
                        "type": "object",
                        "javaType": "com.sos.inventory.model.descriptor.agent.Configuration",
                        "additionalProperties": false,
                        "properties": {
                            "certificates": {
                                "javaType": "com.sos.inventory.model.descriptor.common.Certificates",
                                "description": "JS7 Deployment Descriptor Certificates Schema",
                                "type": "object",
                                "required": [
                                    "keyStore",
                                    "keyStorePassword",
                                    "keyPassword",
                                    "trustStore",
                                    "trustStorePassword"
                                ],
                                "additionalProperties": false,
                                "properties": {
                                    "keyStore": {
                                        "type": "string"
                                    },
                                    "keyStorePassword": {
                                        "type": "string"
                                    },
                                    "keyPassword": {
                                        "type": "string"
                                    },
                                    "keyAlias": {
                                        "type": "string"
                                    },
                                    "trustStore": {
                                        "type": "string"
                                    },
                                    "trustStorePassword": {
                                        "type": "string"
                                    }
                                }
                            },
                            "templates": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}