Caleb Palmer | e36866c | 2022-10-31 15:14:29 -0500 | [diff] [blame] | 1 | { |
| 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 Williams | 8b10d69 | 2022-12-08 06:13:21 -0600 | [diff] [blame] | 9 | "enum": ["HIGH", "MED", "MED_A", "MED_B", "MED_C", "LOW"] |
Caleb Palmer | e36866c | 2022-10-31 15:14:29 -0500 | [diff] [blame] | 10 | }, |
| 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 Palmer | 51f8202 | 2023-02-22 16:09:09 -0600 | [diff] [blame] | 25 | "odp_data_corrupt_root_cause", |
| 26 | "attn_from_ocmb" |
Caleb Palmer | e36866c | 2022-10-31 15:14:29 -0500 | [diff] [blame] | 27 | ] |
| 28 | } |
| 29 | }, |
| 30 | "additionalProperties": false, |
Patrick Williams | 8b10d69 | 2022-12-08 06:13:21 -0600 | [diff] [blame] | 31 | "required": ["model_ec", "version", "actions", "signatures"], |
Caleb Palmer | e36866c | 2022-10-31 15:14:29 -0500 | [diff] [blame] | 32 | "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 Williams | 8b10d69 | 2022-12-08 06:13:21 -0600 | [diff] [blame] | 58 | "required": ["type"], |
Caleb Palmer | e36866c | 2022-10-31 15:14:29 -0500 | [diff] [blame] | 59 | "properties": { |
| 60 | "type": { |
| 61 | "type": "string", |
Patrick Williams | 8b10d69 | 2022-12-08 06:13:21 -0600 | [diff] [blame] | 62 | "enum": ["SMP_BUS", "OMI_BUS"] |
Caleb Palmer | e36866c | 2022-10-31 15:14:29 -0500 | [diff] [blame] | 63 | }, |
| 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 Williams | 8b10d69 | 2022-12-08 06:13:21 -0600 | [diff] [blame] | 80 | "required": ["type"], |
Caleb Palmer | e36866c | 2022-10-31 15:14:29 -0500 | [diff] [blame] | 81 | "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 Williams | 8b10d69 | 2022-12-08 06:13:21 -0600 | [diff] [blame] | 116 | "required": ["name"], |
| 117 | "not": { "required": ["priority", "guard"] } |
Caleb Palmer | e36866c | 2022-10-31 15:14:29 -0500 | [diff] [blame] | 118 | } |
| 119 | }, |
| 120 | { |
| 121 | "if": { |
| 122 | "properties": { |
| 123 | "type": { "const": "callout_self" } |
| 124 | } |
| 125 | }, |
| 126 | "then": { |
Patrick Williams | 8b10d69 | 2022-12-08 06:13:21 -0600 | [diff] [blame] | 127 | "required": ["priority", "guard"], |
| 128 | "not": { "required": ["name"] } |
Caleb Palmer | e36866c | 2022-10-31 15:14:29 -0500 | [diff] [blame] | 129 | } |
| 130 | }, |
| 131 | { |
| 132 | "if": { |
| 133 | "properties": { |
| 134 | "type": { "const": "callout_unit" } |
| 135 | } |
| 136 | }, |
| 137 | "then": { |
Patrick Williams | 8b10d69 | 2022-12-08 06:13:21 -0600 | [diff] [blame] | 138 | "required": ["name", "priority", "guard"] |
Caleb Palmer | e36866c | 2022-10-31 15:14:29 -0500 | [diff] [blame] | 139 | } |
| 140 | }, |
| 141 | { |
| 142 | "if": { |
| 143 | "properties": { |
| 144 | "type": { "const": "callout_connected" } |
| 145 | } |
| 146 | }, |
| 147 | "then": { |
Patrick Williams | 8b10d69 | 2022-12-08 06:13:21 -0600 | [diff] [blame] | 148 | "required": ["name", "priority", "guard"] |
Caleb Palmer | e36866c | 2022-10-31 15:14:29 -0500 | [diff] [blame] | 149 | } |
| 150 | }, |
| 151 | { |
| 152 | "if": { |
| 153 | "properties": { |
| 154 | "type": { "const": "callout_bus" } |
| 155 | } |
| 156 | }, |
| 157 | "then": { |
Patrick Williams | 8b10d69 | 2022-12-08 06:13:21 -0600 | [diff] [blame] | 158 | "required": ["name", "priority", "guard"] |
Caleb Palmer | e36866c | 2022-10-31 15:14:29 -0500 | [diff] [blame] | 159 | } |
| 160 | }, |
| 161 | { |
| 162 | "if": { |
| 163 | "properties": { |
| 164 | "type": { "const": "callout_clock" } |
| 165 | } |
| 166 | }, |
| 167 | "then": { |
Patrick Williams | 8b10d69 | 2022-12-08 06:13:21 -0600 | [diff] [blame] | 168 | "required": ["name", "priority", "guard"], |
Caleb Palmer | e36866c | 2022-10-31 15:14:29 -0500 | [diff] [blame] | 169 | "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 Williams | 8b10d69 | 2022-12-08 06:13:21 -0600 | [diff] [blame] | 187 | "required": ["name", "priority"], |
| 188 | "not": { "required": ["guard"] }, |
Caleb Palmer | e36866c | 2022-10-31 15:14:29 -0500 | [diff] [blame] | 189 | "properties": { |
| 190 | "name": { |
Patrick Williams | 8b10d69 | 2022-12-08 06:13:21 -0600 | [diff] [blame] | 191 | "enum": ["LEVEL2", "SUE_SEEN"] |
Caleb Palmer | e36866c | 2022-10-31 15:14:29 -0500 | [diff] [blame] | 192 | } |
| 193 | } |
| 194 | } |
| 195 | }, |
| 196 | { |
| 197 | "if": { |
| 198 | "properties": { |
| 199 | "type": { "const": "callout_part" } |
| 200 | } |
| 201 | }, |
| 202 | "then": { |
Patrick Williams | 8b10d69 | 2022-12-08 06:13:21 -0600 | [diff] [blame] | 203 | "required": ["name", "priority"], |
| 204 | "not": { "required": ["guard"] }, |
Caleb Palmer | e36866c | 2022-10-31 15:14:29 -0500 | [diff] [blame] | 205 | "properties": { |
| 206 | "name": { |
Patrick Williams | 8b10d69 | 2022-12-08 06:13:21 -0600 | [diff] [blame] | 207 | "enum": ["PNOR"] |
Caleb Palmer | e36866c | 2022-10-31 15:14:29 -0500 | [diff] [blame] | 208 | } |
| 209 | } |
| 210 | } |
| 211 | }, |
| 212 | { |
| 213 | "if": { |
| 214 | "properties": { |
| 215 | "type": { "const": "plugin" } |
| 216 | } |
| 217 | }, |
| 218 | "then": { |
Patrick Williams | 8b10d69 | 2022-12-08 06:13:21 -0600 | [diff] [blame] | 219 | "required": ["name", "instance"], |
| 220 | "not": { |
| 221 | "required": ["priority", "guard"] |
| 222 | }, |
Caleb Palmer | e36866c | 2022-10-31 15:14:29 -0500 | [diff] [blame] | 223 | "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 Williams | 8b10d69 | 2022-12-08 06:13:21 -0600 | [diff] [blame] | 270 | "items": { |
Caleb Palmer | e36866c | 2022-10-31 15:14:29 -0500 | [diff] [blame] | 271 | "$ref": "#/$defs/flags" |
| 272 | } |
| 273 | } |
| 274 | } |
| 275 | } |
| 276 | } |
| 277 | } |
| 278 | } |
| 279 | } |
| 280 | } |
| 281 | } |