Debian Codegraph @

ansible_collections/check_point/mgmt/plugins/modules/cp_mgmt_radius_group_facts.py

raw
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3 #
4 # Ansible module to manage CheckPoint Firewall (c) 2019
5 #
6 # Ansible is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # Ansible is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with Ansible. If not, see <http://www.gnu.org/licenses/>.
18 #
19
20 from __future__ import (absolute_import, division, print_function)
21
22 __metaclass__ = type
23
24 ANSIBLE_METADATA = {'metadata_version': '1.1',
25 'status': ['preview'],
26 'supported_by': 'community'}
27
28 DOCUMENTATION = """
29 ---
30 module: cp_mgmt_radius_group_facts
31 short_description: Get radius-group objects facts on Checkpoint over Web Services API
32 description:
33 - Get radius-group objects facts on Checkpoint devices.
34 - All operations are performed over Web Services API.
35 - This module handles both operations, get a specific object and get several objects,
36 For getting a specific object use the parameter 'name'.
37 - Available from R81.20 management version.
38 version_added: "5.0.0"
39 author: "Shiran Golzar (@chkp-shirango)"
40 options:
41 name:
42 description:
43 - Object name.
44 This parameter is relevant only for getting a specific object.
45 type: str
46 details_level:
47 description:
48 - The level of detail for some of the fields in the response can vary from showing only the UID value of the object to a fully detailed
49 representation of the object.
50 type: str
51 choices: ['uid', 'standard', 'full']
52 filter:
53 description:
54 - Search expression to filter objects by. The provided text should be exactly the same as it would be given in SmartConsole Object Explorer. The
55 logical operators in the expression ('AND', 'OR') should be provided in capital letters. The search involves both a IP search and a textual search in
56 name, comment, tags etc.
57 type: str
58 limit:
59 description:
60 - The maximal number of returned results.
61 This parameter is relevant only for getting few objects.
62 type: int
63 offset:
64 description:
65 - Number of the results to initially skip.
66 This parameter is relevant only for getting few objects.
67 type: int
68 order:
69 description:
70 - Sorts the results by search criteria. Automatically sorts the results by Name, in the ascending order.
71 This parameter is relevant only for getting few objects.
72 type: list
73 elements: dict
74 suboptions:
75 ASC:
76 description:
77 - Sorts results by the given field in ascending order.
78 type: str
79 choices: ['name']
80 DESC:
81 description:
82 - Sorts results by the given field in descending order.
83 type: str
84 choices: ['name']
85 dereference_group_members:
86 description:
87 - Indicates whether to dereference "members" field by details level for every object in reply.
88 type: bool
89 show_membership:
90 description:
91 - Indicates whether to calculate and show "groups" field for every object in reply.
92 type: bool
93 async_response:
94 description:
95 - Run command in asynchronous mode and return task UID. Use show-task command to check the progress of the task.
96 type: bool
97 domains_to_process:
98 description:
99 - Indicates which domains to process the commands on. It cannot be used with the details-level full, must be run from the System Domain only and
100 with ignore-warnings true. Valid values are, CURRENT_DOMAIN, ALL_DOMAINS_ON_THIS_SERVER.
101 type: list
102 elements: str
103 extends_documentation_fragment: check_point.mgmt.checkpoint_facts
104 """
105
106 EXAMPLES = """
107 - name: show-radius-group
108 cp_mgmt_radius_group_facts:
109 name: radgroup
110
111 - name: show-radius-groups
112 cp_mgmt_radius_group_facts:
113 details_level: standard
114 limit: 4
115 offset: 0
116 """
117
118 RETURN = """
119 ansible_facts:
120 description: The checkpoint object facts.
121 returned: always.
122 type: dict
123 """
124
125 from ansible.module_utils.basic import AnsibleModule
126 from ansible_collections.check_point.mgmt.plugins.module_utils.checkpoint import checkpoint_argument_spec_for_facts, \
127 api_call_facts
128
129
130 def main():
131 argument_spec = dict(
132 name=dict(type='str'),
133 details_level=dict(type='str', choices=['uid', 'standard', 'full']),
134 filter=dict(type='str'),
135 limit=dict(type='int'),
136 offset=dict(type='int'),
137 order=dict(type='list', elements='dict', options=dict(
138 ASC=dict(type='str', choices=['name']),
139 DESC=dict(type='str', choices=['name'])
140 )),
141 dereference_group_members=dict(type='bool'),
142 show_membership=dict(type='bool'),
143 async_response=dict(type='bool'),
144 domains_to_process=dict(type='list', elements='str')
145 )
146 argument_spec.update(checkpoint_argument_spec_for_facts)
147
148 module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=True)
149
150 api_call_object = "radius-group"
151 api_call_object_plural_version = "radius-groups"
152
153 result = api_call_facts(module, api_call_object, api_call_object_plural_version)
154 module.exit_json(ansible_facts=result)
155
156
157 if __name__ == '__main__':
158 main()