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", |
Patrick Williams | 8b10d69 | 2022-12-08 06:13:21 -0600 | [diff] [blame^] | 9 | "enum": ["HIGH", "MED", "MED_A", "MED_B", "MED_C", "LOW"] |
Zane Shelley | 869d9bb | 2021-08-05 10:46:47 -0500 | [diff] [blame] | 10 | } |
| 11 | }, |
Zane Shelley | 90d1252 | 2021-07-20 13:20:10 -0500 | [diff] [blame] | 12 | "additionalProperties": false, |
Patrick Williams | 8b10d69 | 2022-12-08 06:13:21 -0600 | [diff] [blame^] | 13 | "required": ["model_ec", "version", "actions", "signatures"], |
Zane Shelley | 90d1252 | 2021-07-20 13:20:10 -0500 | [diff] [blame] | 14 | "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 Williams | 8b10d69 | 2022-12-08 06:13:21 -0600 | [diff] [blame^] | 40 | "required": ["type"], |
Zane Shelley | 90d1252 | 2021-07-20 13:20:10 -0500 | [diff] [blame] | 41 | "properties": { |
| 42 | "type": { |
| 43 | "type": "string", |
Patrick Williams | 8b10d69 | 2022-12-08 06:13:21 -0600 | [diff] [blame^] | 44 | "enum": ["SMP_BUS", "OMI_BUS"] |
Zane Shelley | 90d1252 | 2021-07-20 13:20:10 -0500 | [diff] [blame] | 45 | }, |
| 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 Williams | 8b10d69 | 2022-12-08 06:13:21 -0600 | [diff] [blame^] | 62 | "required": ["type"], |
Zane Shelley | 90d1252 | 2021-07-20 13:20:10 -0500 | [diff] [blame] | 63 | "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 Shelley | 869d9bb | 2021-08-05 10:46:47 -0500 | [diff] [blame] | 79 | "$ref": "#/definitions/priority" |
Zane Shelley | 90d1252 | 2021-07-20 13:20:10 -0500 | [diff] [blame] | 80 | }, |
| 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 Williams | 8b10d69 | 2022-12-08 06:13:21 -0600 | [diff] [blame^] | 97 | "required": ["name"], |
| 98 | "not": { "required": ["priority", "guard"] } |
Zane Shelley | 90d1252 | 2021-07-20 13:20:10 -0500 | [diff] [blame] | 99 | } |
| 100 | }, |
| 101 | { |
| 102 | "if": { |
| 103 | "properties": { |
| 104 | "type": { "const": "callout_self" } |
| 105 | } |
| 106 | }, |
| 107 | "then": { |
Patrick Williams | 8b10d69 | 2022-12-08 06:13:21 -0600 | [diff] [blame^] | 108 | "required": ["priority", "guard"], |
| 109 | "not": { "required": ["name"] } |
Zane Shelley | 90d1252 | 2021-07-20 13:20:10 -0500 | [diff] [blame] | 110 | } |
| 111 | }, |
| 112 | { |
| 113 | "if": { |
| 114 | "properties": { |
| 115 | "type": { "const": "callout_unit" } |
| 116 | } |
| 117 | }, |
| 118 | "then": { |
Patrick Williams | 8b10d69 | 2022-12-08 06:13:21 -0600 | [diff] [blame^] | 119 | "required": ["name", "priority", "guard"] |
Zane Shelley | 90d1252 | 2021-07-20 13:20:10 -0500 | [diff] [blame] | 120 | } |
| 121 | }, |
| 122 | { |
| 123 | "if": { |
| 124 | "properties": { |
| 125 | "type": { "const": "callout_connected" } |
| 126 | } |
| 127 | }, |
| 128 | "then": { |
Patrick Williams | 8b10d69 | 2022-12-08 06:13:21 -0600 | [diff] [blame^] | 129 | "required": ["name", "priority", "guard"] |
Zane Shelley | 90d1252 | 2021-07-20 13:20:10 -0500 | [diff] [blame] | 130 | } |
| 131 | }, |
| 132 | { |
| 133 | "if": { |
| 134 | "properties": { |
| 135 | "type": { "const": "callout_bus" } |
| 136 | } |
| 137 | }, |
| 138 | "then": { |
Patrick Williams | 8b10d69 | 2022-12-08 06:13:21 -0600 | [diff] [blame^] | 139 | "required": ["name", "priority", "guard"] |
Zane Shelley | 90d1252 | 2021-07-20 13:20:10 -0500 | [diff] [blame] | 140 | } |
| 141 | }, |
| 142 | { |
| 143 | "if": { |
| 144 | "properties": { |
| 145 | "type": { "const": "callout_clock" } |
| 146 | } |
| 147 | }, |
| 148 | "then": { |
Patrick Williams | 8b10d69 | 2022-12-08 06:13:21 -0600 | [diff] [blame^] | 149 | "required": ["name", "priority", "guard"], |
Zane Shelley | 90d1252 | 2021-07-20 13:20:10 -0500 | [diff] [blame] | 150 | "properties": { |
Zane Shelley | 84721d9 | 2021-09-08 13:30:27 -0500 | [diff] [blame] | 151 | "name": { |
| 152 | "enum": [ |
| 153 | "OSC_REF_CLOCK_0", |
Zane Shelley | d195b71 | 2022-01-26 13:26:34 -0600 | [diff] [blame] | 154 | "OSC_REF_CLOCK_1", |
| 155 | "TOD_CLOCK" |
Zane Shelley | 84721d9 | 2021-09-08 13:30:27 -0500 | [diff] [blame] | 156 | ] |
Zane Shelley | 90d1252 | 2021-07-20 13:20:10 -0500 | [diff] [blame] | 157 | } |
| 158 | } |
| 159 | } |
| 160 | }, |
| 161 | { |
| 162 | "if": { |
| 163 | "properties": { |
| 164 | "type": { "const": "callout_procedure" } |
| 165 | } |
| 166 | }, |
| 167 | "then": { |
Patrick Williams | 8b10d69 | 2022-12-08 06:13:21 -0600 | [diff] [blame^] | 168 | "required": ["name", "priority"], |
| 169 | "not": { "required": ["guard"] }, |
Zane Shelley | 90d1252 | 2021-07-20 13:20:10 -0500 | [diff] [blame] | 170 | "properties": { |
| 171 | "name": { |
Patrick Williams | 8b10d69 | 2022-12-08 06:13:21 -0600 | [diff] [blame^] | 172 | "enum": ["LEVEL2", "SUE_SEEN"] |
Zane Shelley | 90d1252 | 2021-07-20 13:20:10 -0500 | [diff] [blame] | 173 | } |
| 174 | } |
| 175 | } |
| 176 | }, |
| 177 | { |
| 178 | "if": { |
| 179 | "properties": { |
| 180 | "type": { "const": "callout_part" } |
| 181 | } |
| 182 | }, |
| 183 | "then": { |
Patrick Williams | 8b10d69 | 2022-12-08 06:13:21 -0600 | [diff] [blame^] | 184 | "required": ["name", "priority"], |
| 185 | "not": { "required": ["guard"] }, |
Zane Shelley | 90d1252 | 2021-07-20 13:20:10 -0500 | [diff] [blame] | 186 | "properties": { |
| 187 | "name": { |
Patrick Williams | 8b10d69 | 2022-12-08 06:13:21 -0600 | [diff] [blame^] | 188 | "enum": ["PNOR"] |
Zane Shelley | 90d1252 | 2021-07-20 13:20:10 -0500 | [diff] [blame] | 189 | } |
| 190 | } |
| 191 | } |
| 192 | }, |
| 193 | { |
| 194 | "if": { |
| 195 | "properties": { |
| 196 | "type": { "const": "plugin" } |
| 197 | } |
| 198 | }, |
| 199 | "then": { |
Patrick Williams | 8b10d69 | 2022-12-08 06:13:21 -0600 | [diff] [blame^] | 200 | "required": ["name", "instance"], |
| 201 | "not": { |
| 202 | "required": ["priority", "guard"] |
| 203 | }, |
Zane Shelley | e13a9f9 | 2021-12-16 21:19:11 -0600 | [diff] [blame] | 204 | "properties": { |
| 205 | "instance": { |
| 206 | "type": "integer" |
| 207 | } |
| 208 | } |
Zane Shelley | 90d1252 | 2021-07-20 13:20:10 -0500 | [diff] [blame] | 209 | } |
| 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 | } |