mapper: Add GetAssociatedSubTreeById and GetAssociatedSubTreePathsById

These methods are similar to the existing GetSubTree and GetSubTreePaths
methods, but they retrieve the paths of the associated endpoints
corresponding to the provided identifier. Here, the "Id" refers to the
leaf name of the D-Bus path, which uniquely identifies a specific
component or entity within the system. For example, in the path
/xyz/openbmc_project/inventory/system/ChassisId/motherboard/FanId, the
identifiers could be ChassisId and FanId, where each Id uniquely
identifies a chassis or a fan.

These methods use two arrays of interfaces: one to filter paths with the
specified identifier and another to filter the endpoint paths of the
identifier.

These methods simplify the process by combining subtree retrieval and
association lookup into a single call, reducing the number of D-Bus
calls needed.

ex:
'''
busctl call -j  "xyz.openbmc_project.ObjectMapper"   "/xyz/openbmc_project/object_mapper" \
"xyz.openbmc_project.ObjectMapper" "GetAssociatedSubTreePathsById" ssiassas "chassis" \
"/xyz/openbmc_project/inventory" 0 1 "xyz.openbmc_project.Inventory.Item.Chassis" "powered_by" \
1  "xyz.openbmc_project.Inventory.Item.PowerSupply"
{
        "type" : "as",
        "data" : [
                [
                        "/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0",
                        "/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply1",
                        "/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply2",
                        "/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply3"
                ]
        ]
}
'''

Change-Id: I7f23ad585a46064aaccb0a3c789ca4a69c923291
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
1 file changed
tree: 21a1665b636f72f492e040380b32dd26c113777b
  1. gen/
  2. subprojects/
  3. yaml/
  4. .gitignore
  5. .markdownlint.yaml
  6. .prettierrc.yaml
  7. .shellcheck
  8. LICENSE
  9. meson.build
  10. meson.options
  11. OWNERS
  12. README.md
  13. requirements.md
README.md

phosphor-dbus-interfaces

YAML descriptors of standard D-Bus interfaces. The format is described by the sdbusplus binding generation tool sdbus++.

Before defining a new D-Bus interface or modifying an existing one, please read through the documented set of the common requirements and expectations.

Building

This project can be built with meson. The typical meson workflow is: meson builddir && ninja -C builddir.

The meson files used to handle the YAML files are automatically generated and found under the gen subdirectory. When adding or removing YAML files, this must be regenerated. This can be done with the helper script found in the gen subdirectory: cd gen && ./regenerate-meson.

Configuration

Only the xyz/openbmc_project and org/freedesktop interfaces are built by default. Other interfaces can be enabled by meson options:

  • com/ibm - -Ddata_com_ibm=true
  • org/open_power - -Ddata_org_open_power=true

Example: meson builddir -Ddata_com_ibm=true && ninja -C builddir

References