Add PowerState Interface
There are many cases where a BMC would have to show the power state
of a FRU, This commit adds a generic interface for capturing the
power state of an object.
This would help map the actual power state of the FRU to redfish.
Below is the spec link :
http://redfish.dmtf.org/schemas/v1/Resource.json#/definitions/PowerState
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
Change-Id: Iea8455ef9b03de7923104c1e29d28a201756fc7a
diff --git a/gen/xyz/openbmc_project/State/Decorator/PowerState/meson.build b/gen/xyz/openbmc_project/State/Decorator/PowerState/meson.build
new file mode 100644
index 0000000..c66acd3
--- /dev/null
+++ b/gen/xyz/openbmc_project/State/Decorator/PowerState/meson.build
@@ -0,0 +1,14 @@
+# Generated file; do not modify.
+generated_sources += custom_target(
+ 'xyz/openbmc_project/State/Decorator/PowerState__cpp'.underscorify(),
+ input: [ '../../../../../../yaml/xyz/openbmc_project/State/Decorator/PowerState.interface.yaml', ],
+ output: [ 'server.cpp', 'server.hpp', 'client.hpp', ],
+ command: [
+ sdbuspp_gen_meson_prog, '--command', 'cpp',
+ '--output', meson.current_build_dir(),
+ '--tool', sdbusplusplus_prog,
+ '--directory', meson.current_source_dir() / '../../../../../../yaml',
+ 'xyz/openbmc_project/State/Decorator/PowerState',
+ ],
+)
+
diff --git a/gen/xyz/openbmc_project/State/Decorator/meson.build b/gen/xyz/openbmc_project/State/Decorator/meson.build
index e490011..6fe765f 100644
--- a/gen/xyz/openbmc_project/State/Decorator/meson.build
+++ b/gen/xyz/openbmc_project/State/Decorator/meson.build
@@ -27,3 +27,17 @@
],
)
+subdir('PowerState')
+generated_others += custom_target(
+ 'xyz/openbmc_project/State/Decorator/PowerState__markdown'.underscorify(),
+ input: [ '../../../../../yaml/xyz/openbmc_project/State/Decorator/PowerState.interface.yaml', ],
+ output: [ 'PowerState.md' ],
+ command: [
+ sdbuspp_gen_meson_prog, '--command', 'markdown',
+ '--output', meson.current_build_dir(),
+ '--tool', sdbusplusplus_prog,
+ '--directory', meson.current_source_dir() / '../../../../../yaml',
+ 'xyz/openbmc_project/State/Decorator/PowerState',
+ ],
+)
+
diff --git a/yaml/xyz/openbmc_project/State/Decorator/PowerState.interface.yaml b/yaml/xyz/openbmc_project/State/Decorator/PowerState.interface.yaml
new file mode 100644
index 0000000..4f8ea2d
--- /dev/null
+++ b/yaml/xyz/openbmc_project/State/Decorator/PowerState.interface.yaml
@@ -0,0 +1,29 @@
+description: >
+ Implement to indicate the power state of the object
+properties:
+ - name: PowerState
+ type: enum[self.State]
+ default: Unknown
+ description: >
+ The current power status of the object.
+
+enumerations:
+ - name: State
+ description: >
+ Power state enum.
+ values:
+ - name: On
+ description: >
+ The state of the object is powered on.
+ - name: Off
+ description: >
+ The state of the object is powered off.
+ - name: PoweringOn
+ description: >
+ The object is in a temporary state between off and on.
+ - name: PoweringOff
+ description: >
+ The object is in a temporary state between on and off.
+ - name: Unknown
+ description: >
+ The power state is unknown.