summaryrefslogtreecommitdiffstats
path: root/example
diff options
context:
space:
mode:
authorMatthew Barth <msbarth@us.ibm.com>2018-10-05 15:29:26 -0500
committerMatthew Barth <msbarth@us.ibm.com>2018-10-23 09:23:08 -0500
commit979eb591652fba30f86ec5b7f5c5f73c06651c70 (patch)
tree1663bd80d408bcce23b16596bd11fe7170a66484 /example
parentf094d4428ecad7c2c349287fb811e5d6568644a9 (diff)
downloadphosphor-inventory-manager-979eb591652fba30f86ec5b7f5c5f73c06651c70.tar.gz
phosphor-inventory-manager-979eb591652fba30f86ec5b7f5c5f73c06651c70.zip
Generate functor to read a property
Given the dbus member class for an interface and property hosted by inventory manager, generate the getProperty functor for retrieving that property from inventory. This ability is only supported when using the `PropertyIs` functor to compare a property within inventory to a given value before triggering an action. Example yaml: filters: - name: propertyIs service: xyz.openbmc_project.Inventory.Manager path: /system/chassis interface: xyz.openbmc_project.Inventory.Decorator.CoolingType property: WaterCooled value: value: true type: boolean dbusMember: "sdbusplus::xyz::openbmc_project::Inventory::\ Decorator::server::CoolingType" Generates: make_filter(functor::propertyIs( "/system/chassis", "xyz.openbmc_project.Inventory.Decorator.CoolingType", "WaterCooled", true, "xyz.openbmc_project.Inventory.Manager", make_get_property<> ( functor::getProperty<sdbusplus::xyz::openbmc_project:: Inventory::Decorator::server::CoolingType> ( "/system/chassis", "xyz.openbmc_project.Inventory.Decorator.CoolingType", &sdbusplus::xyz::openbmc_project::Inventory:: Decorator::server::CoolingType::getPropertyByName, "WaterCooled" ) ) )) Tested: Code generated as expected with service name given Code generated as expected without service name given Resolves: openbmc/phosphor-inventory-manager#1 Change-Id: I5600854a1b0b9ce3e1511d3bcd9a452d6b1107ba Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
Diffstat (limited to 'example')
-rw-r--r--example/events.d/match1.yaml13
1 files changed, 12 insertions, 1 deletions
diff --git a/example/events.d/match1.yaml b/example/events.d/match1.yaml
index 3763093..6246dbd 100644
--- a/example/events.d/match1.yaml
+++ b/example/events.d/match1.yaml
@@ -78,8 +78,19 @@ events:
- name: startup event example
description: >
- Create /createme3 at startup.
+ Create /createme3 at startup if ExampleProperty1 on /changeme
+ equals changed.
type: startup
+ filters:
+ - name: propertyIs
+ path: /changeme
+ interface: xyz.openbmc_project.Example.Iface1
+ property: ExampleProperty1
+ value:
+ value: changed
+ type: string
+ dbusMember: "sdbusplus::xyz::openbmc_project::Example::\
+ server::Iface1"
actions:
- name: createObjects
objs:
OpenPOWER on IntegriCloud