Zane Shelley | 90d1252 | 2021-07-20 13:20:10 -0500 | [diff] [blame] | 1 | { |
| 2 | "$schema": "https://json-schema.org/draft/2020-12/schema", |
| 3 | "title": "RAS Data schema for openpower-hw-diags", |
Zane Shelley | ee54c99 | 2021-08-08 17:46:48 -0500 | [diff] [blame] | 4 | "version": 1, |
Zane Shelley | 90d1252 | 2021-07-20 13:20:10 -0500 | [diff] [blame] | 5 | "type": "object", |
Zane Shelley | 869d9bb | 2021-08-05 10:46:47 -0500 | [diff] [blame] | 6 | "definitions": { |
| 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 | }, |
Zane Shelley | 90d1252 | 2021-07-20 13:20:10 -0500 | [diff] [blame] | 19 | "additionalProperties": false, |
| 20 | "required": [ "model_ec", "version", "actions", "signatures" ], |
| 21 | "properties": { |
| 22 | "model_ec": { |
| 23 | "type": "string", |
| 24 | "pattern": "^[0-9A-Fa-f]{8}$" |
| 25 | }, |
| 26 | "version": { |
| 27 | "type": "integer", |
| 28 | "minimum": 1 |
| 29 | }, |
| 30 | "units": { |
| 31 | "type": "object", |
| 32 | "additionalProperties": false, |
| 33 | "patternProperties": { |
| 34 | "^\\w+$": { |
| 35 | "type": "string", |
| 36 | "pattern": "^\\w+(\\/\\w+)*$" |
| 37 | } |
| 38 | } |
| 39 | }, |
| 40 | "buses": { |
| 41 | "type": "object", |
| 42 | "additionalProperties": false, |
| 43 | "patternProperties": { |
| 44 | "^\\w+$": { |
| 45 | "type": "object", |
| 46 | "additionalProperties": false, |
| 47 | "required": [ "type" ], |
| 48 | "properties": { |
| 49 | "type": { |
| 50 | "type": "string", |
Zane Shelley | 5d63cef | 2021-09-17 18:10:17 -0500 | [diff] [blame] | 51 | "enum": [ "SMP_BUS", "OMI_BUS" ] |
Zane Shelley | 90d1252 | 2021-07-20 13:20:10 -0500 | [diff] [blame] | 52 | }, |
| 53 | "unit": { |
| 54 | "type": "string", |
| 55 | "pattern": "^\\w+$" |
| 56 | } |
| 57 | } |
| 58 | } |
| 59 | } |
| 60 | }, |
| 61 | "actions": { |
| 62 | "type": "object", |
| 63 | "additionalProperties": false, |
| 64 | "patternProperties": { |
| 65 | "^\\w+$": { |
| 66 | "type": "array", |
| 67 | "items": { |
| 68 | "type": "object", |
| 69 | "required": [ "type" ], |
| 70 | "properties": { |
| 71 | "type": { |
| 72 | "type": "string", |
| 73 | "enum": [ |
| 74 | "action", |
| 75 | "callout_self", |
| 76 | "callout_unit", |
| 77 | "callout_connected", |
| 78 | "callout_bus", |
| 79 | "callout_clock", |
| 80 | "callout_procedure", |
| 81 | "callout_part", |
| 82 | "plugin" |
| 83 | ] |
| 84 | }, |
| 85 | "priority": { |
Zane Shelley | 869d9bb | 2021-08-05 10:46:47 -0500 | [diff] [blame] | 86 | "$ref": "#/definitions/priority" |
Zane Shelley | 90d1252 | 2021-07-20 13:20:10 -0500 | [diff] [blame] | 87 | }, |
| 88 | "guard": { |
| 89 | "type": "boolean" |
| 90 | }, |
| 91 | "name": { |
| 92 | "type": "string", |
| 93 | "pattern": "^\\w+$" |
| 94 | } |
| 95 | }, |
| 96 | "allOf": [ |
| 97 | { |
| 98 | "if": { |
| 99 | "properties": { |
| 100 | "type": { "const": "action" } |
| 101 | } |
| 102 | }, |
| 103 | "then": { |
| 104 | "required": [ "name" ], |
| 105 | "not": { "required": [ "priority", "guard" ] } |
| 106 | } |
| 107 | }, |
| 108 | { |
| 109 | "if": { |
| 110 | "properties": { |
| 111 | "type": { "const": "callout_self" } |
| 112 | } |
| 113 | }, |
| 114 | "then": { |
| 115 | "required": [ "priority", "guard" ], |
| 116 | "not": { "required": [ "name" ] } |
| 117 | } |
| 118 | }, |
| 119 | { |
| 120 | "if": { |
| 121 | "properties": { |
| 122 | "type": { "const": "callout_unit" } |
| 123 | } |
| 124 | }, |
| 125 | "then": { |
| 126 | "required": [ "name", "priority", "guard" ] |
| 127 | } |
| 128 | }, |
| 129 | { |
| 130 | "if": { |
| 131 | "properties": { |
| 132 | "type": { "const": "callout_connected" } |
| 133 | } |
| 134 | }, |
| 135 | "then": { |
| 136 | "required": [ "name", "priority", "guard" ] |
| 137 | } |
| 138 | }, |
| 139 | { |
| 140 | "if": { |
| 141 | "properties": { |
| 142 | "type": { "const": "callout_bus" } |
| 143 | } |
| 144 | }, |
| 145 | "then": { |
Zane Shelley | 7cebfbc | 2021-10-21 16:13:43 -0500 | [diff] [blame] | 146 | "required": [ "name", "priority", "guard" ] |
Zane Shelley | 90d1252 | 2021-07-20 13:20:10 -0500 | [diff] [blame] | 147 | } |
| 148 | }, |
| 149 | { |
| 150 | "if": { |
| 151 | "properties": { |
| 152 | "type": { "const": "callout_clock" } |
| 153 | } |
| 154 | }, |
| 155 | "then": { |
Zane Shelley | 84721d9 | 2021-09-08 13:30:27 -0500 | [diff] [blame] | 156 | "required": [ "name", "priority", "guard" ], |
Zane Shelley | 90d1252 | 2021-07-20 13:20:10 -0500 | [diff] [blame] | 157 | "properties": { |
Zane Shelley | 84721d9 | 2021-09-08 13:30:27 -0500 | [diff] [blame] | 158 | "name": { |
| 159 | "enum": [ |
| 160 | "OSC_REF_CLOCK_0", |
Zane Shelley | d195b71 | 2022-01-26 13:26:34 -0600 | [diff] [blame] | 161 | "OSC_REF_CLOCK_1", |
| 162 | "TOD_CLOCK" |
Zane Shelley | 84721d9 | 2021-09-08 13:30:27 -0500 | [diff] [blame] | 163 | ] |
Zane Shelley | 90d1252 | 2021-07-20 13:20:10 -0500 | [diff] [blame] | 164 | } |
| 165 | } |
| 166 | } |
| 167 | }, |
| 168 | { |
| 169 | "if": { |
| 170 | "properties": { |
| 171 | "type": { "const": "callout_procedure" } |
| 172 | } |
| 173 | }, |
| 174 | "then": { |
| 175 | "required": [ "name", "priority" ], |
| 176 | "not": { "required": [ "guard" ] }, |
| 177 | "properties": { |
| 178 | "name": { |
| 179 | "enum": [ |
| 180 | "LEVEL2" |
| 181 | ] |
| 182 | } |
| 183 | } |
| 184 | } |
| 185 | }, |
| 186 | { |
| 187 | "if": { |
| 188 | "properties": { |
| 189 | "type": { "const": "callout_part" } |
| 190 | } |
| 191 | }, |
| 192 | "then": { |
| 193 | "required": [ "name", "priority" ], |
| 194 | "not": { "required": [ "guard" ] }, |
| 195 | "properties": { |
| 196 | "name": { |
Zane Shelley | a413477 | 2022-01-10 17:22:44 -0600 | [diff] [blame] | 197 | "enum": [ |
| 198 | "PNOR" |
| 199 | ] |
Zane Shelley | 90d1252 | 2021-07-20 13:20:10 -0500 | [diff] [blame] | 200 | } |
| 201 | } |
| 202 | } |
| 203 | }, |
| 204 | { |
| 205 | "if": { |
| 206 | "properties": { |
| 207 | "type": { "const": "plugin" } |
| 208 | } |
| 209 | }, |
| 210 | "then": { |
Zane Shelley | e13a9f9 | 2021-12-16 21:19:11 -0600 | [diff] [blame] | 211 | "required": [ "name", "instance" ], |
| 212 | "not": { "required": [ "priority", "guard" ] }, |
| 213 | "properties": { |
| 214 | "instance": { |
| 215 | "type": "integer" |
| 216 | } |
| 217 | } |
Zane Shelley | 90d1252 | 2021-07-20 13:20:10 -0500 | [diff] [blame] | 218 | } |
| 219 | } |
| 220 | ] |
| 221 | } |
| 222 | } |
| 223 | } |
| 224 | }, |
| 225 | "signatures": { |
| 226 | "type": "object", |
| 227 | "additionalProperties": false, |
| 228 | "patternProperties": { |
| 229 | "^[0-9A-Fa-f]{4}$": { |
| 230 | "type": "object", |
| 231 | "additionalProperties": false, |
| 232 | "patternProperties": { |
| 233 | "^[0-9A-Fa-f]{2}$": { |
| 234 | "type": "object", |
| 235 | "additionalProperties": false, |
| 236 | "patternProperties": { |
| 237 | "^[0-9A-Fa-f]{2}$": { |
| 238 | "type": "string", |
| 239 | "pattern": "^\\w+$" |
| 240 | } |
| 241 | } |
| 242 | } |
| 243 | } |
| 244 | } |
| 245 | } |
| 246 | } |
| 247 | } |
| 248 | } |