blob: e8f823aa90a33add937933229c8dfa8319baf1a3 [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",
25 "odp_data_corrupt_root_cause"
26 ]
27 }
28 },
29 "additionalProperties": false,
Patrick Williams8b10d692022-12-08 06:13:21 -060030 "required": ["model_ec", "version", "actions", "signatures"],
Caleb Palmere36866c2022-10-31 15:14:29 -050031 "properties": {
32 "model_ec": {
33 "type": "string",
34 "pattern": "^[0-9A-Fa-f]{8}$"
35 },
36 "version": {
37 "type": "integer",
38 "minimum": 1
39 },
40 "units": {
41 "type": "object",
42 "additionalProperties": false,
43 "patternProperties": {
44 "^\\w+$": {
45 "type": "string",
46 "pattern": "^\\w+(\\/\\w+)*$"
47 }
48 }
49 },
50 "buses": {
51 "type": "object",
52 "additionalProperties": false,
53 "patternProperties": {
54 "^\\w+$": {
55 "type": "object",
56 "additionalProperties": false,
Patrick Williams8b10d692022-12-08 06:13:21 -060057 "required": ["type"],
Caleb Palmere36866c2022-10-31 15:14:29 -050058 "properties": {
59 "type": {
60 "type": "string",
Patrick Williams8b10d692022-12-08 06:13:21 -060061 "enum": ["SMP_BUS", "OMI_BUS"]
Caleb Palmere36866c2022-10-31 15:14:29 -050062 },
63 "unit": {
64 "type": "string",
65 "pattern": "^\\w+$"
66 }
67 }
68 }
69 }
70 },
71 "actions": {
72 "type": "object",
73 "additionalProperties": false,
74 "patternProperties": {
75 "^\\w+$": {
76 "type": "array",
77 "items": {
78 "type": "object",
Patrick Williams8b10d692022-12-08 06:13:21 -060079 "required": ["type"],
Caleb Palmere36866c2022-10-31 15:14:29 -050080 "properties": {
81 "type": {
82 "type": "string",
83 "enum": [
84 "action",
85 "callout_self",
86 "callout_unit",
87 "callout_connected",
88 "callout_bus",
89 "callout_clock",
90 "callout_procedure",
91 "callout_part",
92 "plugin",
93 "flag"
94 ]
95 },
96 "priority": {
97 "$ref": "#/$defs/priority"
98 },
99 "guard": {
100 "type": "boolean"
101 },
102 "name": {
103 "type": "string",
104 "pattern": "^\\w+$"
105 }
106 },
107 "allOf": [
108 {
109 "if": {
110 "properties": {
111 "type": { "const": "action" }
112 }
113 },
114 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600115 "required": ["name"],
116 "not": { "required": ["priority", "guard"] }
Caleb Palmere36866c2022-10-31 15:14:29 -0500117 }
118 },
119 {
120 "if": {
121 "properties": {
122 "type": { "const": "callout_self" }
123 }
124 },
125 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600126 "required": ["priority", "guard"],
127 "not": { "required": ["name"] }
Caleb Palmere36866c2022-10-31 15:14:29 -0500128 }
129 },
130 {
131 "if": {
132 "properties": {
133 "type": { "const": "callout_unit" }
134 }
135 },
136 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600137 "required": ["name", "priority", "guard"]
Caleb Palmere36866c2022-10-31 15:14:29 -0500138 }
139 },
140 {
141 "if": {
142 "properties": {
143 "type": { "const": "callout_connected" }
144 }
145 },
146 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600147 "required": ["name", "priority", "guard"]
Caleb Palmere36866c2022-10-31 15:14:29 -0500148 }
149 },
150 {
151 "if": {
152 "properties": {
153 "type": { "const": "callout_bus" }
154 }
155 },
156 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600157 "required": ["name", "priority", "guard"]
Caleb Palmere36866c2022-10-31 15:14:29 -0500158 }
159 },
160 {
161 "if": {
162 "properties": {
163 "type": { "const": "callout_clock" }
164 }
165 },
166 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600167 "required": ["name", "priority", "guard"],
Caleb Palmere36866c2022-10-31 15:14:29 -0500168 "properties": {
169 "name": {
170 "enum": [
171 "OSC_REF_CLOCK_0",
172 "OSC_REF_CLOCK_1",
173 "TOD_CLOCK"
174 ]
175 }
176 }
177 }
178 },
179 {
180 "if": {
181 "properties": {
182 "type": { "const": "callout_procedure" }
183 }
184 },
185 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600186 "required": ["name", "priority"],
187 "not": { "required": ["guard"] },
Caleb Palmere36866c2022-10-31 15:14:29 -0500188 "properties": {
189 "name": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600190 "enum": ["LEVEL2", "SUE_SEEN"]
Caleb Palmere36866c2022-10-31 15:14:29 -0500191 }
192 }
193 }
194 },
195 {
196 "if": {
197 "properties": {
198 "type": { "const": "callout_part" }
199 }
200 },
201 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600202 "required": ["name", "priority"],
203 "not": { "required": ["guard"] },
Caleb Palmere36866c2022-10-31 15:14:29 -0500204 "properties": {
205 "name": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600206 "enum": ["PNOR"]
Caleb Palmere36866c2022-10-31 15:14:29 -0500207 }
208 }
209 }
210 },
211 {
212 "if": {
213 "properties": {
214 "type": { "const": "plugin" }
215 }
216 },
217 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600218 "required": ["name", "instance"],
219 "not": {
220 "required": ["priority", "guard"]
221 },
Caleb Palmere36866c2022-10-31 15:14:29 -0500222 "properties": {
223 "instance": {
224 "type": "integer"
225 }
226 }
227 }
228 },
229 {
230 "if": {
231 "properties": {
232 "type": { "const": "flag" }
233 }
234 },
235 "then": {
236 "required": ["name"],
237 "properties": {
238 "name": {
239 "$ref": "#/$defs/flags"
240 }
241 }
242 }
243 }
244 ]
245 }
246 }
247 }
248 },
249 "signatures": {
250 "type": "object",
251 "additionalProperties": false,
252 "patternProperties": {
253 "^[0-9A-Fa-f]{4}$": {
254 "type": "object",
255 "additionalProperties": false,
256 "patternProperties": {
257 "^[0-9A-Fa-f]{2}$": {
258 "type": "object",
259 "additionalProperties": false,
260 "patternProperties": {
261 "^[0-9A-Fa-f]{2}$": {
262 "type": "string",
263 "pattern": "^\\w+$"
264 },
265 "flags": {
266 "type": "array",
267 "minItems": 1,
268 "uniqueItems": true,
Patrick Williams8b10d692022-12-08 06:13:21 -0600269 "items": {
Caleb Palmere36866c2022-10-31 15:14:29 -0500270 "$ref": "#/$defs/flags"
271 }
272 }
273 }
274 }
275 }
276 }
277 }
278 }
279 }
280}