arm-pod10: Increase MaaS deploy timeout
[pharos.git] / config / pdf / pod1.schema.yaml
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 ##############################################################################
8 ---
9 $schema: 'http://json-schema.org/schema#'
10 $id: 'https://github.com/opnfv/pharos/blob/master/config/pdf/pod1.yaml'
11
12 definitions:
13   ############################################################################
14   # Low-level, general purpose definitions, unversioned
15   ip_address:
16     type: 'string'  # NOTE: we don't validate this is a valid addr (yet)
17   mac_address:
18     type: 'string'
19     pattern: '^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$'
20   ############################################################################
21   # Mid-level definitions, common schema for jumpserver & cluster nodes
22   node:
23     v1.0:
24       type: 'object'
25       properties:
26         type:
27           type: 'string'
28           enum: ['baremetal', 'virtual']
29         vendor:
30           type: 'string'
31         model:
32           type: 'string'
33         arch:
34           type: 'string'
35           enum: ['aarch64', 'x86_64']
36         cpus:
37           type: 'number'
38         cpu_cflags:
39           type: 'string'
40         cores:
41           type: 'number'
42         memory:
43           type: 'string'
44           pattern: '^[1-9]\d*[MGT]B?$'
45       required: ['type', 'vendor', 'model', 'arch', 'cpus', 'cpu_cflags', 'cores', 'memory']
46       additionalProperties: false
47   disks:
48     v1.0:
49       type: 'array'
50       items:
51         type: 'object'
52         properties:
53           name:
54             type: 'string'
55             pattern: '^disk[0-9]+$'
56           disk_capacity:
57             type: 'string'
58             pattern: '^[1-9][\d\.]*[MGT]B?$'
59           disk_type:
60             type: 'string'
61             enum: ['hdd', 'ssd', 'cdrom', 'tape']
62           disk_interface:
63             type: 'string'
64             enum: ['sata', 'sas', 'ssd', 'nvme', 'scsi', 'iscsi']
65           disk_rotation:
66             type: 'number'
67             enum: [0, 5400, 7200, 10000, 15000]
68         required: ['name', 'disk_capacity', 'disk_type', 'disk_interface', 'disk_rotation']
69         additionalProperties: false
70   remote_management:
71     v1.0:
72       properties:
73         user:
74           type: 'string'
75         pass:
76           type: 'string'
77         port:
78           type: 'number'
79         privilege_level:
80           type: 'string'
81         type:
82           type: 'string'
83         versions:
84           type: 'array'
85         address:
86           type: 'string'
87         mac_address:
88           type: 'string'
89       # These subsections are best validated separately for baremetal/virtual
90       oneOf:
91         - type: 'object'
92           properties:
93             type:
94               type: 'string'
95               enum: ['ipmi', 'amt']
96             versions:
97               type: 'array'
98               items:
99                 type: 'number'
100                 enum: [1.0, 2.0]
101             address:
102               $ref: '#/definitions/ip_address'
103             mac_address:
104               $ref: '#/definitions/mac_address'
105           required: ['type', 'versions', 'address', 'mac_address']
106         - type: 'object'
107           properties:
108             type:
109               type: 'string'
110               enum: ['libvirt']
111             address:
112               type: 'string'  # Loose validation of libvirt URI for now
113           required: ['type', 'address']
114       required: ['user', 'pass']
115       additionalProperties: false
116   interfaces:
117     v1.0:
118       type: 'array'
119       items:
120         type: 'object'
121         properties:
122           name:
123             type: 'string'
124             pattern: '^nic[0-9]+$'
125           mac_address:
126             $ref: '#/definitions/mac_address'
127           # Optional
128           address:
129             $ref: '#/definitions/ip_address'
130           # Optional
131           vlan:
132             oneOf:
133               - type: 'string'
134                 pattern: '^(native|[1-9][0-9]{0,3})(\|(native|[1-9][0-9]{0,3}))*$'
135               - type: 'integer'
136                 mininum: 1
137                 maximum: 4095
138           # Optional
139           speed:
140             type: 'string'
141             enum: ['1gb', '10gb', '25gb', '40gb']
142             # FIXME: mandatory for nodes?
143           # Optional
144           features:
145             type: ['string', 'null']
146             pattern: '^((dpdk|sriov)\|?)*$'
147             # FIXME: mandatory for nodes?
148         required: ['name', 'mac_address']
149         additionalProperties: false
150   ############################################################################
151   # Top-level PDF blocks, versioned
152   details:
153     v1.0:
154       type: 'object'
155       properties:
156         type:
157           type: 'string'
158           enum: ['production', 'development']
159         pod_owner:
160           type: 'string'
161         contact:
162           type: 'string'
163           pattern: '^([a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+[,; ]*)+$'
164         lab:
165           type: 'string'
166         location:
167           type: 'string'
168         link:
169           type: 'string'
170       required: ['type', 'pod_owner', 'contact', 'lab', 'location', 'link']
171       additionalProperties: false
172   jumphost:
173     v1.0:
174       type: 'object'
175       properties:
176         name:
177           type: 'string'
178         node:
179           $ref: '#/definitions/node/v1.0'
180         disks:
181           $ref: '#/definitions/disks/v1.0'
182         os:
183           type: 'string'
184         remote_params:  # Optional YAML anchor, contents will be validated below
185           type: 'object'
186         remote_management:
187           $ref: '#/definitions/remote_management/v1.0'
188         interfaces:
189           $ref: '#/definitions/interfaces/v1.0'
190       required: ['name', 'node', 'disks', 'os', 'remote_management', 'interfaces']
191       additionalProperties: false
192   nodes:
193     v1.0:
194       type: 'array'
195       items:
196         type: 'object'
197         properties:
198           name:
199             type: 'string'
200           node:
201             $ref: '#/definitions/node/v1.0'
202           disks:
203             $ref: '#/definitions/disks/v1.0'
204           os:
205             type: 'string'
206           remote_params:  # Optional YAML anchor, contents will be validated after inject
207             type: 'object'
208           remote_management:
209             $ref: '#/definitions/remote_management/v1.0'
210           interfaces:
211             $ref: '#/definitions/interfaces/v1.0'
212         required: ['name', 'node', 'disks', 'remote_management', 'interfaces']
213         additionalProperties: false
214
215 ##############################################################################
216 # Top-level structure:
217 # - define all possible top-level keys, without enforcing a schema for them,
218 #   just so we can disallow additional properties;
219 # - require 'version' and allow dynamically generated 'version_x.y' key;
220 properties:
221   # version_x.y keys are auto-added by `validate_schema.py` based on 'version'
222   version_1.0:
223     type: 'boolean'
224   version:
225     type: 'number'
226     enum: [1.0]
227   details:
228     type: 'object'
229   jumphost:
230     type: 'object'
231   nodes:
232     type: 'array'
233 required: ['version']
234 additionalProperties: false
235
236 ##############################################################################
237 # Schema versioning
238 # - based on dynamically added 'version_x.y', require additional PDF blocks
239 #   and validate them against the proper schema version;
240 dependencies:
241   version_1.0:
242     properties:
243       details:
244         $ref: '#/definitions/details/v1.0'
245       jumphost:
246         $ref: '#/definitions/jumphost/v1.0'
247       nodes:
248         $ref: '#/definitions/nodes/v1.0'
249     required: ['details', 'jumphost', 'nodes']