1 ##############################################################################
2 # Copyright (c) 2018 Enea AB and others.
3 # All rights reserved. This program and the accompanying materials
4 # are made available under the terms of the Apache License, Version 2.0
5 # which accompanies this distribution, and is available at
6 # http://www.apache.org/licenses/LICENSE-2.0
7 ##############################################################################
9 $schema: 'http://json-schema.org/schema#'
10 $id: 'https://github.com/opnfv/pharos/blob/master/config/pdf/pod1.yaml'
13 ############################################################################
14 # Low-level, general purpose definitions, unversioned
16 type: 'string' # NOTE: we don't validate this is a valid addr (yet)
19 pattern: '^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$'
20 ############################################################################
21 # Mid-level definitions, common schema for jumpserver & cluster nodes
28 enum: ['baremetal', 'virtual']
35 enum: ['aarch64', 'x86_64']
44 pattern: '^[1-9]\d*[MGT]B?$'
45 required: ['type', 'vendor', 'model', 'arch', 'cpus', 'cpu_cflags', 'cores', 'memory']
46 additionalProperties: false
55 pattern: '^disk[0-9]+$'
58 pattern: '^[1-9][\d\.]*[MGT]B?$'
61 enum: ['hdd', 'ssd', 'cdrom', 'tape']
64 enum: ['sata', 'sas', 'ssd', 'nvme', 'scsi', 'iscsi']
67 enum: [0, 5400, 7200, 10000, 15000]
68 required: ['name', 'disk_capacity', 'disk_type', 'disk_interface', 'disk_rotation']
69 additionalProperties: false
85 # These subsections are best validated separately for baremetal/virtual
98 $ref: '#/definitions/ip_address'
100 $ref: '#/definitions/mac_address'
101 required: ['type', 'versions', 'address', 'mac_address']
108 type: 'string' # Loose validation of libvirt URI for now
109 required: ['type', 'address']
110 required: ['user', 'pass']
111 additionalProperties: false
120 pattern: '^nic[0-9]+$'
122 $ref: '#/definitions/mac_address'
125 $ref: '#/definitions/ip_address'
130 pattern: '^(native|[1-9][0-9]{0,3})(\|(native|[1-9][0-9]{0,3}))*$'
137 enum: ['1gb', '10gb', '25gb', '40gb']
138 # FIXME: mandatory for nodes?
141 type: ['string', 'null']
142 pattern: '^((dpdk|sriov)\|?)*$'
143 # FIXME: mandatory for nodes?
144 required: ['name', 'mac_address']
145 additionalProperties: false
146 ############################################################################
147 # Top-level PDF blocks, versioned
154 enum: ['production', 'development']
159 pattern: '^([a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+[,; ]*)+$'
166 required: ['type', 'pod_owner', 'contact', 'lab', 'location', 'link']
167 additionalProperties: false
175 $ref: '#/definitions/node/v1.0'
177 $ref: '#/definitions/disks/v1.0'
180 remote_params: # Optional YAML anchor, contents will be validated below
183 $ref: '#/definitions/remote_management/v1.0'
185 $ref: '#/definitions/interfaces/v1.0'
186 required: ['name', 'node', 'disks', 'os', 'remote_management', 'interfaces']
187 additionalProperties: false
197 $ref: '#/definitions/node/v1.0'
199 $ref: '#/definitions/disks/v1.0'
202 remote_params: # Optional YAML anchor, contents will be validated after inject
205 $ref: '#/definitions/remote_management/v1.0'
207 $ref: '#/definitions/interfaces/v1.0'
208 required: ['name', 'node', 'disks', 'remote_management', 'interfaces']
209 additionalProperties: false
211 ##############################################################################
212 # Top-level structure:
213 # - define all possible top-level keys, without enforcing a schema for them,
214 # just so we can disallow additional properties;
215 # - require 'version' and allow dynamically generated 'version_x.y' key;
217 # version_x.y keys are auto-added by `validate_schema.py` based on 'version'
229 required: ['version']
230 additionalProperties: false
232 ##############################################################################
234 # - based on dynamically added 'version_x.y', require additional PDF blocks
235 # and validate them against the proper schema version;
240 $ref: '#/definitions/details/v1.0'
242 $ref: '#/definitions/jumphost/v1.0'
244 $ref: '#/definitions/nodes/v1.0'
245 required: ['details', 'jumphost', 'nodes']