Merge "Add mask to the oob networks"
[pharos.git] / config / pdf / idf-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   net_config:
14     v0.1:
15       # NOTE: I hope this is going away soon, so I won't model it yet
16       type: 'object'
17   compass:
18     v0.1:
19       type: 'object'
20       # NOTE: To be properly modeled by Compass4NFV maintainers
21   daisy:
22     v0.1:
23       type: 'object'
24       # NOTE: To be properly modeled by Daisy maintainers
25   fuel:
26     v0.1:
27       type: 'object'
28       properties:
29         jumphost:
30           type: 'object'
31           properties:
32             bridges:
33               type: 'object'
34               properties:
35                 admin:
36                   type: ['string', 'null']
37                 mgmt:
38                   type: ['string', 'null']
39                 private:
40                   type: ['string', 'null']
41                 public:
42                   type: ['string', 'null']
43               required: ['admin', 'mgmt', 'private', 'public']
44               additionalProperties: false
45             trunks:
46               type: 'object'
47               properties:
48                 mgmt:
49                   type: 'boolean'
50               required: ['mgmt']
51               additionalProperties: false
52           required: ['bridges']
53           additionalProperties: false
54         maas:
55           type: 'object'
56           properties:
57             timeout_comissioning:
58               type: 'number'
59             timeout_deploying:
60               type: 'number'
61           required: ['timeout_comissioning', 'timeout_deploying']
62           additionalProperties: false
63         network:
64           type: 'object'
65           properties:
66             ntp_strata_host1:
67               type: 'string'
68             ntp_strata_host2:
69               type: 'string'
70             node:
71               type: 'array'
72               items:
73                 type: 'object'
74                 properties:
75                   interfaces:
76                     type: 'array'
77                     items:
78                       type: ['string', 'null']
79                   busaddr:
80                     type: 'array'
81                     items:
82                       type: ['string', 'null']
83                 required: ['interfaces', 'busaddr']
84                 additionalProperties: false
85           required: ['node']
86           additionalProperties: false
87         reclass:  # Optional
88           type: 'object'
89           properties:
90             node:
91               type: 'array'
92               items:
93                 type: 'object'
94                 properties:
95                   compute_params:
96                     type: 'object'
97                     properties:
98                       common:  # Optional
99                         type: 'object'
100                         properties: &compute_params_common_properties
101                           nova_cpu_pinning:  # Optional
102                             type: 'string'
103                           compute_hugepages_size:
104                             type: 'string'
105                             enum: ['2M', '1G']
106                           compute_hugepages_count:
107                             type: 'number'
108                           compute_hugepages_mount:
109                             type: 'string'
110                           compute_kernel_isolcpu:  # Optional
111                             type: 'string'
112                           compute_ovs_pmd_cpu_mask:  # Optional
113                             type: ['string', 'number']
114                           compute_ovs_memory_channels:  # Optional
115                             type: ['string', 'number']
116                         required: ['compute_hugepages_size', 'compute_hugepages_count',
117                                    'compute_hugepages_mount']
118                         additionalProperties: false
119                       dpdk:  # Optional
120                         type: 'object'
121                         properties:
122                           <<: *compute_params_common_properties
123                           compute_dpdk_driver:
124                             type: 'string'
125                           compute_ovs_dpdk_socket_mem:
126                             type: ['string', 'number']
127                           compute_ovs_dpdk_lcore_mask:
128                             type: ['string', 'number']
129                           dpdk0_driver:
130                             type: 'string'
131                           dpdk0_n_rxq:
132                             type: 'number'
133                         required: ['compute_dpdk_driver', 'dpdk0_driver', 'dpdk0_n_rxq',
134                                    'compute_ovs_dpdk_socket_mem',
135                                    'compute_ovs_dpdk_lcore_mask']
136                         additionalProperties: false
137                     additionalProperties: false
138                 required: ['compute_params']
139                 additionalProperties: false
140           required: ['node']
141           additionalProperties: false
142       required: ['jumphost', 'network']
143       additionalProperties: false
144   osa:
145     v0.1:
146       type: 'object'
147       properties:
148         nodes_roles:
149           type: 'object'
150         groups:
151           type: 'object'
152         hostnames:
153           type: 'object'
154         network:
155           type: 'object'
156       required: ['nodes_roles', 'groups', 'hostnames', 'network']
157       additionalProperties: false
158   kubespray:
159     v0.1:
160       type: ['object', 'null']
161       # NOTE: To be properly modeled by XCI maintainers
162
163 ##############################################################################
164 # Top-level structure:
165 # - define all possible top-level and second-level keys, without enforcing a
166 #   schema for second-level, just so we can disallow additional properties;
167 # - require 'version' and allow dynamically generated 'version_x.y' key;
168 properties:
169   idf:
170     properties:
171       # version_x.y keys are auto-added by `validate_schema.py` based on 'version'
172       version_0.1:
173         type: 'boolean'
174       version:
175         type: 'number'
176         enum: [0.1]
177       installer:
178         type: 'array'
179         items:
180           type: 'string'
181           enum: ['apex', 'compass4nfv', 'daisy', 'fuel', 'joid', 'osa', 'kubespray']
182       net_config:
183         type: 'object'
184       compass:
185         type: 'object'
186       daisy:
187         type: 'object'
188       fuel:
189         type: 'object'
190       osa:
191         type: ['object', 'null']
192       kubespray:
193         type: ['object', 'null']
194     required: ['version']
195     additionalProperties: false
196     ############################################################################
197     # Schema versioning
198     # - based on dynamically added 'version_x.y', require additional IDF blocks
199     #   and validate them against the proper schema version;
200     dependencies:
201       version_0.1:
202         properties:
203           net_config:
204             $ref: '#/definitions/net_config/v0.1'
205           compass:
206             $ref: '#/definitions/compass/v0.1'
207           daisy:
208             $ref: '#/definitions/daisy/v0.1'
209           fuel:
210             $ref: '#/definitions/fuel/v0.1'
211           osa:
212             $ref: '#/definitions/osa/v0.1'
213           kubespray:
214             $ref: '#/definitions/kubespray/v0.1'
215       fuel:
216         required: ['net_config']
217       daisy:
218         required: ['net_config']
219       osa:
220         required: ['net_config']
221       kubespray:
222         required: ['net_config']
223   xci:
224     type: 'object'
225     # NOTE: To be properly modeled by XCI maintainers
226
227 # Do not allow any properties not defined here. This lets us catch typos.
228 additionalProperties: false
229 required: ['idf']