blob: 07cb3d52225b127ed3c14f06f730c130dd0559b0 [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",
39 "minimum": 1
40 },
41 "units": {
42 "type": "object",
43 "additionalProperties": false,
44 "patternProperties": {
45 "^\\w+$": {
46 "type": "string",
47 "pattern": "^\\w+(\\/\\w+)*$"
48 }
49 }
50 },
51 "buses": {
52 "type": "object",
53 "additionalProperties": false,
54 "patternProperties": {
55 "^\\w+$": {
56 "type": "object",
57 "additionalProperties": false,
Patrick Williams8b10d692022-12-08 06:13:21 -060058 "required": ["type"],
Caleb Palmere36866c2022-10-31 15:14:29 -050059 "properties": {
60 "type": {
61 "type": "string",
Patrick Williams8b10d692022-12-08 06:13:21 -060062 "enum": ["SMP_BUS", "OMI_BUS"]
Caleb Palmere36866c2022-10-31 15:14:29 -050063 },
64 "unit": {
65 "type": "string",
66 "pattern": "^\\w+$"
67 }
68 }
69 }
70 }
71 },
72 "actions": {
73 "type": "object",
74 "additionalProperties": false,
75 "patternProperties": {
76 "^\\w+$": {
77 "type": "array",
78 "items": {
79 "type": "object",
Patrick Williams8b10d692022-12-08 06:13:21 -060080 "required": ["type"],
Caleb Palmere36866c2022-10-31 15:14:29 -050081 "properties": {
82 "type": {
83 "type": "string",
84 "enum": [
85 "action",
86 "callout_self",
87 "callout_unit",
88 "callout_connected",
89 "callout_bus",
90 "callout_clock",
91 "callout_procedure",
92 "callout_part",
93 "plugin",
94 "flag"
95 ]
96 },
97 "priority": {
98 "$ref": "#/$defs/priority"
99 },
100 "guard": {
101 "type": "boolean"
102 },
103 "name": {
104 "type": "string",
105 "pattern": "^\\w+$"
106 }
107 },
108 "allOf": [
109 {
110 "if": {
111 "properties": {
112 "type": { "const": "action" }
113 }
114 },
115 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600116 "required": ["name"],
117 "not": { "required": ["priority", "guard"] }
Caleb Palmere36866c2022-10-31 15:14:29 -0500118 }
119 },
120 {
121 "if": {
122 "properties": {
123 "type": { "const": "callout_self" }
124 }
125 },
126 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600127 "required": ["priority", "guard"],
128 "not": { "required": ["name"] }
Caleb Palmere36866c2022-10-31 15:14:29 -0500129 }
130 },
131 {
132 "if": {
133 "properties": {
134 "type": { "const": "callout_unit" }
135 }
136 },
137 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600138 "required": ["name", "priority", "guard"]
Caleb Palmere36866c2022-10-31 15:14:29 -0500139 }
140 },
141 {
142 "if": {
143 "properties": {
144 "type": { "const": "callout_connected" }
145 }
146 },
147 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600148 "required": ["name", "priority", "guard"]
Caleb Palmere36866c2022-10-31 15:14:29 -0500149 }
150 },
151 {
152 "if": {
153 "properties": {
154 "type": { "const": "callout_bus" }
155 }
156 },
157 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600158 "required": ["name", "priority", "guard"]
Caleb Palmere36866c2022-10-31 15:14:29 -0500159 }
160 },
161 {
162 "if": {
163 "properties": {
164 "type": { "const": "callout_clock" }
165 }
166 },
167 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600168 "required": ["name", "priority", "guard"],
Caleb Palmere36866c2022-10-31 15:14:29 -0500169 "properties": {
170 "name": {
171 "enum": [
172 "OSC_REF_CLOCK_0",
173 "OSC_REF_CLOCK_1",
174 "TOD_CLOCK"
175 ]
176 }
177 }
178 }
179 },
180 {
181 "if": {
182 "properties": {
183 "type": { "const": "callout_procedure" }
184 }
185 },
186 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600187 "required": ["name", "priority"],
188 "not": { "required": ["guard"] },
Caleb Palmere36866c2022-10-31 15:14:29 -0500189 "properties": {
190 "name": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600191 "enum": ["LEVEL2", "SUE_SEEN"]
Caleb Palmere36866c2022-10-31 15:14:29 -0500192 }
193 }
194 }
195 },
196 {
197 "if": {
198 "properties": {
199 "type": { "const": "callout_part" }
200 }
201 },
202 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600203 "required": ["name", "priority"],
204 "not": { "required": ["guard"] },
Caleb Palmere36866c2022-10-31 15:14:29 -0500205 "properties": {
206 "name": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600207 "enum": ["PNOR"]
Caleb Palmere36866c2022-10-31 15:14:29 -0500208 }
209 }
210 }
211 },
212 {
213 "if": {
214 "properties": {
215 "type": { "const": "plugin" }
216 }
217 },
218 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600219 "required": ["name", "instance"],
220 "not": {
221 "required": ["priority", "guard"]
222 },
Caleb Palmere36866c2022-10-31 15:14:29 -0500223 "properties": {
224 "instance": {
225 "type": "integer"
226 }
227 }
228 }
229 },
230 {
231 "if": {
232 "properties": {
233 "type": { "const": "flag" }
234 }
235 },
236 "then": {
237 "required": ["name"],
238 "properties": {
239 "name": {
240 "$ref": "#/$defs/flags"
241 }
242 }
243 }
244 }
245 ]
246 }
247 }
248 }
249 },
250 "signatures": {
251 "type": "object",
252 "additionalProperties": false,
253 "patternProperties": {
254 "^[0-9A-Fa-f]{4}$": {
255 "type": "object",
256 "additionalProperties": false,
257 "patternProperties": {
258 "^[0-9A-Fa-f]{2}$": {
259 "type": "object",
260 "additionalProperties": false,
261 "patternProperties": {
262 "^[0-9A-Fa-f]{2}$": {
263 "type": "string",
264 "pattern": "^\\w+$"
265 },
266 "flags": {
267 "type": "array",
268 "minItems": 1,
269 "uniqueItems": true,
Patrick Williams8b10d692022-12-08 06:13:21 -0600270 "items": {
Caleb Palmere36866c2022-10-31 15:14:29 -0500271 "$ref": "#/$defs/flags"
272 }
273 }
274 }
275 }
276 }
277 }
278 }
279 }
280 }
281}