0bed580daa
Implements JSON schema validation for intermediary YAML files Adds tests for intermediary validation Change-Id: Iaa385d265b027426f8e5f2376462ffb4c0d1d3fa
374 lines
11 KiB
JSON
374 lines
11 KiB
JSON
{
|
|
"$schema": "http://json-schema.org/schema#",
|
|
"metadata": {
|
|
"name": "spyglass/Intermediary/v1"
|
|
},
|
|
"title": "All",
|
|
"description": "All information",
|
|
"type": "object",
|
|
"properties": {
|
|
"baremetal": {
|
|
"type": "object",
|
|
"items": {
|
|
"type": "object",
|
|
"$ref": "#/definitions/baremetal_list"
|
|
}
|
|
},
|
|
"network": {
|
|
"type": "object",
|
|
"properties": {
|
|
"bgp": {
|
|
"type": "object",
|
|
"$ref": "#/definitions/bgp"
|
|
},
|
|
"vlan_network_data": {
|
|
"type": "array",
|
|
"$ref": "#/definitions/vlan_network_data"
|
|
}
|
|
},
|
|
"required": [
|
|
"bgp",
|
|
"vlan_network_data"
|
|
]
|
|
},
|
|
"site_info": {
|
|
"type": "object",
|
|
"$ref": "#/definitions/site_info"
|
|
},
|
|
"storage": {
|
|
"type": "object",
|
|
"$ref": "#/definitions/storage"
|
|
}
|
|
},
|
|
"required": [
|
|
"baremetal",
|
|
"network",
|
|
"site_info",
|
|
"storage"
|
|
],
|
|
"definitions": {
|
|
"baremetal_list": {
|
|
"type": "object",
|
|
"patternProperties": {
|
|
".*": {
|
|
"properties": {
|
|
"ip": {
|
|
"type": "object",
|
|
"properties": {
|
|
"calico": {
|
|
"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])$"
|
|
},
|
|
"oam": {
|
|
"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])$"
|
|
},
|
|
"oob": {
|
|
"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])$"
|
|
},
|
|
"overlay": {
|
|
"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])$"
|
|
},
|
|
"pxe": {
|
|
"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]))|(#CHANGE_ME)$"
|
|
},
|
|
"storage": {
|
|
"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])$"
|
|
}
|
|
},
|
|
"required" :[
|
|
"calico",
|
|
"oam",
|
|
"oob",
|
|
"overlay",
|
|
"pxe",
|
|
"storage"
|
|
]
|
|
},
|
|
"host_profile": {
|
|
"description": "Host profile of the host",
|
|
"type": "string",
|
|
"pattern": "^([a-zA-Z]+)|(#CHANGE_ME)$"
|
|
},
|
|
"type": {
|
|
"description": "Host profile type:Compute or Controller or genesis ",
|
|
"type": "string",
|
|
"pattern": "^(?i)compute|controller|genesis$"
|
|
}
|
|
},
|
|
"required" :[
|
|
"ip",
|
|
"host_profile",
|
|
"type"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"bgp": {
|
|
"type": "object",
|
|
"properties": {
|
|
"asnumber": {
|
|
"type": "integer",
|
|
"pattern": "^[0-9]{1,10}$"
|
|
},
|
|
"peer_asnumber": {
|
|
"type": "integer",
|
|
"pattern": "^[0-9]{1,10}$"
|
|
},
|
|
"peers": {
|
|
"type": "array",
|
|
"items": [
|
|
{
|
|
"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])$"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"asnumber",
|
|
"peer_asnumber",
|
|
"peers"
|
|
]
|
|
},
|
|
"vlan_network_data": {
|
|
"type": "object",
|
|
"properties": {
|
|
"calico": {
|
|
"type": "object",
|
|
"properties": {
|
|
"subnet": {
|
|
"description": "Subnet address of the network",
|
|
"type": "array",
|
|
"items": {
|
|
"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]|[1-2][0-9]|3[0-2])$"
|
|
}
|
|
},
|
|
"vlan": {
|
|
"description": "Vlan id of the network",
|
|
"type": "string",
|
|
"pattern": "^([0-9]|[0-9][0-9]|[0-9][0-9][0-9]|[0-3][0-9][0-9][0-9]|40[0-9][0-5])$"
|
|
}
|
|
},
|
|
"required": [
|
|
"subnet",
|
|
"vlan"
|
|
]
|
|
},
|
|
"ingress": {
|
|
"type": "object",
|
|
"properties": {
|
|
"subnet": {
|
|
"description": "Subnet address of the network",
|
|
"type": "array",
|
|
"items": [
|
|
{
|
|
"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]|[1-2][0-9]|3[0-2])$"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"subnet"
|
|
]
|
|
},
|
|
"oam": {
|
|
"type": "object",
|
|
"properties": {
|
|
"subnet": {
|
|
"description": "Subnet address of the network",
|
|
"type": "array",
|
|
"items": {
|
|
"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]|[1-2][0-9]|3[0-2])$"
|
|
}
|
|
},
|
|
"vlan": {
|
|
"description": "Vlan id of the network",
|
|
"type": "string",
|
|
"pattern": "^([0-9]|[0-9][0-9]|[0-9][0-9][0-9]|[0-3][0-9][0-9][0-9]|40[0-9][0-5])$"
|
|
}
|
|
},
|
|
"required": [
|
|
"subnet",
|
|
"vlan"
|
|
]
|
|
},
|
|
"oob": {
|
|
"type": "object",
|
|
"properties": {
|
|
"subnet": {
|
|
"description": "Subnet address of the network",
|
|
"type": "array",
|
|
"items": {
|
|
"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]|[1-2][0-9]|3[0-2])$"
|
|
}
|
|
},
|
|
"vlan": {
|
|
"description": "Vlan id of the network",
|
|
"type": "string",
|
|
"pattern": "^([0-9]|[0-9][0-9]|[0-9][0-9][0-9]|[0-3][0-9][0-9][0-9]|40[0-9][0-5])?$"
|
|
}
|
|
},
|
|
"required": [
|
|
"subnet"
|
|
]
|
|
},
|
|
"pxe": {
|
|
"type": "object",
|
|
"properties": {
|
|
"subnet": {
|
|
"description": "Subnet address of the network",
|
|
"type": "array",
|
|
"items": {
|
|
"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]|[1-2][0-9]|3[0-2])$"
|
|
}
|
|
},
|
|
"vlan": {
|
|
"description": "Vlan id of the network",
|
|
"type": "string",
|
|
"pattern": "^([0-9]|[0-9][0-9]|[0-9][0-9][0-9]|[0-3][0-9][0-9][0-9]|40[0-9][0-5])$"
|
|
}
|
|
},
|
|
"required": [
|
|
"subnet",
|
|
"vlan"
|
|
]
|
|
},
|
|
"storage": {
|
|
"type": "object",
|
|
"properties": {
|
|
"subnet": {
|
|
"description": "Subnet address of the network",
|
|
"type": "array",
|
|
"items": {
|
|
"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]|[1-2][0-9]|3[0-2])$"
|
|
}
|
|
},
|
|
"vlan": {
|
|
"description": "Vlan id of the network",
|
|
"type": "string",
|
|
"pattern": "^([0-9]|[0-9][0-9]|[0-9][0-9][0-9]|[0-3][0-9][0-9][0-9]|40[0-9][0-5])$"
|
|
}
|
|
},
|
|
"required": [
|
|
"subnet",
|
|
"vlan"
|
|
]
|
|
}
|
|
},
|
|
"required" :[
|
|
"calico",
|
|
"ingress",
|
|
"oam",
|
|
"oob",
|
|
"overlay",
|
|
"pxe",
|
|
"storage"
|
|
]
|
|
},
|
|
"site_info": {
|
|
"type": "object",
|
|
"properties": {
|
|
"dns": {
|
|
"type": "object",
|
|
"properties": {
|
|
"servers": {
|
|
"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]|[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]))+))+$"
|
|
}
|
|
}
|
|
},
|
|
"ntp": {
|
|
"type": "object",
|
|
"properties": {
|
|
"servers": {
|
|
"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]|[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]))+))+$"
|
|
}
|
|
}
|
|
},
|
|
"ldap": {
|
|
"type": "object",
|
|
"properties": {
|
|
"common_name": {
|
|
"type": "string",
|
|
"pattern": "\\W+|\\w+"
|
|
},
|
|
"subdomain": {
|
|
"type": "string",
|
|
"pattern": "(?i)\\w+"
|
|
},
|
|
"url": {
|
|
"type": "string",
|
|
"pattern": "^\\w+://\\w+.*\\.[a-zA-Z]{2,3}$"
|
|
}
|
|
},
|
|
"required": [
|
|
"common_name",
|
|
"subdomain",
|
|
"url"
|
|
]
|
|
},
|
|
"country": {
|
|
"type": "string",
|
|
"pattern": "(?i)\\w+"
|
|
},
|
|
"name": {
|
|
"type": "string",
|
|
"pattern": "(?i)\\w+"
|
|
},
|
|
"state": {
|
|
"type": "string",
|
|
"pattern": "(?i)\\w+"
|
|
},
|
|
"sitetype": {
|
|
"type": "string",
|
|
"pattern": "(?i)\\w+"
|
|
},
|
|
"physical_location_id": {
|
|
"type": "string",
|
|
"pattern": "^\\w+"
|
|
},
|
|
"domain": {
|
|
"type": "string",
|
|
"pattern": "^\\w+.*\\.[a-zA-Z]{2,3}$"
|
|
}
|
|
},
|
|
"required": [
|
|
"dns",
|
|
"ntp",
|
|
"ldap",
|
|
"country",
|
|
"name",
|
|
"state",
|
|
"sitetype",
|
|
"physical_location_id",
|
|
"domain"
|
|
]
|
|
},
|
|
"storage": {
|
|
"type": "object",
|
|
"patternProperties": {
|
|
"ceph": {
|
|
"controller": {
|
|
"osd_count": {
|
|
"type": "integer",
|
|
"pattern": "^[0-9]{1,2}$"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|