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" }, |
Matt Spinler | aacc2aa | 2021-05-25 09:31:35 -0600 | [diff] [blame] | 136 | "byte_values": {"$ref": "#/definitions/bytes_values" } |
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" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 239 | "values": {"$ref": "#/definitions/bytes_values" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 240 | "masks": {"$ref": "#/definitions/bytes_masks" } |
| 241 | }, |
| 242 | "required": ["register", "values"], |
| 243 | "additionalProperties": false |
| 244 | }, |
| 245 | |
| 246 | "bytes_values": |
| 247 | { |
| 248 | "type": "array", |
| 249 | "items": {"$ref": "#/definitions/byte_value" }, |
| 250 | "minItems": 1 |
| 251 | }, |
| 252 | |
| 253 | "bytes_masks": |
| 254 | { |
| 255 | "type": "array", |
| 256 | "items": {"$ref": "#/definitions/byte_mask" }, |
| 257 | "minItems": 1 |
| 258 | }, |
| 259 | |
| 260 | "if": |
| 261 | { |
| 262 | "type": "object", |
| 263 | "properties": |
| 264 | { |
| 265 | "condition": {"$ref": "#/definitions/action" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 266 | "then": {"$ref": "#/definitions/actions" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 267 | "else": {"$ref": "#/definitions/actions" } |
| 268 | }, |
| 269 | "required": ["condition", "then"], |
| 270 | "additionalProperties": false |
| 271 | }, |
| 272 | |
Shawn McCarney | 846dde5 | 2021-08-14 12:47:44 -0500 | [diff] [blame^] | 273 | "log_phase_fault": |
| 274 | { |
| 275 | "type": "object", |
| 276 | "properties": |
| 277 | { |
| 278 | "type": {"$ref": "#/definitions/phase_fault_type" } |
| 279 | }, |
| 280 | "required": ["type"], |
| 281 | "additionalProperties": false |
| 282 | }, |
| 283 | |
| 284 | "phase_fault_type": |
| 285 | { |
| 286 | "type": "string", |
| 287 | "enum": ["n+1", "n"] |
| 288 | }, |
| 289 | |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 290 | "pmbus_write_vout_command": |
| 291 | { |
| 292 | "type": "object", |
| 293 | "properties": |
| 294 | { |
| 295 | "volts": {"$ref": "#/definitions/volts" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 296 | "format": {"$ref": "#/definitions/write_vout_format" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 297 | "exponent": {"$ref": "#/definitions/exponent" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 298 | "is_verified": {"$ref": "#/definitions/is_verified" } |
| 299 | }, |
| 300 | "required": ["format"], |
| 301 | "additionalProperties": false |
| 302 | }, |
| 303 | |
| 304 | "volts": |
| 305 | { |
| 306 | "type": "number" |
| 307 | }, |
| 308 | |
| 309 | "write_vout_format": |
| 310 | { |
| 311 | "type": "string", |
| 312 | "enum": ["linear"] |
| 313 | }, |
| 314 | |
| 315 | "exponent": |
| 316 | { |
| 317 | "type": "integer" |
| 318 | }, |
| 319 | |
| 320 | "is_verified": |
| 321 | { |
| 322 | "type": "boolean" |
| 323 | }, |
| 324 | |
| 325 | "pmbus_read_sensor": |
| 326 | { |
| 327 | "type": "object", |
| 328 | "properties": |
| 329 | { |
| 330 | "type": {"$ref": "#/definitions/pmbus_read_sensor_type" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 331 | "command": {"$ref": "#/definitions/pmbus_read_sensor_command" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 332 | "format": {"$ref": "#/definitions/read_sensor_format" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 333 | "exponent": {"$ref": "#/definitions/exponent" } |
| 334 | }, |
| 335 | "required": ["type", "command", "format"], |
| 336 | "additionalProperties": false |
| 337 | }, |
| 338 | |
| 339 | "pmbus_read_sensor_type": |
| 340 | { |
| 341 | "type": "string", |
| 342 | "enum": ["iout", "iout_peak", "iout_valley", "pout", "temperature", "temperature_peak", "vout", "vout_peak", "vout_valley"] |
| 343 | }, |
| 344 | |
| 345 | "pmbus_read_sensor_command": |
| 346 | { |
| 347 | "type": "string", |
| 348 | "pattern": "^0x[0-9a-fA-F]{2}$" |
| 349 | }, |
| 350 | |
| 351 | "read_sensor_format": |
| 352 | { |
| 353 | "type": "string", |
| 354 | "enum": ["linear_11", "linear_16"] |
| 355 | }, |
| 356 | |
Shawn McCarney | 4dc9a30 | 2021-08-14 10:52:47 -0500 | [diff] [blame] | 357 | "chassis_object": |
| 358 | { |
| 359 | "type": "object", |
| 360 | "properties": |
| 361 | { |
| 362 | "comments": {"$ref": "#/definitions/comments" }, |
| 363 | "number": {"$ref": "#/definitions/number" }, |
| 364 | "inventory_path": {"$ref": "#/definitions/inventory_path" }, |
| 365 | "devices": {"$ref": "#/definitions/devices" } |
| 366 | }, |
| 367 | "required": ["number"], |
| 368 | "additionalProperties": false |
| 369 | }, |
| 370 | |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 371 | "chassis": |
| 372 | { |
| 373 | "type": "array", |
Shawn McCarney | 4dc9a30 | 2021-08-14 10:52:47 -0500 | [diff] [blame] | 374 | "items": {"$ref": "#/definitions/chassis_object" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 375 | "minItems": 1 |
| 376 | }, |
| 377 | |
| 378 | "number": |
| 379 | { |
| 380 | "type": "integer", |
| 381 | "minimum": 1 |
| 382 | }, |
| 383 | |
Shawn McCarney | 4dc9a30 | 2021-08-14 10:52:47 -0500 | [diff] [blame] | 384 | "device": |
| 385 | { |
| 386 | "type": "object", |
| 387 | "properties": |
| 388 | { |
| 389 | "comments": {"$ref": "#/definitions/comments" }, |
| 390 | "id": {"$ref": "#/definitions/id" }, |
| 391 | "is_regulator": {"$ref": "#/definitions/is_regulator" }, |
| 392 | "fru": {"$ref": "#/definitions/inventory_path" }, |
| 393 | "i2c_interface": {"$ref": "#/definitions/i2c_interface" }, |
| 394 | "presence_detection": {"$ref": "#/definitions/presence_detection" }, |
| 395 | "configuration": {"$ref": "#/definitions/configuration" }, |
Shawn McCarney | 846dde5 | 2021-08-14 12:47:44 -0500 | [diff] [blame^] | 396 | "phase_fault_detection": {"$ref": "#/definitions/phase_fault_detection" }, |
Shawn McCarney | 4dc9a30 | 2021-08-14 10:52:47 -0500 | [diff] [blame] | 397 | "rails": {"$ref": "#/definitions/rails" } |
| 398 | }, |
| 399 | "required": ["id", "is_regulator", "fru", "i2c_interface"], |
| 400 | "if": |
| 401 | { |
| 402 | "properties": { "is_regulator": { "const": false } } |
| 403 | }, |
| 404 | "then": |
| 405 | { |
Shawn McCarney | 846dde5 | 2021-08-14 12:47:44 -0500 | [diff] [blame^] | 406 | "not": { |
| 407 | "anyOf": [ |
| 408 | { "required": ["phase_fault_detection"] }, |
| 409 | { "required": ["rails"] } |
| 410 | ] |
| 411 | } |
Shawn McCarney | 4dc9a30 | 2021-08-14 10:52:47 -0500 | [diff] [blame] | 412 | }, |
| 413 | "additionalProperties": false |
| 414 | }, |
| 415 | |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 416 | "devices": |
| 417 | { |
| 418 | "type": "array", |
Shawn McCarney | 4dc9a30 | 2021-08-14 10:52:47 -0500 | [diff] [blame] | 419 | "items": {"$ref": "#/definitions/device" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 420 | "minItems": 1 |
| 421 | }, |
| 422 | |
| 423 | "is_regulator": |
| 424 | { |
| 425 | "type": "boolean" |
| 426 | }, |
| 427 | |
| 428 | "i2c_interface": |
| 429 | { |
| 430 | "type": "object", |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 431 | "properties": |
| 432 | { |
| 433 | "bus": {"$ref": "#/definitions/bus" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 434 | "address": {"$ref": "#/definitions/address" } |
| 435 | }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 436 | "required": ["bus", "address"], |
| 437 | "additionalProperties": false |
| 438 | }, |
| 439 | |
| 440 | "bus": |
| 441 | { |
| 442 | "type": "integer", |
| 443 | "minimum": 0 |
| 444 | }, |
| 445 | |
| 446 | "address": |
| 447 | { |
| 448 | "type": "string", |
| 449 | "pattern": "^0x[0-9A-Fa-f]{2}$" |
| 450 | }, |
| 451 | |
| 452 | "presence_detection": |
| 453 | { |
| 454 | "type": "object", |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 455 | "properties": |
| 456 | { |
| 457 | "comments": {"$ref": "#/definitions/comments" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 458 | "rule_id": {"$ref": "#/definitions/id" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 459 | "actions": {"$ref": "#/definitions/actions" } |
| 460 | }, |
| 461 | "additionalProperties": false, |
| 462 | "oneOf": [ |
| 463 | {"required": ["rule_id"]}, |
| 464 | {"required": ["actions"]} |
| 465 | ] |
| 466 | }, |
| 467 | |
| 468 | "configuration": |
| 469 | { |
| 470 | "type": "object", |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 471 | "properties": |
| 472 | { |
| 473 | "comments": {"$ref": "#/definitions/comments" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 474 | "volts": {"$ref": "#/definitions/volts" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 475 | "rule_id": {"$ref": "#/definitions/id" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 476 | "actions": {"$ref": "#/definitions/actions" } |
| 477 | }, |
| 478 | "additionalProperties": false, |
| 479 | "oneOf": [ |
| 480 | {"required": ["rule_id"]}, |
| 481 | {"required": ["actions"]} |
| 482 | ] |
| 483 | }, |
| 484 | |
Shawn McCarney | 846dde5 | 2021-08-14 12:47:44 -0500 | [diff] [blame^] | 485 | "phase_fault_detection": |
| 486 | { |
| 487 | "type": "object", |
| 488 | "properties": |
| 489 | { |
| 490 | "comments": {"$ref": "#/definitions/comments" }, |
| 491 | "device_id": {"$ref": "#/definitions/id" }, |
| 492 | "rule_id": {"$ref": "#/definitions/id" }, |
| 493 | "actions": {"$ref": "#/definitions/actions" } |
| 494 | }, |
| 495 | "additionalProperties": false, |
| 496 | "oneOf": [ |
| 497 | {"required": ["rule_id"]}, |
| 498 | {"required": ["actions"]} |
| 499 | ] |
| 500 | }, |
| 501 | |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 502 | "rail": |
| 503 | { |
| 504 | "type": "object", |
| 505 | "properties": |
| 506 | { |
| 507 | "comments": {"$ref": "#/definitions/comments" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 508 | "id": {"$ref": "#/definitions/id" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 509 | "configuration": {"$ref": "#/definitions/configuration" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 510 | "sensor_monitoring": {"$ref": "#/definitions/sensor_monitoring" } |
| 511 | }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 512 | "required": ["id"], |
| 513 | "additionalProperties": false |
| 514 | }, |
| 515 | |
| 516 | "rails": |
| 517 | { |
| 518 | "type": "array", |
| 519 | "items": {"$ref": "#/definitions/rail" }, |
| 520 | "minItems": 1 |
| 521 | }, |
| 522 | |
| 523 | "sensor_monitoring": |
| 524 | { |
| 525 | "type": "object", |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 526 | "properties": |
| 527 | { |
| 528 | "comments": {"$ref": "#/definitions/comments" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 529 | "rule_id": {"$ref": "#/definitions/id" }, |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 530 | "actions": {"$ref": "#/definitions/actions" } |
| 531 | }, |
| 532 | "additionalProperties": false, |
| 533 | "oneOf": [ |
| 534 | {"required": ["rule_id"]}, |
| 535 | {"required": ["actions"]} |
| 536 | ] |
| 537 | } |
Bob King | dcb4b3b | 2019-12-17 18:07:06 +0800 | [diff] [blame] | 538 | } |
| 539 | } |