Skip to content

Commit 3384d3f

Browse files
committed
Move over docs to Python file
1 parent da61ada commit 3384d3f

File tree

2 files changed

+43
-46
lines changed

2 files changed

+43
-46
lines changed

plugins/filter/filter_by_resource_type.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,49 @@
1111

1212
from ansible.errors import AnsibleFilterError
1313

14+
__metaclass__ = type
15+
16+
DOCUMENTATION = r"""
17+
name: filter_by_resource_type
18+
author: Alex Moreno (@rexemin)
19+
version_added: "2.0.0"
20+
short_description: filter returned fields from zos_stat
21+
description:
22+
- Extract only the relevant fields for a resource from the output of zos_stat.
23+
- Choose between data set, file, aggregate or GDG fields.
24+
options:
25+
attributes:
26+
description:
27+
- Output from zos_stat.
28+
type: dict
29+
required: true
30+
resource:
31+
description:
32+
- Type of resource which fields should be filtered from the returned JSON of zos_stat.
33+
- If the resource is a data set, the filter will only include the relevant fields for
34+
the specific type of data set queried by zos_stat. When C(isdataset=False), only
35+
common data sets attribute fields will be returned.
36+
type: str
37+
required: true
38+
choices:
39+
- data_set
40+
- file
41+
- aggregate
42+
- gdg
43+
"""
44+
45+
EXAMPLES = r"""
46+
- name: Get only data set specific attributes.
47+
set_fact:
48+
clean_output: "{{ zos_stat_output | ibm.ibm_zos_core.filter_by_resource_type('data_set') }}"
49+
"""
50+
51+
RETURN = r"""
52+
_value:
53+
description: Stripped-down dictionary containing the fields relevant for the selected resource.
54+
type: dict
55+
"""
56+
1457

1558
VALID_FIELDS = {
1659
'data_set': [

plugins/filter/filter_by_resource_type.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)