{
    "title": "fabric info",
    "$schema": "http://json-schema.org/draft-06/schema#",
    "type": "object",
    "additionalProperties": false,
    "required": [
        "fabric_fq_name",
        "management_subnets",
        "loopback_subnets",
        "fabric_subnets",
        "fabric_asn_pool",
        "device_auth",
        "node_profiles"
    ],
    "properties": {
        "fabric_fq_name": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "fabric_display_name": {
            "type": "string"
        },
        "fabric_cluster_id": {
            "type": "integer"
        },
        "management_subnets": {
            "type": "array",
            "items": {
                "type": "object",
                "description": "List of the management network subnets for the fabric",
                "additionalProperties": false,
                "required": [
                    "cidr",
                    "gateway"
                ],
                "properties": {
                    "cidr": {
                        "type": "string",
                        "pattern": "^([0-9]{1,3}\\.){3}[0-9]{1,3}(/([0-9]|[1-2][0-9]|3[0-2]))?$"
                    },
                    "gateway": {
                        "type": "string",
                        "format": "ipv4"
                    }
                }
            }
        },
        "loopback_subnets": {
            "type": "array",
            "items": {
                "type": "string",
                "description": "List of the subnet prefixes that fabric device loopback ips can be allocated.",
                "pattern": "^([0-9]{1,3}\\.){3}[0-9]{1,3}(/([0-9]|[1-2][0-9]|3[0-2]))?$"
            }
        },
        "overlay_loopback_subnets": {
            "type": "array",
            "items": {
                "type": "string",
                "description": "List of the subnet prefixes that fabric device overlay loopback ips can be allocated.",
                "pattern": "^([0-9]{1,3}\\.){3}[0-9]{1,3}(/([0-9]|[1-2][0-9]|3[0-2]))?$"
            }
        },
        "fabric_subnets": {
            "type": "array",
            "items": {
                "type": "string",
                "description": "List of the subnet prefixes that could be carved out for the p2p networks between fabric devices.",
                "pattern": "^([0-9]{1,3}\\.){3}[0-9]{1,3}(/([0-9]|[1-2][0-9]|3[0-2]))?$"
            }
        },
        "pnf_servicechain_subnets": {
            "type": "array",
            "items": {
                "type": "string",
                "description": "List of the subnet prefixes that could be carved out for service chaining between fabric devices.",
                "pattern": "^([0-9]{1,3}\\.){3}[0-9]{1,3}(/([0-9]|[1-2][0-9]|3[0-2]))?$"
            }
        },
        "fabric_asn_pool": {
            "type": "array",
            "items": {
                "title": "eBGP ASN Pool for fabric underlay network",
                "type": "object",
                "description": "List of the ASN pools that could be used to configure the eBGP peers for the IP fabric",
                "properties": {
                    "asn_min": {
                        "type": "integer"
                    },
                    "asn_max": {
                        "type": "integer"
                    }
                },
                "required": [
                    "asn_min",
                    "asn_max"
                ]
            }
        },
        "overlay_ibgp_asn": {
            "type": "integer",
            "title": "iBGP ASN for Contrail overlay network",
            "default": 64512
        },
        "device_auth": {
            "title": "Device Auth",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "root_password"
            ],
            "properties": {
                "root_password": {
                    "type": "string"
                }
            }
        },
        "node_profiles": {
            "type": "array",
            "items": {
                "title": "Node profile",
                "type": "object",
                "description": "List of node profiles to be used by the fabric.",
                "additionalProperties": false,
                "properties": {
                    "node_profile_name": {
                        "type": "string"
                    },
                    "serial_nums": {
                        "type": "array",
                        "description": "Optional list of serial numbers of fabric devices that we want to associate with this node profile.",
                        "items": {
                            "type": "string"
                        }
                    }
                },
                "required": [
                    "node_profile_name"
                ]
            }
        },
        "interface_filters": {
            "type": "array",
            "items": {
                "type": "object",
                "maxProperties": 2,
                "additionalProperties": false,
                "properties": {
                    "op": {
                        "enum": [
                            "regex"
                        ]
                    },
                    "expr": {
                        "type": "string"
                    }
                },
                "title": "filter object",
                "description": "filter object having op and expr fields",
                "default": {},
                "examples": [
                    {
                        "op": "regex",
                        "expr": "^ge-"
                    },
                    {
                        "op": "regex",
                        "expr": "^xe"
                    }
                ]
            }
        },
        "import_configured": {
            "type": "boolean",
            "default": false,
            "description": "Not importing configured interfaces by default. Set this option to true if configured interfaces need to be imported as part of onboarding."
        },
        "device_count": {
            "title": "Number of fabric devices",
            "type": "integer",
            "description": "Total number of devices in the fabric that needs to be zero-touch provisioned"
        },
        "supplemental_day_0_cfg": {
            "title": "List of day 0 config that can be used to supplement the ZTP config",
            "type": "array",
            "items": {
                "type": "object",
                "required": [
                    "name",
                    "cfg"
                ],
                "properties": {
                    "name": {
                        "title": "name for the config",
                        "type": "string"
                    },
                    "cfg": {
                        "title": "config blob that contains the supplemental day-0 config",
                        "type": "string"
                    }
                }
            }
        },
        "device_to_ztp": {
            "title": "List of device serial numbers for the devices to be ZTPed",
            "type": "array",
            "items": {
                "type": "object",
                "required": [
                    "serial_number",
                    "hostname"
                ],
                "properties": {
                    "serial_number": {
                        "title": "Device serial number",
                        "type": "string"
                    },
                    "hostname": {
                        "title": "Device hostname can be optionally specified.",
                        "type": "string",
                        "pattern": "^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9])$"
                    },
                    "underlay_asn": {
                        "title": "Underlay eBGP autonomous system number",
                        "type": [
                            "integer",
                            "string"
                        ]
                    },
                    "loopback_ip": {
                        "title": "Loopback IP address",
                        "type": "string",
                        "format": "ipv4"
                    },
                    "mgmt_ip": {
                        "title": "Management IP address",
                        "type": "string",
                        "format": "ipv4"
                    },
                    "to_ztp": {
                        "title": "Include or ignore device in ZTP workflow",
                        "type": "boolean"
                    },
                    "supplemental_day_0_cfg": {
                        "title": "Name(s) of the supplemental day-0 config(s) that can be optionally specified for this device",
                        "type": [
                            "string",
                            "array"
                        ],
                        "items": {
                            "type": "string"
                        }
                    }
                }
            }
        },
        "os_version": {
            "type": "string"
        },
        "enterprise_style": {
            "type": "boolean",
            "default": true,
            "description": "True if enterprise style, false if sp-style configuration"
        },
        "disable_vlan_vn_uniqueness_check": {
            "type": "boolean",
            "default": false,
            "description": "True if vlan-vn uniqueness validation checks needs to be disabled, false if enable all complex validations"
        }
    }
}