Skip to content

Commit d9381bf

Browse files
committed
WIP: First version of the JSON schema for system/storage
1 parent 73cf50a commit d9381bf

File tree

1 file changed

+305
-0
lines changed

1 file changed

+305
-0
lines changed
Lines changed: 305 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,305 @@
1+
{
2+
"title": "System",
3+
"description": "API description of the system",
4+
"type": "object",
5+
"additionalProperties": false,
6+
"properties": {
7+
"devices": {
8+
"description": "All relevant devices on the system",
9+
"type": "array",
10+
"items": { "$ref": "#/$defs/device" }
11+
},
12+
"availableDrives": {
13+
"description": "SIDs of the available drives",
14+
"type": "array",
15+
"items": { "type": "integer" }
16+
},
17+
"availableMdRaids": {
18+
"description": "SIDs of the available MD RAIDs",
19+
"type": "array",
20+
"items": { "type": "integer" }
21+
},
22+
"candidateDrives": {
23+
"description": "SIDs of the drives that are candidate for installation",
24+
"type": "array",
25+
"items": { "type": "integer" }
26+
},
27+
"candidateMdRaids": {
28+
"description": "SIDs of the MD RAIDs that are candidate for installation",
29+
"type": "array",
30+
"items": { "type": "integer" }
31+
},
32+
"productMountPoints": {
33+
"description": "Meaningful mount points for the current product",
34+
"type": "array",
35+
"items": { "type": "string" }
36+
},
37+
"encryptionMethods": {
38+
"description": "Possible encryption methods for the current system and product",
39+
"type": "array",
40+
"items": { "type": "string" }
41+
},
42+
"volumeTemplates": {
43+
"description": "Volumes defined by the product as templates",
44+
"type": "array",
45+
"items": { "$ref": "#/$defs/volume" }
46+
},
47+
"issues": {
48+
"type": "array",
49+
"items": { "$ref": "#/$defs/issue" }
50+
}
51+
},
52+
"$defs": {
53+
"device": {
54+
"type": "object",
55+
"additionalProperties": false,
56+
"required": ["sid", "name"],
57+
"properties": {
58+
"sid": { "type": "integer" },
59+
"name": { "type": "string" },
60+
"description": { "type": "string" },
61+
"block": { "$ref": "#/$defs/block" },
62+
"drive": { "$ref": "#/$defs/drive" },
63+
"filesystem": { "$ref": "#/$defs/filesystem" },
64+
"md": { "$ref": "#/$defs/md" },
65+
"multipath": { "$ref": "#/$defs/multipath" },
66+
"partitionTable": { "$ref": "#/$defs/partitionTable" },
67+
"partition": { "$ref": "#/$defs/partition" },
68+
"partitions": {
69+
"type": "array",
70+
"items": { "$ref": "#/$defs/device" }
71+
},
72+
"volumeGroup": { "$ref": "#/$defs/volumeGroup" },
73+
"logicalVolumes": {
74+
"type": "array",
75+
"items": { "$ref": "#/$defs/device" }
76+
}
77+
}
78+
},
79+
"block": {
80+
"type": "object",
81+
"additionalProperties": false,
82+
"required": ["start", "size", "shrinking"],
83+
"properties": {
84+
"start": { "type": "integer" },
85+
"size": { "type": "integer" },
86+
"active": { "type": "boolean" },
87+
"encrypted": { "type": "boolean" },
88+
"udevIds": {
89+
"type": "array",
90+
"items": { "type": "string" }
91+
},
92+
"udevPaths": {
93+
"type": "array",
94+
"items": { "type": "string" }
95+
},
96+
"systems": {
97+
"type": "array",
98+
"items": { "type": "string" }
99+
},
100+
"shrinking": {
101+
"anyOf": [
102+
{ "$ref": "#/$defs/shrinkingSupported" },
103+
{ "$ref": "#/$defs/shrinkingUnsupported" }
104+
]
105+
}
106+
}
107+
},
108+
"shrinkingSupported": {
109+
"type": "object",
110+
"additionalProperties": false,
111+
"properties": {
112+
"supported": { "type": "integer" }
113+
}
114+
},
115+
"shrinkingUnsupported": {
116+
"type": "object",
117+
"additionalProperties": false,
118+
"properties": {
119+
"unsupported": {
120+
"type": "array",
121+
"items": { "type": "string" }
122+
}
123+
}
124+
},
125+
"drive": {
126+
"type": "object",
127+
"additionalProperties": false,
128+
"properties": {
129+
"type": { "enum": ["disk", "raid", "multipath", "dasd"] },
130+
"vendor": { "type": "string" },
131+
"model": { "type": "string" },
132+
"transport": { "type": "string" },
133+
"bus": { "type": "string" },
134+
"busId": { "type": "string" },
135+
"driver": {
136+
"type": "array",
137+
"items": { "type": "string" }
138+
},
139+
"info": { "$ref": "#/$defs/driveInfo" }
140+
}
141+
},
142+
"driveInfo": {
143+
"type": "object",
144+
"additionalProperties": false,
145+
"properties": {
146+
"sdCard": { "type": "boolean" },
147+
"dellBoss": { "type": "boolean" }
148+
}
149+
},
150+
"filesystem": {
151+
"type": "object",
152+
"additionalProperties": false,
153+
"required": ["sid", "type"],
154+
"properties": {
155+
"sid": { "type": "integer" },
156+
"type": { "$ref": "#/$defs/filesystemType" },
157+
"mountPath": { "type": "string" },
158+
"label": { "type": "string" }
159+
}
160+
},
161+
"filesystemType": {
162+
"enum": [
163+
"bcachefs",
164+
"btrfs",
165+
"exfat",
166+
"ext2",
167+
"ext3",
168+
"ext4",
169+
"f2fs",
170+
"jfs",
171+
"nfs",
172+
"nilfs2",
173+
"ntfs",
174+
"reiserfs",
175+
"swap",
176+
"tmpfs",
177+
"vfat",
178+
"xfs"
179+
]
180+
},
181+
"md": {
182+
"type": "object",
183+
"additionalProperties": false,
184+
"required": ["level", "devices"],
185+
"properties": {
186+
"level": { "$ref": "#/$defs/mdRaidLevel" },
187+
"devices": {
188+
"type": "array",
189+
"items": { "type": "integer" }
190+
},
191+
"uuid": { "type": "string" }
192+
}
193+
},
194+
"mdRaidLevel": {
195+
"title": "MD level",
196+
"enum": [
197+
"raid0",
198+
"raid1",
199+
"raid5",
200+
"raid6",
201+
"raid10"
202+
]
203+
},
204+
"multipath": {
205+
"type": "object",
206+
"additionalProperties": false,
207+
"required": ["wireNames"],
208+
"properties": {
209+
"wireNames": {
210+
"type": "array",
211+
"items": { "type": "string" }
212+
}
213+
}
214+
},
215+
"partitionTable": {
216+
"type": "object",
217+
"additionalProperties": false,
218+
"required": ["type", "unusedSlots"],
219+
"properties": {
220+
"type": { "$ref": "#/$defs/ptableType" },
221+
"unusedSlots": {
222+
"type": "array",
223+
"items": {
224+
"type": "array",
225+
"items": { "type": "integer" }
226+
}
227+
}
228+
}
229+
},
230+
"ptableType": {
231+
"enum": ["gpt", "msdos", "dasd"]
232+
},
233+
"partition": {
234+
"type": "object",
235+
"additionalProperties": false,
236+
"required": ["efi"],
237+
"properties": {
238+
"efi": { "type": "boolean" }
239+
}
240+
},
241+
"volumeGroup": {
242+
"type": "object",
243+
"additionalProperties": false,
244+
"required": ["size", "physicalVolumes"],
245+
"properties": {
246+
"size": { "type": "integer" },
247+
"physicalVolumes": {
248+
"type": "array",
249+
"items": { "type": "integer" }
250+
}
251+
}
252+
},
253+
"volume": {
254+
"type": "object",
255+
"additionalProperties": false,
256+
"required": ["mountPath", "minSize", "autoSize"],
257+
"properties": {
258+
"mountPath": { "type": "string" },
259+
"mountOptions": {
260+
"type": "array",
261+
"items": { "type": "string" }
262+
},
263+
"fsType": { "$ref": "#/$defs/filesystemType" },
264+
"autoSize": { "type": "boolean" },
265+
"minSize": { "type": "integer" },
266+
"maxSize": { "type": "integer" },
267+
"snapshots": { "type": "boolean" },
268+
"transactional": { "type": "boolean" },
269+
"outline": { "$ref": "#/$defs/volumeOutline" }
270+
}
271+
},
272+
"volumeOutline": {
273+
"type": "object",
274+
"additionalProperties": false,
275+
"required": ["required", "supportAutoSize"],
276+
"properties": {
277+
"required": { "type": "boolean" },
278+
"supportAutoSize": { "type": "boolean" },
279+
"fsTypes": {
280+
"type": "array",
281+
"items": { "$ref": "#/$defs/filesystemType" }
282+
},
283+
"adjustByRam": { "type": "boolean" },
284+
"snapshotsConfigurable": { "type": "boolean" },
285+
"snapshotsAffectSizes": { "type": "boolean" },
286+
"sizeRelevantVolumes": {
287+
"type": "array",
288+
"items": { "type": "string" }
289+
}
290+
}
291+
},
292+
"issue": {
293+
"type": "object",
294+
"additionalProperties": false,
295+
"required": ["description"],
296+
"properties": {
297+
"description": { "type": "string" },
298+
"class": { "type": "string" },
299+
"details": { "type": "string" },
300+
"source": { "enum": ["config", "system"] },
301+
"severity": { "enum": ["warn", "error"] }
302+
}
303+
}
304+
}
305+
}

0 commit comments

Comments
 (0)