blob: b5d203e44d7812a85c26a8b3983d5cf162ca4ffa [file] [log] [blame]
Zane Shelley90d12522021-07-20 13:20:10 -05001{
2 "$schema": "https://json-schema.org/draft/2020-12/schema",
3 "title": "RAS Data schema for openpower-hw-diags",
Zane Shelleyee54c992021-08-08 17:46:48 -05004 "version": 1,
Zane Shelley90d12522021-07-20 13:20:10 -05005 "type": "object",
Zane Shelley869d9bb2021-08-05 10:46:47 -05006 "definitions": {
7 "priority": {
8 "type": "string",
Patrick Williams8b10d692022-12-08 06:13:21 -06009 "enum": ["HIGH", "MED", "MED_A", "MED_B", "MED_C", "LOW"]
Zane Shelley869d9bb2021-08-05 10:46:47 -050010 }
11 },
Zane Shelley90d12522021-07-20 13:20:10 -050012 "additionalProperties": false,
Patrick Williams8b10d692022-12-08 06:13:21 -060013 "required": ["model_ec", "version", "actions", "signatures"],
Zane Shelley90d12522021-07-20 13:20:10 -050014 "properties": {
15 "model_ec": {
16 "type": "string",
17 "pattern": "^[0-9A-Fa-f]{8}$"
18 },
19 "version": {
20 "type": "integer",
21 "minimum": 1
22 },
23 "units": {
24 "type": "object",
25 "additionalProperties": false,
26 "patternProperties": {
27 "^\\w+$": {
28 "type": "string",
29 "pattern": "^\\w+(\\/\\w+)*$"
30 }
31 }
32 },
33 "buses": {
34 "type": "object",
35 "additionalProperties": false,
36 "patternProperties": {
37 "^\\w+$": {
38 "type": "object",
39 "additionalProperties": false,
Patrick Williams8b10d692022-12-08 06:13:21 -060040 "required": ["type"],
Zane Shelley90d12522021-07-20 13:20:10 -050041 "properties": {
42 "type": {
43 "type": "string",
Patrick Williams8b10d692022-12-08 06:13:21 -060044 "enum": ["SMP_BUS", "OMI_BUS"]
Zane Shelley90d12522021-07-20 13:20:10 -050045 },
46 "unit": {
47 "type": "string",
48 "pattern": "^\\w+$"
49 }
50 }
51 }
52 }
53 },
54 "actions": {
55 "type": "object",
56 "additionalProperties": false,
57 "patternProperties": {
58 "^\\w+$": {
59 "type": "array",
60 "items": {
61 "type": "object",
Patrick Williams8b10d692022-12-08 06:13:21 -060062 "required": ["type"],
Zane Shelley90d12522021-07-20 13:20:10 -050063 "properties": {
64 "type": {
65 "type": "string",
66 "enum": [
67 "action",
68 "callout_self",
69 "callout_unit",
70 "callout_connected",
71 "callout_bus",
72 "callout_clock",
73 "callout_procedure",
74 "callout_part",
75 "plugin"
76 ]
77 },
78 "priority": {
Zane Shelley869d9bb2021-08-05 10:46:47 -050079 "$ref": "#/definitions/priority"
Zane Shelley90d12522021-07-20 13:20:10 -050080 },
81 "guard": {
82 "type": "boolean"
83 },
84 "name": {
85 "type": "string",
86 "pattern": "^\\w+$"
87 }
88 },
89 "allOf": [
90 {
91 "if": {
92 "properties": {
93 "type": { "const": "action" }
94 }
95 },
96 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -060097 "required": ["name"],
98 "not": { "required": ["priority", "guard"] }
Zane Shelley90d12522021-07-20 13:20:10 -050099 }
100 },
101 {
102 "if": {
103 "properties": {
104 "type": { "const": "callout_self" }
105 }
106 },
107 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600108 "required": ["priority", "guard"],
109 "not": { "required": ["name"] }
Zane Shelley90d12522021-07-20 13:20:10 -0500110 }
111 },
112 {
113 "if": {
114 "properties": {
115 "type": { "const": "callout_unit" }
116 }
117 },
118 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600119 "required": ["name", "priority", "guard"]
Zane Shelley90d12522021-07-20 13:20:10 -0500120 }
121 },
122 {
123 "if": {
124 "properties": {
125 "type": { "const": "callout_connected" }
126 }
127 },
128 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600129 "required": ["name", "priority", "guard"]
Zane Shelley90d12522021-07-20 13:20:10 -0500130 }
131 },
132 {
133 "if": {
134 "properties": {
135 "type": { "const": "callout_bus" }
136 }
137 },
138 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600139 "required": ["name", "priority", "guard"]
Zane Shelley90d12522021-07-20 13:20:10 -0500140 }
141 },
142 {
143 "if": {
144 "properties": {
145 "type": { "const": "callout_clock" }
146 }
147 },
148 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600149 "required": ["name", "priority", "guard"],
Zane Shelley90d12522021-07-20 13:20:10 -0500150 "properties": {
Zane Shelley84721d92021-09-08 13:30:27 -0500151 "name": {
152 "enum": [
153 "OSC_REF_CLOCK_0",
Zane Shelleyd195b712022-01-26 13:26:34 -0600154 "OSC_REF_CLOCK_1",
155 "TOD_CLOCK"
Zane Shelley84721d92021-09-08 13:30:27 -0500156 ]
Zane Shelley90d12522021-07-20 13:20:10 -0500157 }
158 }
159 }
160 },
161 {
162 "if": {
163 "properties": {
164 "type": { "const": "callout_procedure" }
165 }
166 },
167 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600168 "required": ["name", "priority"],
169 "not": { "required": ["guard"] },
Zane Shelley90d12522021-07-20 13:20:10 -0500170 "properties": {
171 "name": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600172 "enum": ["LEVEL2", "SUE_SEEN"]
Zane Shelley90d12522021-07-20 13:20:10 -0500173 }
174 }
175 }
176 },
177 {
178 "if": {
179 "properties": {
180 "type": { "const": "callout_part" }
181 }
182 },
183 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600184 "required": ["name", "priority"],
185 "not": { "required": ["guard"] },
Zane Shelley90d12522021-07-20 13:20:10 -0500186 "properties": {
187 "name": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600188 "enum": ["PNOR"]
Zane Shelley90d12522021-07-20 13:20:10 -0500189 }
190 }
191 }
192 },
193 {
194 "if": {
195 "properties": {
196 "type": { "const": "plugin" }
197 }
198 },
199 "then": {
Patrick Williams8b10d692022-12-08 06:13:21 -0600200 "required": ["name", "instance"],
201 "not": {
202 "required": ["priority", "guard"]
203 },
Zane Shelleye13a9f92021-12-16 21:19:11 -0600204 "properties": {
205 "instance": {
206 "type": "integer"
207 }
208 }
Zane Shelley90d12522021-07-20 13:20:10 -0500209 }
210 }
211 ]
212 }
213 }
214 }
215 },
216 "signatures": {
217 "type": "object",
218 "additionalProperties": false,
219 "patternProperties": {
220 "^[0-9A-Fa-f]{4}$": {
221 "type": "object",
222 "additionalProperties": false,
223 "patternProperties": {
224 "^[0-9A-Fa-f]{2}$": {
225 "type": "object",
226 "additionalProperties": false,
227 "patternProperties": {
228 "^[0-9A-Fa-f]{2}$": {
229 "type": "string",
230 "pattern": "^\\w+$"
231 }
232 }
233 }
234 }
235 }
236 }
237 }
238 }
239}