inventory: define a decorator for managed hosts

In order to support multi-host Redfish, we need a mechanism for bmcweb
to find the associated objects for managing the host, such as the
phosphor-state-management objects for power control.  Most of the
existing designs use a numerical index rather than an association.
Define a decorator that can be added to inventory items, so that
bmcweb has a clear mapping to the host management objects without
requiring them to all add new associations.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Iee69e0a95c2e04089c5ac512d9c8825c62737179
diff --git a/gen/xyz/openbmc_project/Inventory/Decorator/ManagedHost/meson.build b/gen/xyz/openbmc_project/Inventory/Decorator/ManagedHost/meson.build
new file mode 100644
index 0000000..6ce0158
--- /dev/null
+++ b/gen/xyz/openbmc_project/Inventory/Decorator/ManagedHost/meson.build
@@ -0,0 +1,15 @@
+# Generated file; do not modify.
+generated_sources += custom_target(
+    'xyz/openbmc_project/Inventory/Decorator/ManagedHost__cpp'.underscorify(),
+    input: [ '../../../../../../yaml/xyz/openbmc_project/Inventory/Decorator/ManagedHost.interface.yaml',  ],
+    output: [ 'common.hpp', 'server.cpp', 'server.hpp', 'aserver.hpp', 'client.hpp',  ],
+    depend_files: sdbusplusplus_depfiles,
+    command: [
+        sdbuspp_gen_meson_prog, '--command', 'cpp',
+        '--output', meson.current_build_dir(),
+        '--tool', sdbusplusplus_prog,
+        '--directory', meson.current_source_dir() / '../../../../../../yaml',
+        'xyz/openbmc_project/Inventory/Decorator/ManagedHost',
+    ],
+)
+
diff --git a/gen/xyz/openbmc_project/Inventory/Decorator/meson.build b/gen/xyz/openbmc_project/Inventory/Decorator/meson.build
index 7a1f970..2b7a712 100644
--- a/gen/xyz/openbmc_project/Inventory/Decorator/meson.build
+++ b/gen/xyz/openbmc_project/Inventory/Decorator/meson.build
@@ -134,6 +134,21 @@
     ],
 )
 
+subdir('ManagedHost')
+generated_others += custom_target(
+    'xyz/openbmc_project/Inventory/Decorator/ManagedHost__markdown'.underscorify(),
+    input: [ '../../../../../yaml/xyz/openbmc_project/Inventory/Decorator/ManagedHost.interface.yaml',  ],
+    output: [ 'ManagedHost.md' ],
+    depend_files: sdbusplusplus_depfiles,
+    command: [
+        sdbuspp_gen_meson_prog, '--command', 'markdown',
+        '--output', meson.current_build_dir(),
+        '--tool', sdbusplusplus_prog,
+        '--directory', meson.current_source_dir() / '../../../../../yaml',
+        'xyz/openbmc_project/Inventory/Decorator/ManagedHost',
+    ],
+)
+
 subdir('ManufacturerExt')
 generated_others += custom_target(
     'xyz/openbmc_project/Inventory/Decorator/ManufacturerExt__markdown'.underscorify(),
diff --git a/yaml/xyz/openbmc_project/Inventory/Decorator/ManagedHost.interface.yaml b/yaml/xyz/openbmc_project/Inventory/Decorator/ManagedHost.interface.yaml
new file mode 100644
index 0000000..8f5bf7d
--- /dev/null
+++ b/yaml/xyz/openbmc_project/Inventory/Decorator/ManagedHost.interface.yaml
@@ -0,0 +1,11 @@
+description: >
+    Implement to define the inventory item as being the embodiment of a managed
+    host computer system.
+properties:
+    - name: HostIndex
+      type: size
+      description:
+          The index / identifier of the managed host computer system.  Many
+          existing designs use an index-based design for representing the
+          host.  This index is used for finding those relationship when an
+          existing association is not defined.