File tree Expand file tree Collapse file tree 2 files changed +43
-46
lines changed Expand file tree Collapse file tree 2 files changed +43
-46
lines changed Original file line number Diff line number Diff line change 1111
1212from 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
1558VALID_FIELDS = {
1659 'data_set' : [
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments