{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "properties": {
        "id": {
            "description": "name of the class associated to the smart deploy spec",
            "type": "string"
        },
        "specification": {
            "description": "declarative specification",
            "type": "string"
        },
        "DC": {
            "description": "list of already available DC",
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "name": {
                        "description": "name of the available DC",
                        "type": "string"
                    },
                    "additionalProperties": {
                        "description": "provided resources by the DC",
                        "type": "integer"
                    }
                }
            }
        },
        "obj": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "provides": {
                        "type": "array",
                        "description": "Provide (multi)ports",
                        "items": {
                            "type": "object",
                            "properties": {
                                "ports": {
                                    "type": "array",
                                    "description": "List of the provide components",
                                    "items": {
                                        "type": "string"
                                    }
                                },
                                "num": {
                                    "type": "integer",
                                    "description": "Number associated to a provide port (-1 for infinite)"
                                }
                            },
                            "required": [
                                "ports",
                                "num"
                            ]
                        }
                    },
                    "interface": {
                        "description": "interface of the obj",
                        "type": "string"
                    },
                    "methods": {
                        "description": "list of methods to add and remove preferences",
                        "items": {
                            "properties": {
                                "add": {
                                    "description": "method to add the reference",
                                    "properties": {
                                        "name": {
                                            "description": "method name",
                                            "type": "string"
                                        },
                                        "param_type": {
                                            "description": "type of the object added",
                                            "type": "string"
                                        }
                                    },
                                    "type": "object",
                                    "required": [
                                        "name",
                                        "param_type"
                                    ]
                                },
                                "remove": {
                                    "description": "method to remove the reference",
                                    "properties": {
                                        "name": {
                                            "description": "method name",
                                            "type": "string"
                                        },
                                        "param_type": {
                                            "description": "type of the object added (may be absent)",
                                            "type": "string"
                                        }
                                    },
                                    "type": "object",
                                    "required": [
                                        "name"
                                    ]
                                }
                            },
                            "type": "object",
                            "required": [
                                "add"
                            ]
                        },
                        "type": "array"
                    }
                },
                "required": [
                    "name",
                    "provides",
                    "interface"
                ]
            }
        },
        "cloud_provider_DC_availability": {
            "description": "optional - map to define the number of DC provided by the cloud provider if they differ from the default value",
            "type": "object",
            "properties": {
                "additionalProperties": {
                    "description": "DC type name",
                    "type": "integer"
                }
            }
        },
        "add_method_priorities": {
            "description": "optional - define the priorities to call the add methods",
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "class": {
                        "description": "may be the class name or the name of an initial object",
                        "type": "string"
                    },
                    "method": {
                        "type": "string"
                    }
                },
                "required": [
                    "class",
                    "method"
                ]
            }
        },
        "remove_method_priorities": {
            "description": "optional - define the priorities to call the remove methods",
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "class": {
                        "description": "may be the class name or the name of an initial object",
                        "type": "string"
                    },
                    "method": {
                        "type": "string"
                    }
                },
                "required": [
                    "class",
                    "method"
                ]
            }
        }
    },
    "required": [
        "id",
        "specification",
        "DC",
        "obj"
    ]
}