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