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                            description: The name of the metadata field.
31                        type:
32                            type: string
33                            pattern: "(string)|(size)|(u?int64)|(double)|(object_path)|(enum\\[.*\\])"
34                            description: The type of the metadata field.
35                        primary:
36                            type: boolean
37                            description:
38                                Set to true when the metadata field is expected
39                                to be part of the Redfish `MessageArgs` (and not
40                                only in the extended `DiagnosticData`).
41                    required:
42                        - name
43                        - type
44                minItems: 1
45        required:
46            - name
47    event:
48        type: object
49        allOf:
50            - $ref: "#/$defs/base-event"
51            - oneOf:
52                  - $ref: "#/$defs/redfish-messages"
53                  - $ref: "#/$defs/redfish-map"
54    error:
55        type: object
56        $ref: "#/$defs/event"
57        properties:
58            severity:
59                enum:
60                    - emergency
61                    - alert
62                    - critical
63                    - error
64                    - warning
65                    - notice
66                    - informational
67                    - debug
68                description:
69                    The `xyz.openbmc_project.Logging.Entry.Level` value for this
70                    error.
71            errno:
72                type: string
73                pattern: "^E[A-Z0-9]+$"
74                description: The errno used for this error.
75        required:
76            - severity
77            - errno
78    redfish-messages:
79        type: object
80        properties:
81            en:
82                $ref: "#/$defs/redfish-lang-message"
83                description: English message details.
84        required:
85            - en
86    redfish-lang-message:
87        type: object
88        description: The message details for any language.
89        properties:
90            description:
91                type: string
92                description:
93                    A developer-applicable description of the error reported.
94                    These form the "description" of the Redfish message.
95            message:
96                type: string
97                description:
98                    The end-user message, including placeholders for arguemnts.
99            resolution:
100                type: string
101                description: The end-user resolution.
102        required:
103            - message
104    redfish-map:
105        type: object
106        properties:
107            redfish-mapping:
108                type: string
109                description:
110                    Used when a `sdbusplus` event should map to a specific
111                    Redfish Message rather than a generated one. This is useful
112                    when an internal error has an analog in a standardized
113                    registry.
114        required:
115            - redfish-mapping
116
117properties:
118    version:
119        type: string
120        pattern: "^[0-9]+\\.[0-9]+\\.[0-9]+$"
121        description:
122            The version of the file, which will be used as the Redfish Message
123            Registry version.
124    errors:
125        type: array
126        items:
127            $ref: "#/$defs/error"
128        minItems: 1
129    events:
130        type: array
131        items:
132            $ref: "#/$defs/event"
133        minItems: 1
134required:
135    - version
136