Add path conditions
Add support to setProperty and destroyObject to conditionally
perform their action based on the result of a condition testing
functor.
Change-Id: I67ded31f4a7ee0f7a29bb6edc06ebf9249cdc070
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/example/events.d/match1.yaml b/example/events.d/match1.yaml
index 7133271..3763093 100644
--- a/example/events.d/match1.yaml
+++ b/example/events.d/match1.yaml
@@ -89,4 +89,41 @@
value: foo
type: string
+ - name: conditional setProperty example
+ description: >
+ Sets the ExampleProperty1 on the /changeme object when
+ the value of ExampleProperty3 on /testing/trigger7
+ changes to 10 and the value of the ExampleProperty3
+ value on /changeme is 22.
+ type: match
+ signatures:
+ - type: signal
+ path: /testing/trigger7
+ interface: org.freedesktop.DBus.Properties
+ member: PropertiesChanged
+ filters:
+ - name: propertyChangedTo
+ interface: xyz.openbmc_project.Example.Iface2
+ property: ExampleProperty3
+ value:
+ value: 10
+ type: int64
+ actions:
+ - name: setProperty
+ interface: xyz.openbmc_project.Example.Iface1
+ property: ExampleProperty1
+ paths:
+ - /changeme
+ value:
+ type: string
+ value: changed
+ conditions:
+ - name: propertyIs
+ interface: xyz.openbmc_project.Example.Iface2
+ property: ExampleProperty3
+ value:
+ value: 22
+ type: int64
+
+
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
diff --git a/example/events.d/match2.yaml b/example/events.d/match2.yaml
index 31836b0..6fbe496 100644
--- a/example/events.d/match2.yaml
+++ b/example/events.d/match2.yaml
@@ -82,4 +82,40 @@
paths:
- /deleteme3
+ - name: conditional destroyObject example
+ description: >
+ Destroys the /deleteme3 object when the value of
+ ExampleProperty3 on /testing/trigger6
+ changes to 10 and the value of the ExampleProperty3
+ value on /deleteme3 is 22.
+ Destroys the /deleteme4 object when the value of
+ ExampleProperty3 on /testing/trigger6
+ changes to 10 and the value of the ExampleProperty3
+ value on /deleteme4 is 22.
+ type: match
+ signatures:
+ - type: signal
+ path: /testing/trigger6
+ interface: org.freedesktop.DBus.Properties
+ member: PropertiesChanged
+ filters:
+ - name: propertyChangedTo
+ interface: xyz.openbmc_project.Example.Iface2
+ property: ExampleProperty3
+ value:
+ value: 10
+ type: int64
+ actions:
+ - name: destroyObjects
+ paths:
+ - /deleteme3
+ - /deleteme4
+ conditions:
+ - name: propertyIs
+ interface: xyz.openbmc_project.Example.Iface2
+ property: ExampleProperty3
+ value:
+ value: 22
+ type: int64
+
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4