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