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
87 $ref: '#/definitions/ip_address'
89 $ref: '#/definitions/mac_address'
90 required: ['type', 'versions', 'user', 'pass', 'address', 'mac_address']
91 additionalProperties: false
100 pattern: '^nic[0-9]+$'
102 $ref: '#/definitions/mac_address'
105 $ref: '#/definitions/ip_address'
110 pattern: '^(native|[1-9][0-9]{0,3})(\|(native|[1-9][0-9]{0,3}))*$'
117 enum: ['1gb', '10gb', '25gb', '40gb']
118 # FIXME: mandatory for nodes?
121 type: ['string', 'null']
122 pattern: '^((dpdk|sriov)\|?)*$'
123 # FIXME: mandatory for nodes?
124 required: ['name', 'mac_address']
125 additionalProperties: false
126 ############################################################################
127 # Top-level PDF blocks, versioned
134 enum: ['production', 'development']
139 pattern: '^([a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+[,; ]*)+$'
146 required: ['type', 'pod_owner', 'contact', 'lab', 'location', 'link']
147 additionalProperties: false
155 $ref: '#/definitions/node/v1.0'
157 $ref: '#/definitions/disks/v1.0'
160 remote_params: # Optional YAML anchor, contents will be validated below
163 $ref: '#/definitions/remote_management/v1.0'
165 $ref: '#/definitions/interfaces/v1.0'
166 required: ['name', 'node', 'disks', 'os', 'remote_management', 'interfaces']
167 additionalProperties: false
177 $ref: '#/definitions/node/v1.0'
179 $ref: '#/definitions/disks/v1.0'
182 remote_params: # Optional YAML anchor, contents will be validated after inject
185 $ref: '#/definitions/remote_management/v1.0'
187 $ref: '#/definitions/interfaces/v1.0'
188 required: ['name', 'node', 'disks', 'remote_management', 'interfaces']
189 additionalProperties: false
191 ##############################################################################
192 # Top-level structure:
193 # - define all possible top-level keys, without enforcing a schema for them,
194 # just so we can disallow additional properties;
195 # - require 'version' and allow dynamically generated 'version_x.y' key;
197 # version_x.y keys are auto-added by `validate_schema.py` based on 'version'
209 required: ['version']
210 additionalProperties: false
212 ##############################################################################
214 # - based on dynamically added 'version_x.y', require additional PDF blocks
215 # and validate them against the proper schema version;
220 $ref: '#/definitions/details/v1.0'
222 $ref: '#/definitions/jumphost/v1.0'
224 $ref: '#/definitions/nodes/v1.0'
225 required: ['details', 'jumphost', 'nodes']