blob: 36e44f6d0a29825fb6f703cc2a3b3d1cc4193f7e [file] [log] [blame]
Brad Bishopada40c52020-05-07 19:32:05 -04001Entity manager configuration file schema
2----------------------------------------
3
4Entity manager configuration files are JSON documents and can be validated with
5a JSON schema[1]. This document provides an overview of the general structure
6of an entity manager configuration file.
7
8An entity manager configuration file consists of one or more entity manager
9configurations. This provides flexibility for system designers - the
10configuration data for an entire platform or set of platforms can be expressed
11in a single file, or can be organized into several smaller files. Thus, the
12top most schema describes a single object or an array of objects.
13
14A single entity manager configuration
15----------------------------------------
16At its core entity manager simply exports objects onto DBus when a specific
17event occurs. As such, an entity manager configuration provides a syntax for
18describing the dbus interfaces to export, the object paths on which to add the
19interfaces and the event that should trigger the export. This is accomplished
20with four properties.
21
22Type
23----------------------------------------
24The type property identifies the type of the configuration. When exported,
25configuration data will be instantiated as grandchildren of
26/xyz/openbmc_project/inventory/system/<Type>. For a comprehensive list of
27supported types, consult the schema (global.json).
28
29Name
30----------------------------------------
31The name property identifies the name of the configuration. When exported,
32configuration data will be instantiated as children of
33/xyz/openbmc_project/inventory/system/<Type>/<Name>. Additionally, any DBus
34interfaces listed in openbmc-dbus.json will be added on
35/xyz/openbmc_project/inventory/system/<Type>/<Name>.
36
37Probe
38----------------------------------------
39The probe property describes the event which will cause entity manager to
40export the configuration to DBus, making it available to other applications.
41
42Exposes
43----------------------------------------
44The exposes property describes the configuration data at its most specific
45level. The exposes property is an array of heterogeneous configuration data.
46Each exposes element has its own schema which is outlined by the subschemas in
47the schemas directory. Each schema must require a type and name (not to be
48confused with the Type and Name properties of the parent JSON object) property
49since entity manager will construct the Dbus interface name and object path
50based on those properties:
51
52/xyz/openbmc_project/inventory/system/Board/RiserCard1/<Name>:
53 xyz.openbmc_project.Configuration.<Type>:
54 <remaining properties defined by exposes subschema>
55
56Adding new exposes property subschema
57----------------------------------------
58New subschema for the exposes property must be added to the schema directory,
59and then referenced from global.json at /definitions/EMExposesElement. Exposes
60element subschema must require a type and name property (the validator will
61fail otherwise) and should explicitly enumerate all properties and use
62additionalProperties so mistakes can be found
63during validation.
64
65Adding new Dbus interfaces
66----------------------------------------
67To export new interfaces on the configuration parent object e.g.:
68/xyz/openbmc_project/inventory/system/Board/RiserCard1 add additional subschema
69to openbmc-dbus.json.
70
71[1] https://json-schema.org/