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