blob: 0d96b4dff3c45142f2e841b574017a23fac33e40 [file] [log] [blame]
Caleb Palmere36866c2022-10-31 15:14:29 -05001{
2 "$schema": "https://json-schema.org/draft/2020-12/schema",
3 "title": "RAS Data schema for openpower-hw-diags",
4 "version": 2,
5 "type": "object",
6 "$defs": {
7 "priority": {
8 "type": "string",
Patrick Williams8b10d692022-12-08 06:13:21 -06009 "enum": ["HIGH", "MED", "MED_A", "MED_B", "MED_C", "LOW"]
Caleb Palmere36866c2022-10-31 15:14:29 -050010 },
11 "flags": {
12 "type": "string",
13 "enum": [
14 "sue_source",
15 "sue_seen",
16 "cs_possible",
17 "external_checkstop",
18 "recovered_error",
19 "informational_only",
20 "mnfg_informational_only",
21 "mask_but_dont_clear",
22 "crc_related_err",
23 "crc_root_cause",
24 "odp_data_corrupt_side_effect",
Caleb Palmer51f82022023-02-22 16:09:09 -060025 "odp_data_corrupt_root_cause",
26 "attn_from_ocmb"
Caleb Palmere36866c2022-10-31 15:14:29 -050027 ]
28 }
29 },
30 "additionalProperties": false,
Patrick Williams8b10d692022-12-08 06:13:21 -060031 "required": ["model_ec", "version", "actions", "signatures"],
Caleb Palmere36866c2022-10-31 15:14:29 -050032 "properties": {
33 "model_ec": {
34 "type": "string",
35 "pattern": "^[0-9A-Fa-f]{8}$"
36 },
37 "version": {
38 "type": "integer",
Zane Shelley93b001c2023-03-24 17:45:04 -050039 "minimum": 2,
40 "maximum": 2
Caleb Palmere36866c2022-10-31 15:14:29 -050041 },
42 "units": {
43 "type": "object",
44 "additionalProperties": false,
45 "patternProperties": {
46 "^\\w+$": {
47 "type": "string",
48 "pattern": "^\\w+(\\/\\w+)*$"
49 }
50 }
51 },
52 "buses": {
53 "type": "object",
54 "additionalProperties": false,
55 "patternProperties": {
56 "^\\w+$": {
57 "type": "object",
58 "additionalProperties": false,
Patrick Williams8b10d692022-12-08 06:13:21 -060059 "required": ["type"],
Caleb Palmere36866c2022-10-31 15:14:29 -050060 "properties": {
61 "type": {
62 "type": "string",
Patrick Williams8b10d692022-12-08 06:13:21 -060063 "enum": ["SMP_BUS", "OMI_BUS"]
Caleb Palmere36866c2022-10-31 15:14:29 -050064 },
65 "unit": {
66 "type": "string",
67 "pattern": "^\\w+$"
68 }
69 }
70 }
71 }
72 },
73 "actions": {
74 "type": "object",
75 "additionalProperties": false,
76 "patternProperties": {
77 "^\\w+$": {
78 "type": "array",
79 "items": {
80 "type": "object",
Patrick Williams8b10d692022-12-08 06:13:21 -060081 "required": ["type"],
Caleb Palmere36866c2022-10-31 15:14:29 -050082 "properties": {
83 "type": {
84 "type": "string",
85 "enum": [
86 "action",
87 "callout_self",
88 "callout_unit",
89 "callout_connected",
90 "callout_bus",
91 "callout_clock",
92 "callout_procedure",
93 "callout_part",
94 "plugin",
95 "flag"
96 ]
97 },
98 "priority": {
99 "$ref": "#/$defs/priority"
100 },
101 "guard": {
102 "type": "boolean"
103 },
104 "name": {
105 "type": "string",
106 "pattern": "^\\w+$"
107 }
108 },
109 "allOf": [
110 {
111 "if": {
112 "properties": {
113 "type": { "const": "action" }
114 }
115 },
116 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600117 "required": ["name"],
118 "not": { "required": ["priority", "guard"] }
Caleb Palmere36866c2022-10-31 15:14:29 -0500119 }
120 },
121 {
122 "if": {
123 "properties": {
124 "type": { "const": "callout_self" }
125 }
126 },
127 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600128 "required": ["priority", "guard"],
129 "not": { "required": ["name"] }
Caleb Palmere36866c2022-10-31 15:14:29 -0500130 }
131 },
132 {
133 "if": {
134 "properties": {
135 "type": { "const": "callout_unit" }
136 }
137 },
138 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600139 "required": ["name", "priority", "guard"]
Caleb Palmere36866c2022-10-31 15:14:29 -0500140 }
141 },
142 {
143 "if": {
144 "properties": {
145 "type": { "const": "callout_connected" }
146 }
147 },
148 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600149 "required": ["name", "priority", "guard"]
Caleb Palmere36866c2022-10-31 15:14:29 -0500150 }
151 },
152 {
153 "if": {
154 "properties": {
155 "type": { "const": "callout_bus" }
156 }
157 },
158 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600159 "required": ["name", "priority", "guard"]
Caleb Palmere36866c2022-10-31 15:14:29 -0500160 }
161 },
162 {
163 "if": {
164 "properties": {
165 "type": { "const": "callout_clock" }
166 }
167 },
168 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600169 "required": ["name", "priority", "guard"],
Caleb Palmere36866c2022-10-31 15:14:29 -0500170 "properties": {
171 "name": {
172 "enum": [
173 "OSC_REF_CLOCK_0",
174 "OSC_REF_CLOCK_1",
175 "TOD_CLOCK"
176 ]
177 }
178 }
179 }
180 },
181 {
182 "if": {
183 "properties": {
184 "type": { "const": "callout_procedure" }
185 }
186 },
187 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600188 "required": ["name", "priority"],
189 "not": { "required": ["guard"] },
Caleb Palmere36866c2022-10-31 15:14:29 -0500190 "properties": {
191 "name": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600192 "enum": ["LEVEL2", "SUE_SEEN"]
Caleb Palmere36866c2022-10-31 15:14:29 -0500193 }
194 }
195 }
196 },
197 {
198 "if": {
199 "properties": {
200 "type": { "const": "callout_part" }
201 }
202 },
203 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600204 "required": ["name", "priority"],
205 "not": { "required": ["guard"] },
Caleb Palmere36866c2022-10-31 15:14:29 -0500206 "properties": {
207 "name": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600208 "enum": ["PNOR"]
Caleb Palmere36866c2022-10-31 15:14:29 -0500209 }
210 }
211 }
212 },
213 {
214 "if": {
215 "properties": {
216 "type": { "const": "plugin" }
217 }
218 },
219 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600220 "required": ["name", "instance"],
221 "not": {
222 "required": ["priority", "guard"]
223 },
Caleb Palmere36866c2022-10-31 15:14:29 -0500224 "properties": {
225 "instance": {
226 "type": "integer"
227 }
228 }
229 }
230 },
231 {
232 "if": {
233 "properties": {
234 "type": { "const": "flag" }
235 }
236 },
237 "then": {
238 "required": ["name"],
239 "properties": {
240 "name": {
241 "$ref": "#/$defs/flags"
242 }
243 }
244 }
245 }
246 ]
247 }
248 }
249 }
250 },
251 "signatures": {
252 "type": "object",
253 "additionalProperties": false,
254 "patternProperties": {
255 "^[0-9A-Fa-f]{4}$": {
256 "type": "object",
257 "additionalProperties": false,
258 "patternProperties": {
259 "^[0-9A-Fa-f]{2}$": {
260 "type": "object",
261 "additionalProperties": false,
262 "patternProperties": {
263 "^[0-9A-Fa-f]{2}$": {
264 "type": "string",
265 "pattern": "^\\w+$"
266 },
267 "flags": {
268 "type": "array",
269 "minItems": 1,
270 "uniqueItems": true,
Patrick Williams8b10d692022-12-08 06:13:21 -0600271 "items": {
Caleb Palmere36866c2022-10-31 15:14:29 -0500272 "$ref": "#/$defs/flags"
273 }
274 }
275 }
276 }
277 }
278 }
279 }
280 }
281 }
282}