[PDF] [SPEC] disk_interface: Add 'scsi', 'iscsi'
[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   ip_address:
14     type: 'string'  # NOTE: we don't validate this is a valid addr (yet)
15   mac_address:
16     type: 'string'
17     pattern: '^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$'
18   # Common node schema for jumpserver, cluster nodes
19   node:
20     type: 'object'
21     properties:
22       type:
23         type: 'string'
24         enum: ['baremetal', 'virtual']
25       vendor:
26         type: 'string'
27       model:
28         type: 'string'
29       arch:
30         type: 'string'
31         enum: ['aarch64', 'x86_64']
32       cpus:
33         type: 'number'
34       cpu_cflags:
35         type: 'string'
36       cores:
37         type: 'number'
38       memory:
39         type: 'string'
40         pattern: '^[0-9]+[GT]B?$'
41     required: ['type', 'vendor', 'model', 'arch', 'cpus', 'cpu_cflags', 'cores', 'memory']
42     additionalProperties: false
43   disks:
44     type: 'array'
45     items:
46       type: 'object'
47       properties:
48         name:
49           type: 'string'
50           pattern: '^disk[0-9]+$'
51         disk_capacity:
52           type: 'string'
53           pattern: '^[0-9]+[MGT]B?$'
54         disk_type:
55           type: 'string'
56           enum: ['hdd', 'ssd', 'cdrom', 'tape']
57         disk_interface:
58           type: 'string'
59           enum: ['sata', 'sas', 'ssd', 'nvme', 'scsi', 'iscsi']
60         disk_rotation:
61           type: 'number'
62           enum: [0, 5400, 7200, 10000, 15000]
63       required: ['name', 'disk_capacity', 'disk_type', 'disk_interface', 'disk_rotation']
64       additionalProperties: false
65   remote_management:
66     type: 'object'
67     properties:
68       type:
69         type: 'string'
70         enum: ['ipmi', 'amt']
71       versions:
72         type: 'array'
73         items:
74           type: 'number'
75           enum: [1.0, 2.0]
76       user:
77         type: 'string'
78       pass:
79         type: 'string'
80       address:
81         $ref: '#/definitions/ip_address'
82       mac_address:
83         $ref: '#/definitions/mac_address'
84     required: ['type', 'versions', 'user', 'pass', 'address', 'mac_address']
85     additionalProperties: false
86   interfaces:
87     type: 'array'
88     items:
89       type: 'object'
90       properties:
91         name:
92           type: 'string'
93           pattern: '^nic[0-9]+$'
94         mac_address:
95           $ref: '#/definitions/mac_address'
96         # Optional
97         address:
98           $ref: '#/definitions/ip_address'
99         # Optional
100         vlan:
101           oneOf:
102             - type: 'string'
103               pattern: '^(native|[1-9][0-9]{0,3})(\|(native|[1-9][0-9]{0,3}))*$'
104             - type: 'integer'
105               mininum: 1
106               maximum: 4095
107         # Optional
108         speed:
109           type: 'string'
110           enum: ['1gb', '10gb', '25gb', '40gb']
111           # FIXME: mandatory for nodes?
112         # Optional
113         features:
114           type: ['string', 'null']
115           pattern: '^((dpdk|sriov)\|?)*$'
116           # FIXME: mandatory for nodes?
117       required: ['name', 'mac_address']
118       additionalProperties: false
119
120 # Do not allow any properties not defined here. This lets us catch typos.
121 additionalProperties: false
122
123 properties:
124   details:
125     type: 'object'
126     properties:
127       type:
128         type: 'string'
129         enum: ['production', 'development']
130       pod_owner:
131         type: 'string'
132       contact:
133         type: 'string'
134         pattern: '^([a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+[,; ]*)+$'
135       lab:
136         type: 'string'
137       location:
138         type: 'string'
139       link:
140         type: 'string'
141     required: ['type', 'pod_owner', 'contact', 'lab', 'location', 'link']
142     additionalProperties: false
143   jumphost:
144     type: 'object'
145     properties:
146       name:
147         type: 'string'
148       node:
149         $ref: '#/definitions/node'
150       disks:
151         $ref: '#/definitions/disks'
152       os:
153         type: 'string'
154       remote_params:  # Optional YAML anchor, contents will be validated below
155         type: 'object'
156       remote_management:
157         $ref: '#/definitions/remote_management'
158       interfaces:
159         $ref: '#/definitions/interfaces'
160     required: ['name', 'node', 'disks', 'os', 'remote_management', 'interfaces']
161     additionalProperties: false
162   nodes:
163     type: 'array'
164     items:
165       type: 'object'
166       properties:
167         name:
168           type: 'string'
169         node:
170           $ref: '#/definitions/node'
171         disks:
172           $ref: '#/definitions/disks'
173         os:
174           type: 'string'
175         remote_params:  # Optional YAML anchor, contents will be validated after inject
176           type: 'object'
177         remote_management:
178           $ref: '#/definitions/remote_management'
179         interfaces:
180           $ref: '#/definitions/interfaces'
181       required: ['name', 'node', 'disks', 'remote_management', 'interfaces']
182       additionalProperties: false