{
    "_copyright": "Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "properties": {
        "id": {
            "type": "string",
            "default": null,
            "description": "Id of the cluster being added. This is a mandatory parameter."
        },
        "email": {
            "type": "string",
            "default": null,
            "description": "Email id to send status of reimage/provision."
        },
        "base_image_id": {
            "type": "string",
            "default": null,
            "description": "Id of base image OS that the cluster will be reimaged with."
        },
        "package_image_id": {
            "type": "string",
            "default": null,
            "description": "Id of Contrail package that the cluster will be provisioned with."
        },
        "parameters": {
            "type": "object",
            "properties": {
                "domain": {
                    "type": "string",
                    "default": null,
                    "description": "Domain that all the servers of the cluster will default to."
                },
                "subnet_mask": {
                    "type": "string",
                    "pattern": "^$|^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(/[0-9][0-9])?$",
                    "default": null,
                    "description": "Subnet mask that all the servers of the cluster will default to."
                },
                "gateway": {
                    "type": "string",
                    "pattern": "^$|^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(/[0-9][0-9])?$",
                    "default": null,
                    "description": "Gateway IP that all the servers of the cluster will default to."
                },
                "password": {
                    "type": "string",
                    "default": null,
                    "description": "Root Password that all the servers of the cluster will default to."
                },
                "provision": {
                    "type": "object",
                    "properties": {
                        "contrail": {
                            "type": "object",
                            "properties": {
                                "xmpp_auth_enable": {
                                    "type": "boolean",
                                    "default": false,
                                    "description": "flag to indicate if xmpp athentication is enabled between control node and vrouter agent."
                                },
                                "xmpp_dns_auth_enable": {
                                    "type": "boolean",
                                    "default": false,
                                    "description": "flag to indicate if xmpp athentication is enabled between control node and vrouter dns agent."
                                },
                                "kernel_upgrade": {
                                    "type": "boolean",
                                    "default": true,
                                    "description": "Whether to upgrade kernel version of target servers."
                                },
                                "kernel_version": {
                                    "type": "string",
                                    "default": "",
                                    "description": "Kernel version to upgrade to. Optional parameter. Default upgrades to kernel version included with contrail package, if upgrade flag is set."
                                },
                                "enable_lbass": {
                                    "type": "boolean",
                                    "default": false,
                                    "description": "flag to indicate if lbaas feature is enabled for the cluster."
                                },
                                "amqp_ssl": {
                                    "type": "boolean",
                                    "default": false,
                                    "description": "Flag to enable or disable rabbitmq server SSL support globally for openstack and contrail config"
                                },
                                "ha": {
                                    "type": "object",
                                    "properties": {
                                        "haproxy_enable": {
                                            "type": "boolean",
                                            "default": true,
                                            "description": "Whether HAproxy service is enabled or disabled."
                                        },
                                        "contrail_internal_vip": {
                                            "type": "string",
                                            "pattern": "^$|^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(/[0-9][0-9])?$",
                                            "default": "",
                                            "description": "Virtual Interface IP to be used for control/data interface of contrail HA nodes"
                                        },
                                        "contrail_external_vip": {
                                            "type": "string",
                                            "pattern": "^$|^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(/[0-9][0-9])?$",
                                            "default": "",
                                            "description": "Virtual Interface IP to be used for management interface of contrail HA nodes"
                                        },
                                        "contrail_internal_virtual_router_id": {
                                            "type": "integer",
                                            "default": 103,
                                            "description": "VRID for control/data interface HA functionality."
                                        }
                                    }
                                },
                                "database": {
                                    "type": "object",
                                    "properties": {
                                        "ip_port": {
                                            "type": "integer",
                                            "default": 9160,
                                            "description": "Port number used by database service."
                                        },
                                        "directory": {
                                            "type": "string",
                                            "default": "/var/lib/cassandra",
                                            "description": "Dataabse directory path for Cassandra to use"
                                        },
                                        "minimum_diskGB": {
                                            "type": "integer",
                                            "pattern": "number",
                                            "default": 32,
                                            "description": "Minimum free disk size needed (in GB)"
                                        }
                                    }
                                },
                                "analytics": {
                                    "type": "object",
                                    "properties": {
                                        "data_ttl": {
                                            "type": "integer",
                                            "pattern": "number",
                                            "default": 48,
                                            "description": "Analytics Data TTL in hours"
                                        },
                                        "config_audit_ttl": {
                                            "type": "integer",
                                            "default": 2160,
                                            "description": "Analytics config audit TTL in hours"
                                        },
                                        "statistics_ttl": {
                                            "type": "integer",
                                            "default": 168,
                                            "description": "Analytics statistics TTL in hours"
                                        },
                                        "flow_ttl": {
                                            "type": "integer",
                                            "default": 2,
                                            "description": "Analytics flow TTL in hours"
                                        },
                                        "snmp_scan_frequency": {
                                            "type": "integer",
                                            "default": 600,
                                            "description": "SNMP scan interval in seconds"
                                        },
                                        "snmp_fast_scan_frequency": {
                                            "type": "integer",
                                            "default": 60,
                                            "description": "SNMP fast scan interval in seconds"
                                        },
                                        "topology_scan_frequency": {
                                            "type": "integer",
                                            "default": 60,
                                            "description": "Topology scan interval in seconds"
                                        },
                                        "syslog_port": {
                                            "type": "integer",
                                            "default": -1,
                                            "description": "Analytics syslog port value"
                                        },
                                        "data_directory": {
                                            "type": "string",
                                            "default": "",
                                            "description": "Analytics dir name where data files are stored, default use the same value as database_dir in database role."
                                        },
                                        "ssd_data_directory": {
                                            "type": "string",
                                            "default": "",
                                            "description": "Analytics dir name where ssd files are stored, default use the same value as database_dir in database role."
                                        },
                                        "redis_password": {
                                            "type": "string",
                                            "default": null,
                                            "description": "Password to use for Redis service"
                                        }
                                    }
                                },
                                "control": {
                                    "type": "object",
                                    "properties": {
                                        "encapsulation_priority": {
                                            "type": "string",
                                            "default": "VXLAN,MPLSoUDP,MPLSoGRE",
                                            "description": "The priority order for tunnel encapsulation methods used by Controller EVPN"
                                        },
                                        "router_asn": {
                                            "type": "integer",
                                            "default": 64512,
                                            "description": "The ASN that the cluster belongs to"
                                        },
                                        "external_bgp": {
                                            "type": "string",
                                            "default": "",
                                            "description": "List of external BGP peers in the form of name, address tuples e.g. [('montreal', '13.1.0.254')]"
                                        }
                                    }
                                },
                                "config": {
                                    "type": "object",
                                    "properties": {
                                        "manage_neutron": {
                                            "type": "boolean",
                                            "default": true,
                                            "description": "Whether config manages neutron service"
                                        },
                                        "zookeeper_ip_port": {
                                            "type": "integer",
                                            "default": 2181,
                                            "description": "The IP Port that the zookeeper service listens on"
                                        },
                                        "healthcheck_interval": {
                                            "type": "integer",
                                            "default": 5,
                                            "description": "Discovery health check interval"
                                        },
                                        "amqp_use_ssl": {
                                            "type": "boolean",
                                            "default": false,
                                            "description": "Flag to enable or disable rabbitmq server SSL support for contrail config"
                                        }
                                    }
                                },
                                "webui": {
                                    "type": "object",
                                    "properties": {}
                                },
                                "compute": {
                                    "type": "object",
                                    "properties": {
                                        "huge_pages": {
                                            "type": "string",
                                            "default": "",
                                            "description": "Specify what percentage of host memory should be reserved for access with huge pages"
                                        },
                                        "core_mask": {
                                            "type": "string",
                                            "default": "",
                                            "description": "Specify CPU affinity mask to run vRouter with. Supports hexadecimal, comma-separated list of CPUs, dash-separated range of CPUs"
                                        },
                                        "sriov": {
                                            "type": "object",
                                            "properties": {
                                                "enable": {
                                                    "type": "boolean",
                                                    "default": false,
                                                    "description": "Flag to set if SRIOV is enabled"
                                                }
                                            }
                                        }
                                    }
                                },
                                "vmware": {
                                    "type": "object",
                                    "properties": {
                                        "ip": {
                                            "type": "string",
                                            "default": "",
                                            "description": "VMware IP address."
                                        },
                                        "username": {
                                            "type": "string",
                                            "default": "",
                                            "description": "VMware user name"
                                        },
                                        "password": {
                                            "type": "string",
                                            "default": "",
                                            "description": "VMware user password"
                                        },
                                        "vswitch": {
                                            "type": "string",
                                            "default": "",
                                            "description": "VMware vswitch name"
                                        }
                                    }
                                },
                                "vgw": {
                                    "type": "object",
                                    "properties": {
                                        "public_subnet": {
                                            "type": "string",
                                            "default": "",
                                            "description": "VGW public subnet address."
                                        },
                                        "public_vn_name": {
                                            "type": "string",
                                            "default": "",
                                            "description": "VGW public virtual network name."
                                        },
                                        "interface": {
                                            "type": "string",
                                            "default": "",
                                            "description": "VGW interface name"
                                        },
                                        "gateway_routes": {
                                            "type": "string",
                                            "default": "",
                                            "description": "VGW routes"
                                        }
                                    }
                                },
                                "storage": {
                                    "type": "object",
                                    "properties": {
                                        "storage_monitor_secret": {
                                            "type": "string",
                                            "default": "",
                                            "description": "Key for Storage monitor Secret"
                                        },
                                        "osd_bootstrap_key": {
                                            "type": "string",
                                            "default": "",
                                            "description": "OSD Bootstrap Key value"
                                        },
                                        "storage_chassis_config": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            },
                                            "description": "Storage chassis config"
                                        },
                                        "live_migration_host": {
                                            "type": "string",
                                            "default": "",
                                            "description": "Live migration host IP"
                                        },
                                        "storage_admin_key": {
                                            "type": "string",
                                            "default": "",
                                            "description": "Ceph Storage admin key"
                                        }
                                    }
                                },
                                "toragent": {
                                    "type": "object",
                                    "properties": {}
                                },
                                "tsn": {
                                    "type": "object",
                                    "properties": {}
                                }
                            }
                        },
                        "openstack": {
                            "type": "object",
                            "properties": {
                                "keystone": {
                                    "type": "object",
                                    "properties": {
                                        "admin_password": {
                                            "type": "string",
                                            "default": "contrail123",
                                            "description": "Keystone Admin Password value"
                                        },
                                        "ip": {
                                            "type": "string",
                                            "pattern": "^$|^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(/[0-9][0-9])?$",
                                            "default": "",
                                            "description": "The External Keystone IP to use (If we are using a Central Keystone server, for example)"
                                        },
                                        "admin_user": {
                                            "type": "string",
                                            "default": "admin",
                                            "description": "Keystone admin user value"
                                        },
                                        "admin_tenant": {
                                            "type": "string",
                                            "default": "admin",
                                            "description": "Keystone admin tenant value"
                                        },
                                        "service_tenant": {
                                            "type": "string",
                                            "default": "services",
                                            "description": "Keystone service tenant value"
                                        },
                                        "auth_port": {
                                            "type": "integer",
                                            "default": 35357,
                                            "description": "Keystone authentication port"
                                        },
                                        "auth_protocol": {
                                            "type": "string",
                                            "default": "http",
                                            "description": "Keystone authentication protocol (http/https)"
                                        },
                                        "mysql_service_password": {
                                            "type": "string",
                                            "default": "",
                                            "description": "The MYSQL service password that Openstack services should use when talking to an external Keystone server."
                                        },
                                        "version": {
                                            "type": "string",
                                            "default": "v2.0",
                                            "description": "Keystone API version"
                                        }
                                    }
                                },
                                "neutron": {
                                    "type": "object",
                                    "properties": {
                                        "service_protocol": {
                                            "type": "string",
                                            "default": "http",
                                            "description": "Neutron service protocol (https/http)"
                                        },
                                        "port": {
                                            "type": "integer",
                                            "default": 9697,
                                            "description": "Neutron port to use"
                                        }
                                    }
                                },
                                "amqp": {
                                    "type": "object",
                                    "properties": {
                                        "server_ip": {
                                            "type": "string",
                                            "default": "",
                                            "description": "AMQP Service IP to connect to"
                                        },
                                        "use_ssl": {
                                            "type": "boolean",
                                            "default": false,
                                            "description": "Flag to enable or disable rabbitmq server SSL support for openstack"
                                        }
                                    }
                                },
                                "region": {
                                    "type": "string",
                                    "default": "RegionOne",
                                    "description": "Openstack keystone region name"
                                },
                                "multi_tenancy": {
                                    "type": "boolean",
                                    "default": true,
                                    "description": "Flag to set if multi tenancy is enabled"
                                },
                                "openstack_manage_amqp": {
                                    "type": "boolean",
                                    "default": false,
                                    "description": "Flag to set if Openstack nodes use their own AMQP cluster (Rabbit cluster)"
                                },
                                "enable_ceilometer": {
                                    "type": "boolean",
                                    "default": false,
                                    "description": "Flag to set if ceilometer service is enabled."
                                },
                                "ha": {
                                    "type": "object",
                                    "properties": {
                                        "internal_vip": {
                                            "type": "string",
                                            "pattern": "^$|^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(/[0-9][0-9])?$",
                                            "default": "",
                                            "description": "Virtual IP address for openstack node control interface"
                                        },
                                        "external_vip": {
                                            "type": "string",
                                            "pattern": "^$|^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(/[0-9][0-9])?$",
                                            "default": "",
                                            "description": "Virtual IP address for openstack node management interface"
                                        },
                                        "internal_virtual_router_id": {
                                            "type": "integer",
                                            "default": 102,
                                            "description": "VRID for openstack control network"
                                        },
                                        "external_virtual_router_id": {
                                            "type": "integer",
                                            "default": 101,
                                            "description": "VRID for openstack management network"
                                        },
                                        "nfs_server": {
                                            "type": "string",
                                            "pattern": "^$|^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(/[0-9][0-9])?$",
                                            "default": "",
                                            "description": "Address of NFS server used to keep images for HA."
                                        },
                                        "nfs_glance_path": {
                                            "type": "string",
                                            "default": "",
                                            "description": "NFS path for glance images, used for HA."
                                        }
                                    }
                                },
                                "mysql": {
                                    "type": "object",
                                    "properties": {
                                        "root_password": {
                                            "type": "string",
                                            "default": "c0ntrail123",
                                            "description": "mysql root password value"
                                        },
                                        "allowed_hosts": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            },
                                            "description": "List of IP addresses that are allowed to access the MYSQL server on Openstack node of the cluster."
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "required": [
        "id"
    ]
}