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", |
| 9 | "enum": [ |
| 10 | "HIGH", |
| 11 | "MED", |
| 12 | "MED_A", |
| 13 | "MED_B", |
| 14 | "MED_C", |
| 15 | "LOW" |
| 16 | ] |
| 17 | }, |
| 18 | "flags": { |
| 19 | "type": "string", |
| 20 | "enum": [ |
| 21 | "sue_source", |
| 22 | "sue_seen", |
| 23 | "cs_possible", |
| 24 | "external_checkstop", |
| 25 | "recovered_error", |
| 26 | "informational_only", |
| 27 | "mnfg_informational_only", |
| 28 | "mask_but_dont_clear", |
| 29 | "crc_related_err", |
| 30 | "crc_root_cause", |
| 31 | "odp_data_corrupt_side_effect", |
| 32 | "odp_data_corrupt_root_cause" |
| 33 | ] |
| 34 | } |
| 35 | }, |
| 36 | "additionalProperties": false, |
| 37 | "required": [ "model_ec", "version", "actions", "signatures" ], |
| 38 | "properties": { |
| 39 | "model_ec": { |
| 40 | "type": "string", |
| 41 | "pattern": "^[0-9A-Fa-f]{8}$" |
| 42 | }, |
| 43 | "version": { |
| 44 | "type": "integer", |
| 45 | "minimum": 1 |
| 46 | }, |
| 47 | "units": { |
| 48 | "type": "object", |
| 49 | "additionalProperties": false, |
| 50 | "patternProperties": { |
| 51 | "^\\w+$": { |
| 52 | "type": "string", |
| 53 | "pattern": "^\\w+(\\/\\w+)*$" |
| 54 | } |
| 55 | } |
| 56 | }, |
| 57 | "buses": { |
| 58 | "type": "object", |
| 59 | "additionalProperties": false, |
| 60 | "patternProperties": { |
| 61 | "^\\w+$": { |
| 62 | "type": "object", |
| 63 | "additionalProperties": false, |
| 64 | "required": [ "type" ], |
| 65 | "properties": { |
| 66 | "type": { |
| 67 | "type": "string", |
| 68 | "enum": [ "SMP_BUS", "OMI_BUS" ] |
| 69 | }, |
| 70 | "unit": { |
| 71 | "type": "string", |
| 72 | "pattern": "^\\w+$" |
| 73 | } |
| 74 | } |
| 75 | } |
| 76 | } |
| 77 | }, |
| 78 | "actions": { |
| 79 | "type": "object", |
| 80 | "additionalProperties": false, |
| 81 | "patternProperties": { |
| 82 | "^\\w+$": { |
| 83 | "type": "array", |
| 84 | "items": { |
| 85 | "type": "object", |
| 86 | "required": [ "type" ], |
| 87 | "properties": { |
| 88 | "type": { |
| 89 | "type": "string", |
| 90 | "enum": [ |
| 91 | "action", |
| 92 | "callout_self", |
| 93 | "callout_unit", |
| 94 | "callout_connected", |
| 95 | "callout_bus", |
| 96 | "callout_clock", |
| 97 | "callout_procedure", |
| 98 | "callout_part", |
| 99 | "plugin", |
| 100 | "flag" |
| 101 | ] |
| 102 | }, |
| 103 | "priority": { |
| 104 | "$ref": "#/$defs/priority" |
| 105 | }, |
| 106 | "guard": { |
| 107 | "type": "boolean" |
| 108 | }, |
| 109 | "name": { |
| 110 | "type": "string", |
| 111 | "pattern": "^\\w+$" |
| 112 | } |
| 113 | }, |
| 114 | "allOf": [ |
| 115 | { |
| 116 | "if": { |
| 117 | "properties": { |
| 118 | "type": { "const": "action" } |
| 119 | } |
| 120 | }, |
| 121 | "then": { |
| 122 | "required": [ "name" ], |
| 123 | "not": { "required": [ "priority", "guard" ] } |
| 124 | } |
| 125 | }, |
| 126 | { |
| 127 | "if": { |
| 128 | "properties": { |
| 129 | "type": { "const": "callout_self" } |
| 130 | } |
| 131 | }, |
| 132 | "then": { |
| 133 | "required": [ "priority", "guard" ], |
| 134 | "not": { "required": [ "name" ] } |
| 135 | } |
| 136 | }, |
| 137 | { |
| 138 | "if": { |
| 139 | "properties": { |
| 140 | "type": { "const": "callout_unit" } |
| 141 | } |
| 142 | }, |
| 143 | "then": { |
| 144 | "required": [ "name", "priority", "guard" ] |
| 145 | } |
| 146 | }, |
| 147 | { |
| 148 | "if": { |
| 149 | "properties": { |
| 150 | "type": { "const": "callout_connected" } |
| 151 | } |
| 152 | }, |
| 153 | "then": { |
| 154 | "required": [ "name", "priority", "guard" ] |
| 155 | } |
| 156 | }, |
| 157 | { |
| 158 | "if": { |
| 159 | "properties": { |
| 160 | "type": { "const": "callout_bus" } |
| 161 | } |
| 162 | }, |
| 163 | "then": { |
| 164 | "required": [ "name", "priority", "guard" ] |
| 165 | } |
| 166 | }, |
| 167 | { |
| 168 | "if": { |
| 169 | "properties": { |
| 170 | "type": { "const": "callout_clock" } |
| 171 | } |
| 172 | }, |
| 173 | "then": { |
| 174 | "required": [ "name", "priority", "guard" ], |
| 175 | "properties": { |
| 176 | "name": { |
| 177 | "enum": [ |
| 178 | "OSC_REF_CLOCK_0", |
| 179 | "OSC_REF_CLOCK_1", |
| 180 | "TOD_CLOCK" |
| 181 | ] |
| 182 | } |
| 183 | } |
| 184 | } |
| 185 | }, |
| 186 | { |
| 187 | "if": { |
| 188 | "properties": { |
| 189 | "type": { "const": "callout_procedure" } |
| 190 | } |
| 191 | }, |
| 192 | "then": { |
| 193 | "required": [ "name", "priority" ], |
| 194 | "not": { "required": [ "guard" ] }, |
| 195 | "properties": { |
| 196 | "name": { |
| 197 | "enum": [ |
| 198 | "LEVEL2", |
| 199 | "SUE_SEEN" |
| 200 | ] |
| 201 | } |
| 202 | } |
| 203 | } |
| 204 | }, |
| 205 | { |
| 206 | "if": { |
| 207 | "properties": { |
| 208 | "type": { "const": "callout_part" } |
| 209 | } |
| 210 | }, |
| 211 | "then": { |
| 212 | "required": [ "name", "priority" ], |
| 213 | "not": { "required": [ "guard" ] }, |
| 214 | "properties": { |
| 215 | "name": { |
| 216 | "enum": [ |
| 217 | "PNOR" |
| 218 | ] |
| 219 | } |
| 220 | } |
| 221 | } |
| 222 | }, |
| 223 | { |
| 224 | "if": { |
| 225 | "properties": { |
| 226 | "type": { "const": "plugin" } |
| 227 | } |
| 228 | }, |
| 229 | "then": { |
| 230 | "required": [ "name", "instance" ], |
| 231 | "not": { "required": [ "priority", "guard" ] }, |
| 232 | "properties": { |
| 233 | "instance": { |
| 234 | "type": "integer" |
| 235 | } |
| 236 | } |
| 237 | } |
| 238 | }, |
| 239 | { |
| 240 | "if": { |
| 241 | "properties": { |
| 242 | "type": { "const": "flag" } |
| 243 | } |
| 244 | }, |
| 245 | "then": { |
| 246 | "required": ["name"], |
| 247 | "properties": { |
| 248 | "name": { |
| 249 | "$ref": "#/$defs/flags" |
| 250 | } |
| 251 | } |
| 252 | } |
| 253 | } |
| 254 | ] |
| 255 | } |
| 256 | } |
| 257 | } |
| 258 | }, |
| 259 | "signatures": { |
| 260 | "type": "object", |
| 261 | "additionalProperties": false, |
| 262 | "patternProperties": { |
| 263 | "^[0-9A-Fa-f]{4}$": { |
| 264 | "type": "object", |
| 265 | "additionalProperties": false, |
| 266 | "patternProperties": { |
| 267 | "^[0-9A-Fa-f]{2}$": { |
| 268 | "type": "object", |
| 269 | "additionalProperties": false, |
| 270 | "patternProperties": { |
| 271 | "^[0-9A-Fa-f]{2}$": { |
| 272 | "type": "string", |
| 273 | "pattern": "^\\w+$" |
| 274 | }, |
| 275 | "flags": { |
| 276 | "type": "array", |
| 277 | "minItems": 1, |
| 278 | "uniqueItems": true, |
| 279 | "items": |
| 280 | { |
| 281 | "$ref": "#/$defs/flags" |
| 282 | } |
| 283 | } |
| 284 | } |
| 285 | } |
| 286 | } |
| 287 | } |
| 288 | } |
| 289 | } |
| 290 | } |
| 291 | } |