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