Skip to content

Commit 133cd25

Browse files
Update documentation for complex filters
Signed-off-by: Stew Francis <[email protected]>
1 parent 480ef24 commit 133cd25

File tree

6 files changed

+249
-27
lines changed

6 files changed

+249
-27
lines changed

docs/source/modules/cmci_action.rst

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,20 +181,37 @@ resources
181181

182182

183183
complex_filter
184-
A string containing logical expressions that filter the resource table records in the data returned on the request.
184+
A dictionary representing a complex filter expression. Complex filters are composed of filter expressions, represented as dictionaries. Each dictionary can specify either an attribute expression, a list of filter expressions to be composed with the ``and`` operator, or a list of filter expressions to be composed with the ``or`` operator.
185+
186+
The ``attribute``, ``and`` and ``or`` options are mutually exclusive with each other.
185187

186188
Can contain one or more filters. Multiple filters must be combined using ``and`` or ``or`` logical operators.
187189

188190
Filters can be nested. At most four nesting layers are allowed.
189191

192+
When supplying the ``attribute`` option, you must also supply a ``value`` for the filter. You can also override the default operator with the ``=`` option.
193+
194+
For examples, see :ref:`ibm.ibm_zos_cics.cmci_get <ibm.ibm_zos_cics.cmci_get_module>`
195+
190196

191197
| **required**: False
192198
| **type**: dict
193199
194200

195201

202+
and
203+
A list of filter expressions to be combined with an ``and`` operation.
204+
205+
Filter expressions are nested ``complex_filter`` elements. Each nested filter expression can be either an ``attribute``, ``and`` or ``or`` complex filter expression.
206+
207+
208+
| **required**: False
209+
| **type**: list
210+
211+
212+
196213
attribute
197-
The resource table attributes to be filtered.
214+
The name of a resource table attribute on which to filter.
198215

199216
For supported attributes of different resource types, see their resource table reference, for example, `PROGDEF resource table reference <https://www.ibm.com/support/knowledgecenter/en/SSGMCP_5.6.0/reference-cpsm-restables/cpsm-restables/PROGDEFtab.html>`_.
200217

@@ -216,6 +233,17 @@ resources
216233
217234

218235

236+
or
237+
A list of filter expressions to be combined with an ``or`` operation.
238+
239+
Filter expressions are nested ``complex_filter`` elements. Each nested filter expression can be either an ``attribute``, ``and`` or ``or`` complex filter expression.
240+
241+
242+
| **required**: False
243+
| **type**: list
244+
245+
246+
219247
value
220248
The value by which you are to filter the resource attributes.
221249

@@ -229,11 +257,21 @@ resources
229257

230258

231259
filter
232-
A string containing basic logical expressions that filter the resource table records in the data returned on the request.
260+
A dictionary with attribute names as keys, and target values, to be used as criteria to filter the set of resources returned from CICSPlex SM.
261+
262+
Filters implicitly use the ``=`` operator
263+
264+
Filters for ``string`` type attributes can use the ``*`` and ``+`` wildcard operators
265+
266+
``*`` is a wildcard representing an unknown number of characters, and must appear at the end of the value
267+
268+
``+`` is a wildcard representing a single character, and can appear in any place in the value, potentially multiple times.
269+
270+
To use more complicated filter expressions, including a range of different filter operators, and the ability to compose filters with ``and`` and ``or`` operators, see the ``complex_filter`` parameter.
233271

234-
Supports only the equal logic when filtering attribute values.
272+
For examples, see :ref:`ibm.ibm_zos_cics.cmci_get <ibm.ibm_zos_cics.cmci_get_module>`
235273

236-
Can contain one or more filters.
274+
For more details, see `How to build a filter expression <https://www.ibm.com/support/knowledgecenter/SSGMCP_5.6.0/system-programming/cpsm/eyup1a0.html>`_.
237275

238276
For supported attributes of different resource types, see their resource table reference, for example, `PROGDEF resource table reference <https://www.ibm.com/support/knowledgecenter/en/SSGMCP_5.6.0/reference-cpsm-restables/cpsm-restables/PROGDEFtab.html>`_.
239277

docs/source/modules/cmci_delete.rst

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,20 +141,37 @@ resources
141141

142142

143143
complex_filter
144-
A string containing logical expressions that filter the resource table records in the data returned on the request.
144+
A dictionary representing a complex filter expression. Complex filters are composed of filter expressions, represented as dictionaries. Each dictionary can specify either an attribute expression, a list of filter expressions to be composed with the ``and`` operator, or a list of filter expressions to be composed with the ``or`` operator.
145+
146+
The ``attribute``, ``and`` and ``or`` options are mutually exclusive with each other.
145147

146148
Can contain one or more filters. Multiple filters must be combined using ``and`` or ``or`` logical operators.
147149

148150
Filters can be nested. At most four nesting layers are allowed.
149151

152+
When supplying the ``attribute`` option, you must also supply a ``value`` for the filter. You can also override the default operator with the ``=`` option.
153+
154+
For examples, see :ref:`ibm.ibm_zos_cics.cmci_get <ibm.ibm_zos_cics.cmci_get_module>`
155+
150156

151157
| **required**: False
152158
| **type**: dict
153159
154160

155161

162+
and
163+
A list of filter expressions to be combined with an ``and`` operation.
164+
165+
Filter expressions are nested ``complex_filter`` elements. Each nested filter expression can be either an ``attribute``, ``and`` or ``or`` complex filter expression.
166+
167+
168+
| **required**: False
169+
| **type**: list
170+
171+
172+
156173
attribute
157-
The resource table attributes to be filtered.
174+
The name of a resource table attribute on which to filter.
158175

159176
For supported attributes of different resource types, see their resource table reference, for example, `PROGDEF resource table reference <https://www.ibm.com/support/knowledgecenter/en/SSGMCP_5.6.0/reference-cpsm-restables/cpsm-restables/PROGDEFtab.html>`_.
160177

@@ -176,6 +193,17 @@ resources
176193
177194

178195

196+
or
197+
A list of filter expressions to be combined with an ``or`` operation.
198+
199+
Filter expressions are nested ``complex_filter`` elements. Each nested filter expression can be either an ``attribute``, ``and`` or ``or`` complex filter expression.
200+
201+
202+
| **required**: False
203+
| **type**: list
204+
205+
206+
179207
value
180208
The value by which you are to filter the resource attributes.
181209

@@ -189,11 +217,21 @@ resources
189217

190218

191219
filter
192-
A string containing basic logical expressions that filter the resource table records in the data returned on the request.
220+
A dictionary with attribute names as keys, and target values, to be used as criteria to filter the set of resources returned from CICSPlex SM.
221+
222+
Filters implicitly use the ``=`` operator
223+
224+
Filters for ``string`` type attributes can use the ``*`` and ``+`` wildcard operators
225+
226+
``*`` is a wildcard representing an unknown number of characters, and must appear at the end of the value
227+
228+
``+`` is a wildcard representing a single character, and can appear in any place in the value, potentially multiple times.
229+
230+
To use more complicated filter expressions, including a range of different filter operators, and the ability to compose filters with ``and`` and ``or`` operators, see the ``complex_filter`` parameter.
193231

194-
Supports only the equal logic when filtering attribute values.
232+
For examples, see :ref:`ibm.ibm_zos_cics.cmci_get <ibm.ibm_zos_cics.cmci_get_module>`
195233

196-
Can contain one or more filters.
234+
For more details, see `How to build a filter expression <https://www.ibm.com/support/knowledgecenter/SSGMCP_5.6.0/system-programming/cpsm/eyup1a0.html>`_.
197235

198236
For supported attributes of different resource types, see their resource table reference, for example, `PROGDEF resource table reference <https://www.ibm.com/support/knowledgecenter/en/SSGMCP_5.6.0/reference-cpsm-restables/cpsm-restables/PROGDEFtab.html>`_.
199237

docs/source/modules/cmci_get.rst

Lines changed: 64 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,20 +154,37 @@ resources
154154

155155

156156
complex_filter
157-
A string containing logical expressions that filter the resource table records in the data returned on the request.
157+
A dictionary representing a complex filter expression. Complex filters are composed of filter expressions, represented as dictionaries. Each dictionary can specify either an attribute expression, a list of filter expressions to be composed with the ``and`` operator, or a list of filter expressions to be composed with the ``or`` operator.
158+
159+
The ``attribute``, ``and`` and ``or`` options are mutually exclusive with each other.
158160

159161
Can contain one or more filters. Multiple filters must be combined using ``and`` or ``or`` logical operators.
160162

161163
Filters can be nested. At most four nesting layers are allowed.
162164

165+
When supplying the ``attribute`` option, you must also supply a ``value`` for the filter. You can also override the default operator with the ``=`` option.
166+
167+
For examples, see :ref:`ibm.ibm_zos_cics.cmci_get <ibm.ibm_zos_cics.cmci_get_module>`
168+
163169

164170
| **required**: False
165171
| **type**: dict
166172
167173

168174

175+
and
176+
A list of filter expressions to be combined with an ``and`` operation.
177+
178+
Filter expressions are nested ``complex_filter`` elements. Each nested filter expression can be either an ``attribute``, ``and`` or ``or`` complex filter expression.
179+
180+
181+
| **required**: False
182+
| **type**: list
183+
184+
185+
169186
attribute
170-
The resource table attributes to be filtered.
187+
The name of a resource table attribute on which to filter.
171188

172189
For supported attributes of different resource types, see their resource table reference, for example, `PROGDEF resource table reference <https://www.ibm.com/support/knowledgecenter/en/SSGMCP_5.6.0/reference-cpsm-restables/cpsm-restables/PROGDEFtab.html>`_.
173190

@@ -189,6 +206,17 @@ resources
189206
190207

191208

209+
or
210+
A list of filter expressions to be combined with an ``or`` operation.
211+
212+
Filter expressions are nested ``complex_filter`` elements. Each nested filter expression can be either an ``attribute``, ``and`` or ``or`` complex filter expression.
213+
214+
215+
| **required**: False
216+
| **type**: list
217+
218+
219+
192220
value
193221
The value by which you are to filter the resource attributes.
194222

@@ -202,11 +230,21 @@ resources
202230

203231

204232
filter
205-
A string containing basic logical expressions that filter the resource table records in the data returned on the request.
233+
A dictionary with attribute names as keys, and target values, to be used as criteria to filter the set of resources returned from CICSPlex SM.
234+
235+
Filters implicitly use the ``=`` operator
236+
237+
Filters for ``string`` type attributes can use the ``*`` and ``+`` wildcard operators
206238

207-
Supports only the equal logic when filtering attribute values.
239+
``*`` is a wildcard representing an unknown number of characters, and must appear at the end of the value
208240

209-
Can contain one or more filters.
241+
``+`` is a wildcard representing a single character, and can appear in any place in the value, potentially multiple times.
242+
243+
To use more complicated filter expressions, including a range of different filter operators, and the ability to compose filters with ``and`` and ``or`` operators, see the ``complex_filter`` parameter.
244+
245+
For examples, see :ref:`ibm.ibm_zos_cics.cmci_get <ibm.ibm_zos_cics.cmci_get_module>`
246+
247+
For more details, see `How to build a filter expression <https://www.ibm.com/support/knowledgecenter/SSGMCP_5.6.0/system-programming/cpsm/eyup1a0.html>`_.
210248

211249
For supported attributes of different resource types, see their resource table reference, for example, `PROGDEF resource table reference <https://www.ibm.com/support/knowledgecenter/en/SSGMCP_5.6.0/reference-cpsm-restables/cpsm-restables/PROGDEFtab.html>`_.
212250

@@ -330,6 +368,27 @@ Examples
330368
- name: csdgroup
331369
value: MYGRP
332370
record_count: 1
371+
372+
- name: Using complex_filter to combine filter expressions and change operators
373+
cmci_get:
374+
cmci_host: 'winmvs2c.hursley.ibm.com'
375+
cmci_port: '10080'
376+
cmci_cert: './sec/ansible.pem'
377+
cmci_key: './sec/ansible.key'
378+
context: 'iyk3z0r9'
379+
type: 'CICSRegion'
380+
resource:
381+
complex_filter:
382+
or: [{
383+
attribute: 'currtasks',
384+
value: '10',
385+
operator: '<'
386+
}, {
387+
attribute: 'currtasks',
388+
value: '100',
389+
operator: '>'
390+
}]
391+
record_count: 1
333392

334393

335394

docs/source/modules/cmci_update.rst

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,20 +150,37 @@ resources
150150

151151

152152
complex_filter
153-
A string containing logical expressions that filter the resource table records in the data returned on the request.
153+
A dictionary representing a complex filter expression. Complex filters are composed of filter expressions, represented as dictionaries. Each dictionary can specify either an attribute expression, a list of filter expressions to be composed with the ``and`` operator, or a list of filter expressions to be composed with the ``or`` operator.
154+
155+
The ``attribute``, ``and`` and ``or`` options are mutually exclusive with each other.
154156

155157
Can contain one or more filters. Multiple filters must be combined using ``and`` or ``or`` logical operators.
156158

157159
Filters can be nested. At most four nesting layers are allowed.
158160

161+
When supplying the ``attribute`` option, you must also supply a ``value`` for the filter. You can also override the default operator with the ``=`` option.
162+
163+
For examples, see :ref:`ibm.ibm_zos_cics.cmci_get <ibm.ibm_zos_cics.cmci_get_module>`
164+
159165

160166
| **required**: False
161167
| **type**: dict
162168
163169

164170

171+
and
172+
A list of filter expressions to be combined with an ``and`` operation.
173+
174+
Filter expressions are nested ``complex_filter`` elements. Each nested filter expression can be either an ``attribute``, ``and`` or ``or`` complex filter expression.
175+
176+
177+
| **required**: False
178+
| **type**: list
179+
180+
181+
165182
attribute
166-
The resource table attributes to be filtered.
183+
The name of a resource table attribute on which to filter.
167184

168185
For supported attributes of different resource types, see their resource table reference, for example, `PROGDEF resource table reference <https://www.ibm.com/support/knowledgecenter/en/SSGMCP_5.6.0/reference-cpsm-restables/cpsm-restables/PROGDEFtab.html>`_.
169186

@@ -185,6 +202,17 @@ resources
185202
186203

187204

205+
or
206+
A list of filter expressions to be combined with an ``or`` operation.
207+
208+
Filter expressions are nested ``complex_filter`` elements. Each nested filter expression can be either an ``attribute``, ``and`` or ``or`` complex filter expression.
209+
210+
211+
| **required**: False
212+
| **type**: list
213+
214+
215+
188216
value
189217
The value by which you are to filter the resource attributes.
190218

@@ -198,11 +226,21 @@ resources
198226

199227

200228
filter
201-
A string containing basic logical expressions that filter the resource table records in the data returned on the request.
229+
A dictionary with attribute names as keys, and target values, to be used as criteria to filter the set of resources returned from CICSPlex SM.
230+
231+
Filters implicitly use the ``=`` operator
232+
233+
Filters for ``string`` type attributes can use the ``*`` and ``+`` wildcard operators
234+
235+
``*`` is a wildcard representing an unknown number of characters, and must appear at the end of the value
236+
237+
``+`` is a wildcard representing a single character, and can appear in any place in the value, potentially multiple times.
238+
239+
To use more complicated filter expressions, including a range of different filter operators, and the ability to compose filters with ``and`` and ``or`` operators, see the ``complex_filter`` parameter.
202240

203-
Supports only the equal logic when filtering attribute values.
241+
For examples, see :ref:`ibm.ibm_zos_cics.cmci_get <ibm.ibm_zos_cics.cmci_get_module>`
204242

205-
Can contain one or more filters.
243+
For more details, see `How to build a filter expression <https://www.ibm.com/support/knowledgecenter/SSGMCP_5.6.0/system-programming/cpsm/eyup1a0.html>`_.
206244

207245
For supported attributes of different resource types, see their resource table reference, for example, `PROGDEF resource table reference <https://www.ibm.com/support/knowledgecenter/en/SSGMCP_5.6.0/reference-cpsm-restables/cpsm-restables/PROGDEFtab.html>`_.
208246

0 commit comments

Comments
 (0)