summaryrefslogtreecommitdiffstats
path: root/src/example/example.yaml
blob: 264a71e991f9396c8481e100af409e8990d74d01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# Example PDM configuration file.

- name: example path group
  description: >
    'A path group is a named collection of D-Bus object
    paths and associated metadata.  These collections
    serve only to be referenced by other configuration
    directives.

    The metadata element has different uses depending
    on the referencing directive.

    Within a single configuration file path group names
    must be unique.  The same name can appear in multiple
    configuration files; however, the referencing directive
    will only search for the group in the same configuration
    file.'
  class: group
  group: path
  members:
    - meta: PATH
      path: /xyz/openbmc_project/testing/inst1
    - meta: PATH
      path: /xyz/openbmc_project/testing/inst2
    - meta: PATH
      path: /xyz/openbmc_project/testing/inst3
    - meta: PATH
      path: /xyz/openbmc_project/testing/inst4

- name: example property group
  description: >
    'Like path groups, a property group is a named collection
    of D-Bus property names and associated metadata.

    Properties in a group must all have the same D-Bus type signature
    and must be explicitly declared.'
  class: group
  group: property
  type: uint32
  members:
    - interface: xyz.openbmc_project.Sensor.Value
      meta: PROPERTY
      property: ValueA
    - interface: xyz.openbmc_project.Sensor.Value
      meta: PROPERTY
      property: ValueB

- name: example property watch
  description: >
    'A property watch instructs PDM to maintain a cache of the state
    of the specified properties on the specified D-Bus objects.

    An optional callback can be triggered when property values change.'
  class: watch
  watch: property
  paths: example path group
  properties: example property group
  callback: example count condition

- name: example journal callback
  description: >
    'Callbacks are actions PDM should take when instructed to do so.

    Some callback types refer to a group of paths and group of properties
    in a similar fashion as the property watch directive.

    The journal callback logs the specified message to the systemd journal
    with the specified severity.

    Additionally, the journal callback will add to the journal key value
    pair metadata for each property in the specified property group with
    the key being the property element metadata and the value being the
    property value.'
  class: callback
  callback: journal
  paths: example path group
  properties: example property group
  severity: INFO
  message: Hello world from PDM!

- name: example elog callback
  description: >
    'Callbacks are actions PDM should take when instructed to do so.

    Some callback types refer to a group of paths and group of properties
    in a similar fashion as the property watch directive.

    The elog callback logs the elog and elog metadata.'
  class: callback
  callback: elog
  paths: example path group
  properties: example property group
  error: xyz::openbmc_project::Common::Error::InvalidArgument
  metadata:
    - name: xyz::openbmc_project::Common::InvalidArgument::ARGUMENT_NAME
      value: testing...
      type: string
    - name: xyz::openbmc_project::Common::InvalidArgument::ARGUMENT_VALUE
      value: testing...
      type: string

- name: example method callback
  description: >
    'The method callback invokes the specified D-Bus method.'
  class: callback
  callback: method
  service: org.freedesktop.systemd1
  path: /org/freedesktop/systemd1
  interface: org.freedesktop.systemd1.Manager
  method: StartUnit
  args:
    - value: foo.unit
      type: string
    - value: replace
      type: string

- name: example callback group
  description: >
    'Callbacks groups are simply named collections of other callbacks.
    Configuration file directives can only refer to a single callback.
    Through use of a group, these configuration file directives can
    refer to more than one callback.

    For example for a given event, one may wish to trace multiple
    messages to the systemd journal.  The journal callback does not
    support tracing multiple messages.  To do that, define a callback
    group composed of multiple journal callbacks.'

  class: callback
  callback: group
  members:
    - example journal callback
    - example deferred condition
    - example elog callback

- name: example count condition
  description: >
    'Conditions or conditional callbacks apply a test prior to invoking
    the callback function.

    All conditional callbacks must specify the callback to issue if
    the condition evaluates.

    The count condition applies the op comparison operator to the value of each
    property in the specified groups.  It then counts the number of properties
    that pass the comparison, and applies another comparison on the result
    against the specified bound.

    For example, a callback that requires at least three temperature sensors
    in the group to be higher than 115 degrees might use a count condition
    with an op of >, a count op of >=, a bound of 115, and a countbound of 3.'

  class: condition
  condition: count
  paths: example path group
  properties: example property group
  callback: example callback group
  countop: '>='
  countbound: 3
  op: '>='
  bound: 115

- name: example deferred condition
  description: >
    'Deferred conditions operate in the same fashion as conditional callbacks
    with the added behavior that when the condition is tested and is met,
    invocation of the callback is deferred by the interval specified.

    When the configured time has elapsed, if the condition has not been reevaluated
    the callback is invoked.

    Any condition type can be deferred in this way by setting the defer attribute.'

  class: condition
  condition: count
  paths: example path group
  properties: example property group
  defer: 1000us
  callback: example callback group
  countop: '>='
  countbound: 3
  op: '>='
  bound: 115
OpenPOWER on IntegriCloud