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