Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 1 | { |
| 2 | "$schema": "http://json-schema.org/schema#", |
| 3 | "title": "JSON schema for the phosphor-regulators config file", |
| 4 | "$id": "https://github.com/openbmc/phosphor-power/tree/master/phosphor-regulators/schema/config_schema.json", |
| 5 | "description": "This schema describes the JSON format for the phosphor-regulators configuration file.", |
| 6 | "type": "object", |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 7 | "properties": |
| 8 | { |
Shawn McCarney | 4dc9a30 | 2021-08-14 10:52:47 -0500 | [diff] [blame] | 9 | "comments": {"$ref": "#/definitions/comments" }, |
| 10 | "rules": {"$ref": "#/definitions/rules" }, |
| 11 | "chassis": {"$ref": "#/definitions/chassis" } |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 12 | }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 13 | "required": ["chassis"], |
| 14 | "additionalProperties": false, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 15 | "definitions": |
| 16 | { |
Shawn McCarney | 4dc9a30 | 2021-08-14 10:52:47 -0500 | [diff] [blame] | 17 | "rule": |
| 18 | { |
| 19 | "type": "object", |
| 20 | "properties": |
| 21 | { |
| 22 | "comments": {"$ref": "#/definitions/comments" }, |
| 23 | "id": {"$ref": "#/definitions/id" }, |
| 24 | "actions": {"$ref": "#/definitions/actions" } |
| 25 | }, |
| 26 | "required": ["id", "actions"], |
| 27 | "additionalProperties": false |
| 28 | }, |
| 29 | |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 30 | "rules": |
| 31 | { |
| 32 | "type": "array", |
Shawn McCarney | 4dc9a30 | 2021-08-14 10:52:47 -0500 | [diff] [blame] | 33 | "items": {"$ref": "#/definitions/rule" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 34 | "minItems": 1 |
| 35 | }, |
| 36 | |
| 37 | "comments": |
| 38 | { |
| 39 | "type": "array", |
Shawn McCarney | 4dc9a30 | 2021-08-14 10:52:47 -0500 | [diff] [blame] | 40 | "items": {"type": "string" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 41 | "minItems": 1 |
| 42 | }, |
| 43 | |
| 44 | "id": |
| 45 | { |
| 46 | "type": "string", |
| 47 | "pattern": "^[A-Za-z0-9_]+$" |
| 48 | }, |
| 49 | |
| 50 | "action": |
| 51 | { |
| 52 | "type": "object", |
| 53 | "properties": |
| 54 | { |
| 55 | "comments": {"$ref": "#/definitions/comments" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 56 | "and": {"$ref": "#/definitions/actions" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 57 | "compare_presence": {"$ref": "#/definitions/compare_presence" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 58 | "compare_vpd": {"$ref": "#/definitions/compare_vpd" }, |
Shawn McCarney | 846dde5 | 2021-08-14 12:47:44 -0500 | [diff] [blame] | 59 | "i2c_capture_bytes": {"$ref": "#/definitions/i2c_capture_bytes" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 60 | "i2c_compare_bit": {"$ref": "#/definitions/i2c_bit" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 61 | "i2c_compare_byte": {"$ref": "#/definitions/i2c_byte" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 62 | "i2c_compare_bytes": {"$ref": "#/definitions/i2c_bytes" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 63 | "i2c_write_bit": {"$ref": "#/definitions/i2c_bit" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 64 | "i2c_write_byte": {"$ref": "#/definitions/i2c_byte" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 65 | "i2c_write_bytes": {"$ref": "#/definitions/i2c_bytes" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 66 | "if": {"$ref": "#/definitions/if" }, |
Shawn McCarney | 846dde5 | 2021-08-14 12:47:44 -0500 | [diff] [blame] | 67 | "log_phase_fault": {"$ref": "#/definitions/log_phase_fault" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 68 | "not": {"$ref": "#/definitions/action" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 69 | "or": {"$ref": "#/definitions/actions" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 70 | "pmbus_read_sensor": {"$ref": "#/definitions/pmbus_read_sensor" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 71 | "pmbus_write_vout_command": {"$ref": "#/definitions/pmbus_write_vout_command" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 72 | "run_rule": {"$ref": "#/definitions/id" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 73 | "set_device": {"$ref": "#/definitions/id" } |
| 74 | }, |
| 75 | "additionalProperties": false, |
| 76 | "oneOf": [ |
| 77 | {"required": ["and"]}, |
| 78 | {"required": ["compare_presence"]}, |
| 79 | {"required": ["compare_vpd"]}, |
Shawn McCarney | 846dde5 | 2021-08-14 12:47:44 -0500 | [diff] [blame] | 80 | {"required": ["i2c_capture_bytes"]}, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 81 | {"required": ["i2c_compare_bit"]}, |
| 82 | {"required": ["i2c_compare_byte"]}, |
| 83 | {"required": ["i2c_compare_bytes"]}, |
| 84 | {"required": ["i2c_write_bit"]}, |
| 85 | {"required": ["i2c_write_byte"]}, |
| 86 | {"required": ["i2c_write_bytes"]}, |
| 87 | {"required": ["if"]}, |
Shawn McCarney | 846dde5 | 2021-08-14 12:47:44 -0500 | [diff] [blame] | 88 | {"required": ["log_phase_fault"]}, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 89 | {"required": ["not"]}, |
| 90 | {"required": ["or"]}, |
| 91 | {"required": ["pmbus_write_vout_command"]}, |
| 92 | {"required": ["pmbus_read_sensor"]}, |
| 93 | {"required": ["run_rule"]}, |
| 94 | {"required": ["set_device"]} |
| 95 | ] |
| 96 | }, |
| 97 | |
| 98 | "actions": |
| 99 | { |
| 100 | "type": "array", |
| 101 | "items": {"$ref": "#/definitions/action" }, |
| 102 | "minItems": 1 |
| 103 | }, |
| 104 | |
| 105 | "compare_presence": |
| 106 | { |
| 107 | "type": "object", |
| 108 | "properties": |
| 109 | { |
Shawn McCarney | ecbeeea | 2021-04-29 21:08:18 -0500 | [diff] [blame] | 110 | "fru": {"$ref": "#/definitions/inventory_path" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 111 | "value": {"$ref": "#/definitions/boolean_value" } |
| 112 | }, |
| 113 | "required": ["fru", "value"], |
| 114 | "additionalProperties": false |
| 115 | }, |
| 116 | |
Shawn McCarney | ecbeeea | 2021-04-29 21:08:18 -0500 | [diff] [blame] | 117 | "inventory_path": |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 118 | { |
| 119 | "type": "string", |
| 120 | "minLength": 1 |
| 121 | }, |
| 122 | |
| 123 | "boolean_value": |
| 124 | { |
| 125 | "type": "boolean" |
| 126 | }, |
| 127 | |
| 128 | "compare_vpd": |
| 129 | { |
| 130 | "type": "object", |
| 131 | "properties": |
| 132 | { |
Shawn McCarney | ecbeeea | 2021-04-29 21:08:18 -0500 | [diff] [blame] | 133 | "fru": {"$ref": "#/definitions/inventory_path" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 134 | "keyword": {"$ref": "#/definitions/keyword" }, |
Matt Spinler | aacc2aa | 2021-05-25 09:31:35 -0600 | [diff] [blame] | 135 | "value": {"$ref": "#/definitions/string_value" }, |
Shawn McCarney | a2a830b | 2021-10-30 14:24:31 -0500 | [diff] [blame] | 136 | "byte_values": {"$ref": "#/definitions/byte_values_min0" } |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 137 | }, |
Matt Spinler | aacc2aa | 2021-05-25 09:31:35 -0600 | [diff] [blame] | 138 | "required": ["fru", "keyword"], |
| 139 | "oneOf": [ |
| 140 | {"required": ["value"]}, |
| 141 | {"required": ["byte_values"]} |
| 142 | ], |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 143 | "additionalProperties": false |
| 144 | }, |
| 145 | |
| 146 | "keyword": |
| 147 | { |
| 148 | "type": "string", |
Matt Spinler | aacc2aa | 2021-05-25 09:31:35 -0600 | [diff] [blame] | 149 | "enum": ["CCIN", "Manufacturer", "Model", "PartNumber", "HW"] |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 150 | }, |
| 151 | |
| 152 | "string_value": |
| 153 | { |
| 154 | "type": "string" |
| 155 | }, |
| 156 | |
Shawn McCarney | 846dde5 | 2021-08-14 12:47:44 -0500 | [diff] [blame] | 157 | "i2c_capture_bytes": |
| 158 | { |
| 159 | "type": "object", |
| 160 | "properties": |
| 161 | { |
| 162 | "register": {"$ref": "#/definitions/register" }, |
| 163 | "count": {"$ref": "#/definitions/byte_count" } |
| 164 | }, |
| 165 | "required": ["register", "count"], |
| 166 | "additionalProperties": false |
| 167 | }, |
| 168 | |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 169 | "i2c_bit": |
| 170 | { |
| 171 | "type": "object", |
| 172 | "properties": |
| 173 | { |
| 174 | "register": {"$ref": "#/definitions/register" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 175 | "position": {"$ref": "#/definitions/position" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 176 | "value": {"$ref": "#/definitions/bit_value" } |
| 177 | }, |
| 178 | "required": ["register", "position","value"], |
| 179 | "additionalProperties": false |
| 180 | }, |
| 181 | |
| 182 | "register": |
| 183 | { |
| 184 | "type": "string", |
| 185 | "pattern": "^0x[0-9A-Fa-f]{2}$" |
| 186 | }, |
| 187 | |
| 188 | "position": |
| 189 | { |
| 190 | "type": "integer", |
| 191 | "minimum": 0, |
| 192 | "maximum": 7 |
| 193 | }, |
| 194 | |
| 195 | "bit_value": |
| 196 | { |
| 197 | "type": "integer", |
| 198 | "minimum": 0, |
| 199 | "maximum": 1 |
| 200 | }, |
| 201 | |
| 202 | "i2c_byte": |
| 203 | { |
| 204 | "type": "object", |
| 205 | "properties": |
| 206 | { |
| 207 | "register": {"$ref": "#/definitions/register" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 208 | "value": {"$ref": "#/definitions/byte_value" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 209 | "mask": {"$ref": "#/definitions/byte_mask" } |
| 210 | }, |
| 211 | "required": ["register", "value"], |
| 212 | "additionalProperties": false |
| 213 | }, |
| 214 | |
| 215 | "byte_value": |
| 216 | { |
| 217 | "type": "string", |
| 218 | "pattern": "^0x[0-9A-Fa-f]{2}$" |
| 219 | }, |
| 220 | |
| 221 | "byte_mask": |
| 222 | { |
| 223 | "type": "string", |
| 224 | "pattern": "^0x[0-9A-Fa-f]{2}$" |
| 225 | }, |
| 226 | |
Shawn McCarney | 846dde5 | 2021-08-14 12:47:44 -0500 | [diff] [blame] | 227 | "byte_count": |
| 228 | { |
| 229 | "type": "integer", |
| 230 | "minimum": 1 |
| 231 | }, |
| 232 | |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 233 | "i2c_bytes": |
| 234 | { |
| 235 | "type": "object", |
| 236 | "properties": |
| 237 | { |
| 238 | "register": {"$ref": "#/definitions/register" }, |
Shawn McCarney | a2a830b | 2021-10-30 14:24:31 -0500 | [diff] [blame] | 239 | "values": {"$ref": "#/definitions/byte_values" }, |
| 240 | "masks": {"$ref": "#/definitions/byte_masks" } |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 241 | }, |
| 242 | "required": ["register", "values"], |
| 243 | "additionalProperties": false |
| 244 | }, |
| 245 | |
Shawn McCarney | a2a830b | 2021-10-30 14:24:31 -0500 | [diff] [blame] | 246 | "byte_values": |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 247 | { |
| 248 | "type": "array", |
| 249 | "items": {"$ref": "#/definitions/byte_value" }, |
| 250 | "minItems": 1 |
| 251 | }, |
| 252 | |
Shawn McCarney | a2a830b | 2021-10-30 14:24:31 -0500 | [diff] [blame] | 253 | "byte_values_min0": |
| 254 | { |
| 255 | "type": "array", |
| 256 | "items": {"$ref": "#/definitions/byte_value" }, |
| 257 | "minItems": 0 |
| 258 | }, |
| 259 | |
| 260 | "byte_masks": |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 261 | { |
| 262 | "type": "array", |
| 263 | "items": {"$ref": "#/definitions/byte_mask" }, |
| 264 | "minItems": 1 |
| 265 | }, |
| 266 | |
| 267 | "if": |
| 268 | { |
| 269 | "type": "object", |
| 270 | "properties": |
| 271 | { |
| 272 | "condition": {"$ref": "#/definitions/action" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 273 | "then": {"$ref": "#/definitions/actions" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 274 | "else": {"$ref": "#/definitions/actions" } |
| 275 | }, |
| 276 | "required": ["condition", "then"], |
| 277 | "additionalProperties": false |
| 278 | }, |
| 279 | |
Shawn McCarney | 846dde5 | 2021-08-14 12:47:44 -0500 | [diff] [blame] | 280 | "log_phase_fault": |
| 281 | { |
| 282 | "type": "object", |
| 283 | "properties": |
| 284 | { |
| 285 | "type": {"$ref": "#/definitions/phase_fault_type" } |
| 286 | }, |
| 287 | "required": ["type"], |
| 288 | "additionalProperties": false |
| 289 | }, |
| 290 | |
| 291 | "phase_fault_type": |
| 292 | { |
| 293 | "type": "string", |
| 294 | "enum": ["n+1", "n"] |
| 295 | }, |
| 296 | |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 297 | "pmbus_write_vout_command": |
| 298 | { |
| 299 | "type": "object", |
| 300 | "properties": |
| 301 | { |
| 302 | "volts": {"$ref": "#/definitions/volts" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 303 | "format": {"$ref": "#/definitions/write_vout_format" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 304 | "exponent": {"$ref": "#/definitions/exponent" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 305 | "is_verified": {"$ref": "#/definitions/is_verified" } |
| 306 | }, |
| 307 | "required": ["format"], |
| 308 | "additionalProperties": false |
| 309 | }, |
| 310 | |
| 311 | "volts": |
| 312 | { |
| 313 | "type": "number" |
| 314 | }, |
| 315 | |
| 316 | "write_vout_format": |
| 317 | { |
| 318 | "type": "string", |
| 319 | "enum": ["linear"] |
| 320 | }, |
| 321 | |
| 322 | "exponent": |
| 323 | { |
| 324 | "type": "integer" |
| 325 | }, |
| 326 | |
| 327 | "is_verified": |
| 328 | { |
| 329 | "type": "boolean" |
| 330 | }, |
| 331 | |
| 332 | "pmbus_read_sensor": |
| 333 | { |
| 334 | "type": "object", |
| 335 | "properties": |
| 336 | { |
| 337 | "type": {"$ref": "#/definitions/pmbus_read_sensor_type" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 338 | "command": {"$ref": "#/definitions/pmbus_read_sensor_command" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 339 | "format": {"$ref": "#/definitions/read_sensor_format" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 340 | "exponent": {"$ref": "#/definitions/exponent" } |
| 341 | }, |
| 342 | "required": ["type", "command", "format"], |
| 343 | "additionalProperties": false |
| 344 | }, |
| 345 | |
| 346 | "pmbus_read_sensor_type": |
| 347 | { |
| 348 | "type": "string", |
| 349 | "enum": ["iout", "iout_peak", "iout_valley", "pout", "temperature", "temperature_peak", "vout", "vout_peak", "vout_valley"] |
| 350 | }, |
| 351 | |
| 352 | "pmbus_read_sensor_command": |
| 353 | { |
| 354 | "type": "string", |
| 355 | "pattern": "^0x[0-9a-fA-F]{2}$" |
| 356 | }, |
| 357 | |
| 358 | "read_sensor_format": |
| 359 | { |
| 360 | "type": "string", |
| 361 | "enum": ["linear_11", "linear_16"] |
| 362 | }, |
| 363 | |
Shawn McCarney | 4dc9a30 | 2021-08-14 10:52:47 -0500 | [diff] [blame] | 364 | "chassis_object": |
| 365 | { |
| 366 | "type": "object", |
| 367 | "properties": |
| 368 | { |
| 369 | "comments": {"$ref": "#/definitions/comments" }, |
| 370 | "number": {"$ref": "#/definitions/number" }, |
| 371 | "inventory_path": {"$ref": "#/definitions/inventory_path" }, |
| 372 | "devices": {"$ref": "#/definitions/devices" } |
| 373 | }, |
Shawn McCarney | 4c88a4c | 2021-09-21 15:29:24 -0500 | [diff] [blame] | 374 | "required": ["number", "inventory_path"], |
Shawn McCarney | 4dc9a30 | 2021-08-14 10:52:47 -0500 | [diff] [blame] | 375 | "additionalProperties": false |
| 376 | }, |
| 377 | |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 378 | "chassis": |
| 379 | { |
| 380 | "type": "array", |
Shawn McCarney | 4dc9a30 | 2021-08-14 10:52:47 -0500 | [diff] [blame] | 381 | "items": {"$ref": "#/definitions/chassis_object" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 382 | "minItems": 1 |
| 383 | }, |
| 384 | |
| 385 | "number": |
| 386 | { |
| 387 | "type": "integer", |
| 388 | "minimum": 1 |
| 389 | }, |
| 390 | |
Shawn McCarney | 4dc9a30 | 2021-08-14 10:52:47 -0500 | [diff] [blame] | 391 | "device": |
| 392 | { |
| 393 | "type": "object", |
| 394 | "properties": |
| 395 | { |
| 396 | "comments": {"$ref": "#/definitions/comments" }, |
| 397 | "id": {"$ref": "#/definitions/id" }, |
| 398 | "is_regulator": {"$ref": "#/definitions/is_regulator" }, |
| 399 | "fru": {"$ref": "#/definitions/inventory_path" }, |
| 400 | "i2c_interface": {"$ref": "#/definitions/i2c_interface" }, |
| 401 | "presence_detection": {"$ref": "#/definitions/presence_detection" }, |
| 402 | "configuration": {"$ref": "#/definitions/configuration" }, |
Shawn McCarney | 846dde5 | 2021-08-14 12:47:44 -0500 | [diff] [blame] | 403 | "phase_fault_detection": {"$ref": "#/definitions/phase_fault_detection" }, |
Shawn McCarney | 4dc9a30 | 2021-08-14 10:52:47 -0500 | [diff] [blame] | 404 | "rails": {"$ref": "#/definitions/rails" } |
| 405 | }, |
| 406 | "required": ["id", "is_regulator", "fru", "i2c_interface"], |
| 407 | "if": |
| 408 | { |
| 409 | "properties": { "is_regulator": { "const": false } } |
| 410 | }, |
| 411 | "then": |
| 412 | { |
Shawn McCarney | 846dde5 | 2021-08-14 12:47:44 -0500 | [diff] [blame] | 413 | "not": { |
| 414 | "anyOf": [ |
| 415 | { "required": ["phase_fault_detection"] }, |
| 416 | { "required": ["rails"] } |
| 417 | ] |
| 418 | } |
Shawn McCarney | 4dc9a30 | 2021-08-14 10:52:47 -0500 | [diff] [blame] | 419 | }, |
| 420 | "additionalProperties": false |
| 421 | }, |
| 422 | |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 423 | "devices": |
| 424 | { |
| 425 | "type": "array", |
Shawn McCarney | 4dc9a30 | 2021-08-14 10:52:47 -0500 | [diff] [blame] | 426 | "items": {"$ref": "#/definitions/device" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 427 | "minItems": 1 |
| 428 | }, |
| 429 | |
| 430 | "is_regulator": |
| 431 | { |
| 432 | "type": "boolean" |
| 433 | }, |
| 434 | |
| 435 | "i2c_interface": |
| 436 | { |
| 437 | "type": "object", |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 438 | "properties": |
| 439 | { |
| 440 | "bus": {"$ref": "#/definitions/bus" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 441 | "address": {"$ref": "#/definitions/address" } |
| 442 | }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 443 | "required": ["bus", "address"], |
| 444 | "additionalProperties": false |
| 445 | }, |
| 446 | |
| 447 | "bus": |
| 448 | { |
| 449 | "type": "integer", |
| 450 | "minimum": 0 |
| 451 | }, |
| 452 | |
| 453 | "address": |
| 454 | { |
| 455 | "type": "string", |
| 456 | "pattern": "^0x[0-9A-Fa-f]{2}$" |
| 457 | }, |
| 458 | |
| 459 | "presence_detection": |
| 460 | { |
| 461 | "type": "object", |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 462 | "properties": |
| 463 | { |
| 464 | "comments": {"$ref": "#/definitions/comments" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 465 | "rule_id": {"$ref": "#/definitions/id" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 466 | "actions": {"$ref": "#/definitions/actions" } |
| 467 | }, |
| 468 | "additionalProperties": false, |
| 469 | "oneOf": [ |
| 470 | {"required": ["rule_id"]}, |
| 471 | {"required": ["actions"]} |
| 472 | ] |
| 473 | }, |
| 474 | |
| 475 | "configuration": |
| 476 | { |
| 477 | "type": "object", |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 478 | "properties": |
| 479 | { |
| 480 | "comments": {"$ref": "#/definitions/comments" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 481 | "volts": {"$ref": "#/definitions/volts" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 482 | "rule_id": {"$ref": "#/definitions/id" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 483 | "actions": {"$ref": "#/definitions/actions" } |
| 484 | }, |
| 485 | "additionalProperties": false, |
| 486 | "oneOf": [ |
| 487 | {"required": ["rule_id"]}, |
| 488 | {"required": ["actions"]} |
| 489 | ] |
| 490 | }, |
| 491 | |
Shawn McCarney | 846dde5 | 2021-08-14 12:47:44 -0500 | [diff] [blame] | 492 | "phase_fault_detection": |
| 493 | { |
| 494 | "type": "object", |
| 495 | "properties": |
| 496 | { |
| 497 | "comments": {"$ref": "#/definitions/comments" }, |
| 498 | "device_id": {"$ref": "#/definitions/id" }, |
| 499 | "rule_id": {"$ref": "#/definitions/id" }, |
| 500 | "actions": {"$ref": "#/definitions/actions" } |
| 501 | }, |
| 502 | "additionalProperties": false, |
| 503 | "oneOf": [ |
| 504 | {"required": ["rule_id"]}, |
| 505 | {"required": ["actions"]} |
| 506 | ] |
| 507 | }, |
| 508 | |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 509 | "rail": |
| 510 | { |
| 511 | "type": "object", |
| 512 | "properties": |
| 513 | { |
| 514 | "comments": {"$ref": "#/definitions/comments" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 515 | "id": {"$ref": "#/definitions/id" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 516 | "configuration": {"$ref": "#/definitions/configuration" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 517 | "sensor_monitoring": {"$ref": "#/definitions/sensor_monitoring" } |
| 518 | }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 519 | "required": ["id"], |
| 520 | "additionalProperties": false |
| 521 | }, |
| 522 | |
| 523 | "rails": |
| 524 | { |
| 525 | "type": "array", |
| 526 | "items": {"$ref": "#/definitions/rail" }, |
| 527 | "minItems": 1 |
| 528 | }, |
| 529 | |
| 530 | "sensor_monitoring": |
| 531 | { |
| 532 | "type": "object", |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 533 | "properties": |
| 534 | { |
| 535 | "comments": {"$ref": "#/definitions/comments" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 536 | "rule_id": {"$ref": "#/definitions/id" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 537 | "actions": {"$ref": "#/definitions/actions" } |
| 538 | }, |
| 539 | "additionalProperties": false, |
| 540 | "oneOf": [ |
| 541 | {"required": ["rule_id"]}, |
| 542 | {"required": ["actions"]} |
| 543 | ] |
| 544 | } |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 545 | } |
| 546 | } |