1$id: https://openbmc-project.xyz/sdbusplus/events.schema.yaml
2$schema: https://json-schema.org/draft/2020-12/schema
3title: Event and error definitions
4type: object
5$defs:
6    base-event:
7        type: object
8        properties:
9            name:
10                type: string
11                description:
12                    An identifier for the event in UpperCamelCase; used as the
13                    class and Redfish Message ID.
14            deprecated:
15                type: string
16                pattern: "^[0-9]+\\.[0-9]+\\.[0-9]+$"
17                description:
18                    Indicates that the event is now deprecated and should not be
19                    created by any OpenBMC software, but is required to still
20                    exist for generation in the Redfish Message Registry. The
21                    version listed here should be the first version where the
22                    error is no longer used.
23            metadata:
24                type: array
25                items:
26                    type: object
27                    properties:
28                        name:
29                            type: string
30                            pattern: "^[A-Z][A-Z0-9a-z]*$"
31                            description:
32                                The name of the metadata field in CamelCase.
33                        description:
34                            type: string
35                            description:
36                                A description of the field for use by
37                                developers.
38                        type:
39                            type: string
40                            pattern: "(string)|(size)|(u?int64)|(double)|(object_path)|(enum\\[.*\\])"
41                            description: The type of the metadata field.
42                        primary:
43                            type: boolean
44                            description:
45                                Set to true when the metadata field is expected
46                                to be part of the Redfish `MessageArgs` (and not
47                                only in the extended `DiagnosticData`).
48                    required:
49                        - name
50                        - description
51                        - type
52                minItems: 1
53        required:
54            - name
55    event:
56        type: object
57        allOf:
58            - $ref: "#/$defs/base-event"
59            - oneOf:
60                  - $ref: "#/$defs/redfish-messages"
61                  - $ref: "#/$defs/redfish-map"
62        unevaluatedProperties: false
63    error:
64        type: object
65        allOf:
66            - $ref: "#/$defs/base-event"
67            - oneOf:
68                  - $ref: "#/$defs/redfish-messages"
69                  - $ref: "#/$defs/redfish-map"
70        properties:
71            severity:
72                enum:
73                    - emergency
74                    - alert
75                    - critical
76                    - error
77                    - warning
78                    - notice
79                    - informational
80                    - debug
81                description: The severity using `syslog`-style nomenclature.
82            errno:
83                type: string
84                pattern: "^E[A-Z0-9]+$"
85                description: The errno used for this error.
86        required:
87            - severity
88            - errno
89        unevaluatedProperties: false
90    redfish-messages:
91        type: object
92        properties:
93            en:
94                $ref: "#/$defs/redfish-lang-message"
95                description: English message details.
96        required:
97            - en
98    redfish-lang-message:
99        type: object
100        description: The message details for any language.
101        properties:
102            description:
103                type: string
104                description:
105                    A developer-applicable description of the error reported.
106                    These form the "description" of the Redfish message.
107            message:
108                type: string
109                description:
110                    The end-user message, including placeholders for arguemnts.
111            resolution:
112                type: string
113                description: The end-user resolution.
114        required:
115            - message
116    redfish-map:
117        type: object
118        properties:
119            redfish-mapping:
120                type: string
121                pattern: "^[A-Z_][a-zA-Z0-9_]*(\\.[A-Z_][a-zA-Z0-9_]*)*$"
122                description: Used when a `sdbusplus` event should map to a
123                    specific Redfish Message rather than a generated one. This
124                    is useful when an internal error has an analog in a
125                    standardized registry.
126
127                    When specifying these, the version should be omitted.
128        required:
129            - redfish-mapping
130
131properties:
132    version:
133        type: string
134        pattern: "^[0-9]+\\.[0-9]+\\.[0-9]+$"
135        description:
136            The version of the file, which will be used as the Redfish Message
137            Registry version.
138    errors:
139        type: array
140        items:
141            $ref: "#/$defs/error"
142        minItems: 1
143    events:
144        type: array
145        items:
146            $ref: "#/$defs/event"
147        minItems: 1
148required:
149    - version
150