1{
2    "title": "PEL message registry schema",
3    "$id": "http://github.com/openbmc/phosphor-logging/extensions/openpower-pels/registry/schema/schema.json",
4    "description": "This schema describes JSON used for creating PELs from OpenBMC event logs.",
5    "type": "object",
6
7    "properties": {
8        "PELs": {
9            "title": "This is an array of entries that specify PEL fields for event logs",
10            "$ref": "#/definitions/pels"
11        }
12    },
13
14    "additionalProperties": false,
15    "minItems": 1,
16    "uniqueItems": true,
17
18    "definitions": {
19        "pels": {
20            "description": "Each entry in this array is for converting an event log to a PEL",
21            "type": "array",
22            "items": {
23                "description": "The schema for a single event log registry entry",
24                "type": "object",
25                "properties": {
26                    "Name": { "$ref": "#/definitions/errorName" },
27
28                    "SRC": { "$ref": "#/definitions/src" },
29
30                    "Subsystem": { "$ref": "#/definitions/subsystem" },
31
32                    "PossibleSubsystems": {
33                        "$ref": "#/definitions/possibleSubsystems"
34                    },
35
36                    "Severity": { "$ref": "#/definitions/severity" },
37
38                    "MfgSeverity": { "$ref": "#/definitions/mfgSeverity" },
39
40                    "EventScope": { "$ref": "#/definitions/eventScope" },
41
42                    "EventType": { "$ref": "#/definitions/eventType" },
43
44                    "ActionFlags": { "$ref": "#/definitions/actionFlags" },
45
46                    "MfgActionFlags": {
47                        "$ref": "#/definitions/mfgActionFlags"
48                    },
49
50                    "Documentation": { "$ref": "#/definitions/documentation" },
51
52                    "ComponentID": { "$ref": "#/definitions/componentID" },
53
54                    "CalloutsUsingAD": {
55                        "$ref": "#/definitions/calloutsUsingAD"
56                    },
57
58                    "Callouts": { "$ref": "#/definitions/callouts" },
59
60                    "JournalCapture": { "$ref": "#/definitions/journalCapture" }
61                },
62
63                "required": ["Name", "SRC", "Documentation"],
64                "additionalProperties": false,
65
66                "not": {
67                    "required": ["CalloutsUsingAD", "Callouts"]
68                },
69
70                "oneOf": [
71                    {
72                        "required": ["Subsystem"]
73                    },
74                    {
75                        "required": ["PossibleSubsystems"]
76                    }
77                ]
78            }
79        },
80
81        "errorName": {
82            "description": "The 'Message' property of an OpenBMC event log",
83            "type": "string"
84        },
85
86        "componentID": {
87            "description": "The component ID of the PEL creator, in the form 0xYY00.  For BD SRCs, this is optional and if not present the component ID will be taken from the upper byte of the reason code.",
88            "type": "string",
89            "pattern": "^0x[0-9a-fA-F]{2}00$"
90        },
91
92        "src": {
93            "description": "Contains fields describing the primary SRC embedded in the PEL",
94            "type": "object",
95
96            "properties": {
97                "Type": { "$ref": "#/definitions/srcType" },
98
99                "ReasonCode": { "$ref": "#/definitions/reasonCode" },
100
101                "SymptomIDFields": { "$ref": "#/definitions/symptomID" },
102
103                "Words6To9": { "$ref": "#/definitions/srcWords6To9" },
104
105                "DeconfigFlag": { "$ref": "#/definitions/deconfigFlag" }
106            },
107
108            "required": ["ReasonCode", "Words6To9"],
109            "additionalProperties": false
110        },
111
112        "documentation": {
113            "description": "This contains event documentation that will be used by tools and parsers.",
114            "type": "object",
115
116            "properties": {
117                "Message": { "$ref": "#/definitions/docMessage" },
118
119                "MessageArgSources": {
120                    "$ref": "#/definitions/docMessageArgSources"
121                },
122
123                "Description": { "$ref": "#/definitions/docDescription" },
124
125                "Notes": { "$ref": "#/definitions/docNotes" }
126            },
127            "additionalProperties": false,
128            "required": ["Message", "Description"]
129        },
130
131        "srcType": {
132            "description": "The first byte of the SRC ASCII string. Optional and defaults to BD.  The '11' SRC is only to be used for events related to power.",
133            "type": "string",
134            "enum": ["BD", "11"]
135        },
136
137        "deconfigFlag": {
138            "description": "If true, will set bit 6 in hex data word 5, which means 'one or more resources are deconfigured'.",
139            "type": "boolean"
140        },
141
142        "docNotes": {
143            "description": "Any notes/comments about the error. An array of strings for manual line wrapping. Optional.",
144            "type": "array",
145            "items": {
146                "description": "Notes",
147                "type": "string"
148            }
149        },
150
151        "reasonCode": {
152            "description": "String representation of the 2 byte reason code, like 0xABCD.  The reason code is the 2nd half of the 8 character SRC ASCII String field, such as B1FFABCD.",
153            "type": "string",
154            "pattern": "^0x[0-9a-fA-F]{4}$",
155
156            "examples": ["0x3355"]
157        },
158
159        "subsystem": {
160            "description": "PEL subsystem enumeration.  See the PEL spec for more detailed definitions.",
161            "type": "string",
162            "enum": [
163                "processor",
164                "processor_fru",
165                "processor_chip",
166                "processor_unit",
167                "processor_bus",
168
169                "memory",
170                "memory_ctlr",
171                "memory_bus",
172                "memory_dimm",
173                "memory_fru",
174                "external_cache",
175
176                "io",
177                "io_hub",
178                "io_bridge",
179                "io_bus",
180                "io_processor",
181                "io_hub_other",
182                "phb",
183
184                "io_adapter",
185                "io_adapter_comm",
186                "io_device",
187                "io_device_dasd",
188                "io_external_general",
189                "io_external_workstation",
190                "io_storage_mezz",
191
192                "cec_hardware",
193                "cec_sp_a",
194                "cec_sp_b",
195                "cec_node_controller",
196                "cec_vpd",
197                "cec_i2c",
198                "cec_chip_iface",
199                "cec_clocks",
200                "cec_op_panel",
201                "cec_tod",
202                "cec_storage_device",
203                "cec_sp_hyp_iface",
204                "cec_service_network",
205                "cec_sp_hostboot_iface",
206
207                "power",
208                "power_supply",
209                "power_control_hw",
210                "power_fans",
211                "power_sequencer",
212
213                "others",
214                "other_hmc",
215                "other_test_tool",
216                "other_media",
217                "other_multiple_subsystems",
218                "other_na",
219                "other_info_src",
220
221                "surv_hyp_lost_sp",
222                "surv_sp_lost_hyp",
223                "surv_sp_lost_hmc",
224                "surv_hmc_lost_lpar",
225                "surv_hmc_lost_bpa",
226                "surv_hmc_lost_hmc",
227
228                "platform_firmware",
229                "bmc_firmware",
230                "hyp_firmware",
231                "partition_firmware",
232                "slic_firmware",
233                "spcn_firmware",
234                "bulk_power_firmware_side_a",
235                "hmc_code_firmware",
236                "bulk_power_firmware_side_b",
237                "virtual_sp",
238                "hostboot",
239                "occ",
240
241                "software",
242                "os_software",
243                "xpf_software",
244                "app_software",
245
246                "ext_env",
247                "input_power_source",
248                "ambient_temp",
249                "user_error",
250                "corrosion"
251            ]
252        },
253
254        "possibleSubsystems": {
255            "description": "Required when the PEL creator uses PEL_SUBSYSTEM in the AdditionalData property to pass in the subsystem.  Used by scripts that generate documentation to build all possible SRC ASCII strings for this error.",
256            "type": "array",
257            "items": {
258                "$ref": "#/definitions/subsystem"
259            },
260            "minItems": 1,
261            "uniqueItems": true
262        },
263
264        "systemAndSeverity": {
265            "description": "A severity entry that has an optional system type qualifier.  Used when the severity needs to be based on the system type.",
266            "type": "object",
267            "properties": {
268                "System": { "$ref": "#/definitions/system" },
269                "SevValue": { "$ref": "#/definitions/severityTypes" }
270            },
271            "additionalProperties": false,
272            "required": ["SevValue"]
273        },
274
275        "severity": {
276            "description": "PEL severity field.  Optional.  If not provided, it will use the event log severity. It can either be an enum of the severity value, or an array of them that is based on system type, where an entry without a system type acts as the catch all.",
277            "oneOf": [
278                {
279                    "$ref": "#/definitions/severityTypes"
280                },
281                {
282                    "type": "array",
283                    "items": {
284                        "$ref": "#/definitions/systemAndSeverity"
285                    },
286                    "minItems": 1,
287                    "uniqueItems": true
288                }
289            ],
290
291            "examples": [
292                "unrecoverable",
293
294                [
295                    {
296                        "System": "systemA",
297                        "SevValue": "predictive"
298                    },
299                    {
300                        "SevValue": "unrecoverable"
301                    }
302                ]
303            ]
304        },
305
306        "severityTypes": {
307            "description": "PEL severity enumeration.  See the PEL spec for more detailed definitions.",
308            "type": "string",
309
310            "enum": [
311                "non_error",
312
313                "recovered",
314
315                "predictive",
316                "predictive_degraded_perf",
317                "predictive_reboot",
318                "predictive_reboot_degraded",
319                "predictive_redundancy_loss",
320
321                "unrecoverable",
322                "unrecoverable_degraded_perf",
323                "unrecoverable_redundancy_loss",
324                "unrecoverable_redundancy_loss_perf",
325                "unrecoverable_loss_of_function",
326
327                "critical",
328                "critical_system_term",
329                "critical_imminent_failure",
330                "critical_partition_term",
331                "critical_partition_imminent_failure",
332
333                "diagnostic_error",
334                "diagnostic_error_incorrect_results",
335
336                "symptom_recovered",
337                "symptom_predictive",
338                "symptom_unrecoverable",
339                "symptom_critical",
340                "symptom_diag_err"
341            ]
342        },
343
344        "mfgSeverity": {
345            "description": "The PEL severity to use in manufacturing reporting mode",
346            "$ref": "#/definitions/severity"
347        },
348
349        "eventScope": {
350            "description": "The event scope PEL field. Optional and defaults to entire_platform",
351            "type": "string",
352            "enum": [
353                "entire_platform",
354                "single_partition",
355                "multiple_partitions",
356                "possibly_multiple_platforms"
357            ]
358        },
359
360        "eventType": {
361            "description": "The event type PEL field. Optional and defaults to na",
362            "type": "string",
363            "enum": [
364                "na",
365                "misc_information_only",
366                "tracing_event",
367                "dump_notification",
368                "env_normal"
369            ]
370        },
371
372        "actionFlags": {
373            "description": "The action flags Private Header PEL field",
374            "type": "array",
375            "items": {
376                "description": "List of action flags",
377                "type": "string",
378                "enum": [
379                    "service_action",
380                    "hidden",
381                    "report",
382                    "dont_report",
383                    "call_home",
384                    "isolation_incomplete",
385                    "termination"
386                ]
387            }
388        },
389
390        "mfgActionFlags": {
391            "description": "The PEL action flags to use in manufacturing reporting mode",
392            "$ref": "#/definitions/actionFlags"
393        },
394
395        "docDescription": {
396            "description": "This is a higher level description of the error.  It is required by the Redfish schema to generate a Redfish message entry, but is not used in Redfish or PEL output.",
397            "type": "string",
398            "minLength": 8
399        },
400
401        "docMessage": {
402            "description": "The error message.  This will show up in parsed PELs, and in the Redfish event logs.  It can contain placeholders for numeric values using %1, %2, etc, that come from the SRC words 6-9 as defined by the MessageArgSources property.",
403            "type": "string",
404            "minLength": 8,
405            "examples": [
406                { "Message": "The code update from level %1 to %2 failed" }
407            ]
408        },
409
410        "docMessageArgSources": {
411            "description": "The SRC word 6-9 to use as the source of the numeric arguments that will be substituted into any placeholder in the Message field.  Only required if there are arguments to substitute.",
412            "type": "array",
413            "items": {
414                "type": "string",
415                "enum": ["SRCWord6", "SRCWord7", "SRCWord8", "SRCWord9"]
416            },
417            "additionalItems": false
418        },
419
420        "symptomID": {
421            "description": "Defines a custom Symptom ID, to be appended to the ASCII string word and separated by underscores.  The maximum size of the Symptom ID field is 80 characters.  The default is ASCIISTRING_SRCWord3 (e.g. B1103500_12345678).",
422            "type": "array",
423            "items": {
424                "type": "string",
425                "enum": [
426                    "SRCWord3",
427                    "SRCWord4",
428                    "SRCWord5",
429                    "SRCWord6",
430                    "SRCWord7",
431                    "SRCWord8",
432                    "SRCWord9"
433                ]
434            },
435            "minItems": 1,
436            "maxItems": 8,
437            "uniqueItems": true,
438
439            "examples": [["SRCWord3", "SRCWord6"]]
440        },
441
442        "srcWords6To9": {
443            "description": "This details what the user defined SRC hex words (6-9) mean, and which AdditionalData properties to get them from.  These will be shown in the PEL parser output.  Must be present, but can be empty.",
444            "type": "object",
445            "patternProperties": {
446                "^[6-9]$": {
447                    "type": "object",
448                    "properties": {
449                        "Description": {
450                            "description": "What the value in the field represents.",
451                            "type": "string"
452                        },
453                        "AdditionalDataPropSource": {
454                            "description": "Which AdditionalData property key to get the data from.",
455                            "type": "string"
456                        }
457                    },
458
459                    "additionalProperties": false
460                },
461
462                "examples": {
463                    "SRCWords6To9": {
464                        "6": {
465                            "Description": "Failing PSU number",
466                            "AdditionalDataPropSource": "PSU_NUM"
467                        }
468                    }
469                }
470            },
471            "additionalProperties": false
472        },
473
474        "adName": {
475            "description": "The name of the AdditionalData entry to use to index into the callout tables.",
476            "type": "string"
477        },
478
479        "adValue": {
480            "description": "The value for the AdditionalData entry specified by ADName that indexes into the callout tables.",
481            "type": "string"
482        },
483
484        "locationCode": {
485            "description": "A location code - the segment after the 'UTMS-' prefix. (e.g. P1-C2)",
486            "type": "string"
487        },
488
489        "priority": {
490            "description": "The callout priority.  See the PEL spec for priority definitions.",
491            "type": "string",
492            "enum": [
493                "high",
494                "medium",
495                "low",
496                "medium_group_a",
497                "medium_group_b",
498                "medium_group_c"
499            ]
500        },
501
502        "symbolicFRU": {
503            "description": "The symbolic FRU callout.",
504            "type": "string",
505            "enum": [
506                "service_docs",
507                "pwrsply",
508                "air_mover",
509                "pgood_part",
510                "usb_pgood",
511                "ambient_temp",
512                "ambient_temp_back",
513                "ambient_perf_loss",
514                "ac_module",
515                "fan_cable",
516                "cable_continued",
517                "altitude",
518                "pcie_hot_plug",
519                "overtemp",
520                "memory_dimm"
521            ]
522        },
523
524        "symbolicFRUTrusted": {
525            "description": "The symbolic FRU callout with a trusted location code. (Can light LEDs).",
526            "ref": "#/definitions/symbolicFRU"
527        },
528
529        "procedure": {
530            "description": "The maintenance procedure callout.",
531            "type": "string",
532            "enum": [
533                "bmc_code",
534                "next_level_support",
535                "sbe_code",
536                "fsi_path",
537                "power_overcurrent",
538                "find_sue_root_cause",
539                "system_vpd_correction",
540                "detected_issue_need_service"
541            ]
542        },
543
544        "useInventoryLocCode": {
545            "description": "Used along with SymbolicFRUTrusted to specify that the location code to use with the symbolic FRU is to be taken from the passed in CALLOUT_INVENTORY_PATH callout rather than being specified with LocCode.",
546            "type": "boolean"
547        },
548
549        "calloutList": {
550            "description": "The list of FRU callouts to add to a PEL.  If just LocCode is specified, it is a normal hardware FRU callout.  If Procedure is specified, it is a procedure callout.  If SymbolicFRU or SymbolicFRUTrusted are specified, it is a Symbolic FRU callout.  SymbolicFRUTrusted also requires LocCode.",
551            "type": "array",
552            "items": {
553                "type": "object",
554                "properties": {
555                    "Priority": { "$ref": "#/definitions/priority" },
556                    "LocCode": { "$ref": "#/definitions/locationCode" },
557                    "SymbolicFRU": { "$ref": "#/definitions/symbolicFRU" },
558                    "SymbolicFRUTrusted": {
559                        "$ref": "#/definitions/symbolicFRUTrusted"
560                    },
561                    "Procedure": { "$ref": "#/definitions/procedure" },
562                    "UseInventoryLocCode": {
563                        "$ref": "#/definitions/useInventoryLocCode"
564                    }
565                },
566                "additionalProperties": false,
567                "required": ["Priority"],
568
569                "oneOf": [
570                    {
571                        "allOf": [
572                            { "required": ["LocCode"] },
573                            { "not": { "required": ["SymbolicFRU"] } },
574                            { "not": { "required": ["SymbolicFRUTrusted"] } },
575                            { "not": { "required": ["Procedure"] } },
576                            { "not": { "required": ["UseInventoryLocCode"] } }
577                        ]
578                    },
579                    {
580                        "allOf": [
581                            { "required": ["SymbolicFRU"] },
582                            { "not": { "required": ["SymbolicFRUTrusted"] } },
583                            { "not": { "required": ["Procedure"] } },
584                            { "not": { "required": ["UseInventoryLocCode"] } }
585                        ]
586                    },
587
588                    {
589                        "allOf": [
590                            { "required": ["SymbolicFRUTrusted", "LocCode"] },
591                            { "not": { "required": ["SymbolicFRU"] } },
592                            { "not": { "required": ["Procedure"] } },
593                            { "not": { "required": ["UseInventoryLocCode"] } }
594                        ]
595                    },
596
597                    {
598                        "allOf": [
599                            {
600                                "required": [
601                                    "SymbolicFRUTrusted",
602                                    "UseInventoryLocCode"
603                                ]
604                            },
605                            { "not": { "required": ["SymbolicFRU"] } },
606                            { "not": { "required": ["Procedure"] } },
607                            { "not": { "required": ["LocCode"] } }
608                        ]
609                    },
610
611                    {
612                        "allOf": [
613                            { "required": ["Procedure"] },
614                            { "not": { "required": ["SymbolicFRU"] } },
615                            { "not": { "required": ["SymbolicFRUTrusted"] } },
616                            { "not": { "required": ["LocCode"] } },
617                            { "not": { "required": ["UseInventoryLocCode"] } }
618                        ]
619                    }
620                ]
621            },
622            "minItems": 1,
623            "maxItems": 10,
624
625            "examples": [
626                {
627                    "Priority": "high",
628                    "LocCode": "P1"
629                },
630                {
631                    "Priority": "medium",
632                    "LocCode": "P2",
633                    "SymbolicFRU": "PROCFRU"
634                },
635                {
636                    "Priority": "low",
637                    "Procedure": "SVCDOCS"
638                }
639            ]
640        },
641
642        "system": {
643            "description": "The system type string, as specified by entity manger.  It is used to index into different sections of the JSON.",
644            "type": "string",
645            "minLength": 1
646        },
647
648        "callouts": {
649            "description": "This contains callouts that can vary based on system type.  Each entry contains an optional System property and a required CalloutList property.  If the System property is left out it indicates that the CalloutList callouts are valid for every system type, unless there is another Callouts entry that has a matching System property, in which case that entry is valid.",
650            "type": "array",
651            "items": {
652                "type": "object",
653
654                "properties": {
655                    "System": { "$ref": "#/definitions/system" },
656                    "CalloutList": { "$ref": "#/definitions/calloutList" }
657                },
658                "required": ["CalloutList"],
659                "additionalProperties": false
660            },
661            "minItems": 1,
662            "maxItems": 10,
663
664            "examples": [
665                [
666                    {
667                        "System": "system1",
668                        "CalloutList": [{ "Priority": "high", "LocCode": "P1" }]
669                    },
670                    {
671                        "CalloutList": [
672                            { "Priority": "high", "Procedure": "NEXTLVL" }
673                        ]
674                    }
675                ]
676            ]
677        },
678
679        "calloutsWithTheirADValues": {
680            "description": "This contains callouts along with the AdditionalData value used to select an entry into the callout list.  The AdditionalData entry was specified by ADName in the CalloutsUsingAD parent entry.",
681            "type": "array",
682
683            "items": {
684                "type": "object",
685                "properties": {
686                    "ADValue": { "$ref": "#/definitions/adValue" },
687                    "Callouts": { "$ref": "#/definitions/callouts" }
688                },
689                "additionalProperties": false,
690                "required": ["ADValue", "Callouts"]
691            },
692            "minItems": 1,
693
694            "examples": [
695                [
696                    {
697                        "ADValue": "0",
698                        "Callouts": [
699                            {
700                                "CalloutList": [
701                                    { "Priority": "high", "LocCode": "P1" }
702                                ]
703                            }
704                        ]
705                    },
706                    {
707                        "ADValue": "1",
708                        "Callouts": [
709                            {
710                                "CalloutList": [
711                                    { "Priority": "high", "LocCode": "P2" }
712                                ]
713                            }
714                        ]
715                    }
716                ]
717            ]
718        },
719
720        "calloutsUsingAD": {
721            "description": "This contains the callouts that can be specified based on a value in the AdditionalData property.",
722            "type": "object",
723
724            "properties": {
725                "ADName": { "$ref": "#/definitions/adName" },
726                "CalloutsWithTheirADValues": {
727                    "$ref": "#/definitions/calloutsWithTheirADValues"
728                },
729                "CalloutsWhenNoADMatch": {
730                    "$ref": "#/definitions/calloutsWhenNoADMatch"
731                }
732            },
733            "additionalProperties": false,
734            "required": ["ADName", "CalloutsWithTheirADValues"],
735
736            "examples": [
737                {
738                    "ADName": "PROC_NUM",
739                    "CalloutsWithTheirADValues": [
740                        {
741                            "ADValue": "0",
742                            "Callouts": [
743                                {
744                                    "CalloutList": [
745                                        { "Priority": "high", "LocCode": "P1" }
746                                    ]
747                                }
748                            ]
749                        },
750                        {
751                            "ADValue": "1",
752                            "Callouts": [
753                                {
754                                    "CalloutList": [
755                                        { "Priority": "high", "LocCode": "P2" }
756                                    ]
757                                }
758                            ]
759                        }
760                    ]
761                }
762            ]
763        },
764
765        "calloutsWhenNoADMatch": {
766            "description": "This contains the callouts to use when a match in the 'CalloutsWithTheirADValues array isn't found.",
767            "$ref": "#/definitions/callouts"
768        },
769
770        "numLines": {
771            "description": "The number of lines of the journal to capture.",
772            "type": "integer",
773            "minimum": 1,
774            "maximum": 100
775        },
776
777        "syslogID": {
778            "description": "SYSLOG_IDENTIFIER value from the journal whose entries to capture.",
779            "type": "string",
780            "minLength": 1
781        },
782
783        "journalSection": {
784            "type": "object",
785            "properties": {
786                "SyslogID": { "$ref": "#/definitions/syslogID" },
787                "NumLines": { "$ref": "#/definitions/numLines" }
788            },
789            "additionalProperties": false,
790            "required": ["SyslogID", "NumLines"]
791        },
792
793        "journalSectionList": {
794            "description": "Describes which syslog IDs and how many journal lines to capture",
795            "type": "array",
796            "items": {
797                "$ref": "#/definitions/journalSection"
798            },
799            "minItems": 1,
800            "uniqueItems": true,
801            "examples": [
802                {
803                    "Sections": [
804                        {
805                            "SyslogID": "phosphor-bmc-state-manager",
806                            "NumLines": 20
807                        }
808                    ]
809                }
810            ]
811        },
812
813        "journalCapture": {
814            "description": "Allows a PEL to capture journal data in UserData sections.",
815            "type": "object",
816            "properties": {
817                "NumLines": { "$ref": "#/definitions/numLines" },
818                "Sections": { "$ref": "#/definitions/journalSectionList" }
819            },
820            "oneOf": [
821                {
822                    "required": ["NumLines"]
823                },
824                {
825                    "required": ["Sections"]
826                }
827            ],
828            "additionalProperties": false,
829            "examples": [
830                {
831                    "JournalCapture": {
832                        "NumLines": 30
833                    }
834                },
835                {
836                    "JournalCapture": {
837                        "Sections": [
838                            {
839                                "SyslogID": "phosphor-bmc-state-manager",
840                                "NumLines": 20
841                            },
842                            {
843                                "SyslogID": "phosphor-log-manager",
844                                "NumLines": 15
845                            }
846                        ]
847                    }
848                }
849            ]
850        }
851    }
852}
853