diff options
| author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2017-01-30 08:52:26 -0500 |
|---|---|---|
| committer | Patrick Williams <patrick@stwcx.xyz> | 2017-02-15 17:43:18 +0000 |
| commit | d0f48adcb11d1640cc906446f6222c2b95052cb5 (patch) | |
| tree | e13a71aa31714f18817561fe1d3e6c38be6998f4 /example | |
| parent | c1f4798d36e63842c97692ca1a36c0975da18c09 (diff) | |
| download | phosphor-inventory-manager-d0f48adcb11d1640cc906446f6222c2b95052cb5.tar.gz phosphor-inventory-manager-d0f48adcb11d1640cc906446f6222c2b95052cb5.zip | |
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>
Diffstat (limited to 'example')
| -rw-r--r-- | example/events.d/match1.yaml | 37 | ||||
| -rw-r--r-- | example/events.d/match2.yaml | 36 |
2 files changed, 73 insertions, 0 deletions
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 @@ events: 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 @@ events: 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 |

