Debian Codegraph @

ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_fmupdate_fgdsetting.py

raw symbols SCIP
1 #!/usr/bin/python
2 from __future__ import absolute_import, division, print_function
3 # Copyright 2019-2024 Fortinet, Inc.
4 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
5
6 __metaclass__ = type
7
8 ANSIBLE_METADATA = {'status': ['preview'],
9 'supported_by': 'community',
10 'metadata_version': '1.1'}
11
12 DOCUMENTATION = '''
13 ---
14 module: fmgr_fmupdate_fgdsetting
15 short_description: Cli fmupdate fgd setting
16 version_added: "2.10.0"
17 extends_documentation_fragment:
18 - fortinet.fortimanager.general
19 - fortinet.fortimanager.general.partial_crud
20 options:
21 fmupdate_fgdsetting:
22 description: The top level parameters set.
23 required: false
24 type: dict
25 suboptions:
26 as_cache:
27 aliases: ['as-cache']
28 type: int
29 description: As cache.
30 as_log:
31 aliases: ['as-log']
32 type: str
33 description: As log.
34 choices: ['disable', 'nospam', 'all']
35 as_preload:
36 aliases: ['as-preload']
37 type: str
38 description: As preload.
39 choices: ['disable', 'enable']
40 av_cache:
41 aliases: ['av-cache']
42 type: int
43 description: Av cache.
44 av_log:
45 aliases: ['av-log']
46 type: str
47 description: Av log.
48 choices: ['disable', 'novirus', 'all']
49 av_preload:
50 aliases: ['av-preload']
51 type: str
52 description: Av preload.
53 choices: ['disable', 'enable']
54 av2_cache:
55 aliases: ['av2-cache']
56 type: int
57 description: Av2 cache.
58 av2_log:
59 aliases: ['av2-log']
60 type: str
61 description: Av2 log.
62 choices: ['disable', 'noav2', 'all']
63 av2_preload:
64 aliases: ['av2-preload']
65 type: str
66 description: Av2 preload.
67 choices: ['disable', 'enable']
68 eventlog_query:
69 aliases: ['eventlog-query']
70 type: str
71 description: Eventlog query.
72 choices: ['disable', 'enable']
73 fgd_pull_interval:
74 aliases: ['fgd-pull-interval']
75 type: int
76 description: Fgd pull interval.
77 fq_cache:
78 aliases: ['fq-cache']
79 type: int
80 description: Fq cache.
81 fq_log:
82 aliases: ['fq-log']
83 type: str
84 description: Fq log.
85 choices: ['disable', 'nofilequery', 'all']
86 fq_preload:
87 aliases: ['fq-preload']
88 type: str
89 description: Fq preload.
90 choices: ['disable', 'enable']
91 iot_cache:
92 aliases: ['iot-cache']
93 type: int
94 description: Iot cache.
95 iot_log:
96 aliases: ['iot-log']
97 type: str
98 description: Iot log.
99 choices: ['disable', 'noiot', 'all']
100 iot_preload:
101 aliases: ['iot-preload']
102 type: str
103 description: Iot preload.
104 choices: ['disable', 'enable']
105 iotv_preload:
106 aliases: ['iotv-preload']
107 type: str
108 description: Iotv preload.
109 choices: ['disable', 'enable']
110 linkd_log:
111 aliases: ['linkd-log']
112 type: str
113 description: Linkd log.
114 choices: ['emergency', 'alert', 'critical', 'error', 'warn', 'notice', 'info',
115 'debug', 'disable']
116 max_client_worker:
117 aliases: ['max-client-worker']
118 type: int
119 description: Max client worker.
120 max_log_quota:
121 aliases: ['max-log-quota']
122 type: int
123 description: Max log quota.
124 max_unrated_site:
125 aliases: ['max-unrated-site']
126 type: int
127 description: Max unrated site.
128 restrict_as1_dbver:
129 aliases: ['restrict-as1-dbver']
130 type: str
131 description: Restrict as1 dbver.
132 restrict_as2_dbver:
133 aliases: ['restrict-as2-dbver']
134 type: str
135 description: Restrict as2 dbver.
136 restrict_as4_dbver:
137 aliases: ['restrict-as4-dbver']
138 type: str
139 description: Restrict as4 dbver.
140 restrict_av_dbver:
141 aliases: ['restrict-av-dbver']
142 type: str
143 description: Restrict av dbver.
144 restrict_av2_dbver:
145 aliases: ['restrict-av2-dbver']
146 type: str
147 description: Restrict av2 dbver.
148 restrict_fq_dbver:
149 aliases: ['restrict-fq-dbver']
150 type: str
151 description: Restrict fq dbver.
152 restrict_iots_dbver:
153 aliases: ['restrict-iots-dbver']
154 type: str
155 description: Restrict iots dbver.
156 restrict_wf_dbver:
157 aliases: ['restrict-wf-dbver']
158 type: str
159 description: Restrict wf dbver.
160 server_override:
161 aliases: ['server-override']
162 type: dict
163 description: Server override.
164 suboptions:
165 servlist:
166 type: list
167 elements: dict
168 description: Servlist.
169 suboptions:
170 id:
171 type: int
172 description: Id.
173 ip:
174 type: str
175 description: Ip.
176 ip6:
177 type: str
178 description: Ip6.
179 port:
180 type: int
181 description: Port.
182 service_type:
183 aliases: ['service-type']
184 type: str
185 description: Service type.
186 choices: ['fgd', 'fsa', 'fgfq', 'geoip', 'iot-collect']
187 status:
188 type: str
189 description: Status.
190 choices: ['disable', 'enable']
191 stat_log:
192 aliases: ['stat-log']
193 type: str
194 description: Stat log.
195 choices: ['emergency', 'alert', 'critical', 'error', 'warn', 'notice', 'info',
196 'debug', 'disable']
197 stat_log_interval:
198 aliases: ['stat-log-interval']
199 type: int
200 description: Stat log interval.
201 stat_sync_interval:
202 aliases: ['stat-sync-interval']
203 type: int
204 description: Stat sync interval.
205 update_interval:
206 aliases: ['update-interval']
207 type: int
208 description: Update interval.
209 update_log:
210 aliases: ['update-log']
211 type: str
212 description: Update log.
213 choices: ['disable', 'enable']
214 wf_cache:
215 aliases: ['wf-cache']
216 type: int
217 description: Wf cache.
218 wf_dn_cache_expire_time:
219 aliases: ['wf-dn-cache-expire-time']
220 type: int
221 description: Wf dn cache expire time.
222 wf_dn_cache_max_number:
223 aliases: ['wf-dn-cache-max-number']
224 type: int
225 description: Wf dn cache max number.
226 wf_log:
227 aliases: ['wf-log']
228 type: str
229 description: Wf log.
230 choices: ['disable', 'nourl', 'all']
231 wf_preload:
232 aliases: ['wf-preload']
233 type: str
234 description: Wf preload.
235 choices: ['disable', 'enable']
236 '''
237
238 EXAMPLES = '''
239 - name: Example playbook (generated based on argument schema)
240 hosts: fortimanagers
241 connection: httpapi
242 gather_facts: false
243 tasks:
244 - name: Cli fmupdate fgd setting
245 fortinet.fortimanager.fmgr_fmupdate_fgdsetting:
246 # workspace_locking_adom: <global or your adom name>
247 fmupdate_fgdsetting:
248 # as_cache: <integer>
249 # as_log: <value in [disable, nospam, all]>
250 # as_preload: <value in [disable, enable]>
251 # av_cache: <integer>
252 # av_log: <value in [disable, novirus, all]>
253 # av_preload: <value in [disable, enable]>
254 # av2_cache: <integer>
255 # av2_log: <value in [disable, noav2, all]>
256 # av2_preload: <value in [disable, enable]>
257 # eventlog_query: <value in [disable, enable]>
258 # fgd_pull_interval: <integer>
259 # fq_cache: <integer>
260 # fq_log: <value in [disable, nofilequery, all]>
261 # fq_preload: <value in [disable, enable]>
262 # iot_cache: <integer>
263 # iot_log: <value in [disable, noiot, all]>
264 # iot_preload: <value in [disable, enable]>
265 # iotv_preload: <value in [disable, enable]>
266 # linkd_log: <value in [emergency, alert, critical, ...]>
267 # max_client_worker: <integer>
268 # max_log_quota: <integer>
269 # max_unrated_site: <integer>
270 # restrict_as1_dbver: <string>
271 # restrict_as2_dbver: <string>
272 # restrict_as4_dbver: <string>
273 # restrict_av_dbver: <string>
274 # restrict_av2_dbver: <string>
275 # restrict_fq_dbver: <string>
276 # restrict_iots_dbver: <string>
277 # restrict_wf_dbver: <string>
278 # server_override:
279 # servlist:
280 # - id: <integer>
281 # ip: <string>
282 # ip6: <string>
283 # port: <integer>
284 # service_type: <value in [fgd, fsa, fgfq, ...]>
285 # status: <value in [disable, enable]>
286 # stat_log: <value in [emergency, alert, critical, ...]>
287 # stat_log_interval: <integer>
288 # stat_sync_interval: <integer>
289 # update_interval: <integer>
290 # update_log: <value in [disable, enable]>
291 # wf_cache: <integer>
292 # wf_dn_cache_expire_time: <integer>
293 # wf_dn_cache_max_number: <integer>
294 # wf_log: <value in [disable, nourl, all]>
295 # wf_preload: <value in [disable, enable]>
296 '''
297
298 RETURN = '''
299 meta:
300 description: The result of the request.
301 type: dict
302 returned: always
303 contains:
304 request_url:
305 description: The full url requested.
306 returned: always
307 type: str
308 sample: /sys/login/user
309 response_code:
310 description: The status of api request.
311 returned: always
312 type: int
313 sample: 0
314 response_data:
315 description: The api response.
316 type: list
317 returned: always
318 response_message:
319 description: The descriptive message of the api response.
320 type: str
321 returned: always
322 sample: OK.
323 system_information:
324 description: The information of the target system.
325 type: dict
326 returned: always
327 rc:
328 description: The status the request.
329 type: int
330 returned: always
331 sample: 0
332 version_check_warning:
333 description: Warning if the parameters used in the playbook are not supported by the current FortiManager version.
334 type: list
335 returned: complex
336 '''
337 from ansible.module_utils.basic import AnsibleModule
338 from ansible.module_utils.connection import Connection
339 from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass
340 from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec
341
342
343 def main():
344 urls_list = [
345 '/cli/global/fmupdate/fgd-setting'
346 ]
347 module_arg_spec = {
348 'fmupdate_fgdsetting': {
349 'type': 'dict', 'v_range': [['7.6.3', '']],
350 'options': {
351 'as-cache': {'v_range': [['7.6.3', '']], 'type': 'int'},
352 'as-log': {'v_range': [['7.6.3', '']], 'choices': ['disable', 'nospam', 'all'], 'type': 'str'},
353 'as-preload': {'v_range': [['7.6.3', '']], 'choices': ['disable', 'enable'], 'type': 'str'},
354 'av-cache': {'v_range': [['7.6.3', '']], 'type': 'int'},
355 'av-log': {'v_range': [['7.6.3', '']], 'choices': ['disable', 'novirus', 'all'], 'type': 'str'},
356 'av-preload': {'v_range': [['7.6.3', '']], 'choices': ['disable', 'enable'], 'type': 'str'},
357 'av2-cache': {'v_range': [['7.6.3', '']], 'type': 'int'},
358 'av2-log': {'v_range': [['7.6.3', '']], 'choices': ['disable', 'noav2', 'all'], 'type': 'str'},
359 'av2-preload': {'v_range': [['7.6.3', '']], 'choices': ['disable', 'enable'], 'type': 'str'},
360 'eventlog-query': {'v_range': [['7.6.3', '']], 'choices': ['disable', 'enable'], 'type': 'str'},
361 'fgd-pull-interval': {'v_range': [['7.6.3', '']], 'type': 'int'},
362 'fq-cache': {'v_range': [['7.6.3', '']], 'type': 'int'},
363 'fq-log': {'v_range': [['7.6.3', '']], 'choices': ['disable', 'nofilequery', 'all'], 'type': 'str'},
364 'fq-preload': {'v_range': [['7.6.3', '']], 'choices': ['disable', 'enable'], 'type': 'str'},
365 'iot-cache': {'v_range': [['7.6.3', '']], 'type': 'int'},
366 'iot-log': {'v_range': [['7.6.3', '']], 'choices': ['disable', 'noiot', 'all'], 'type': 'str'},
367 'iot-preload': {'v_range': [['7.6.3', '']], 'choices': ['disable', 'enable'], 'type': 'str'},
368 'iotv-preload': {'v_range': [['7.6.3', '']], 'choices': ['disable', 'enable'], 'type': 'str'},
369 'linkd-log': {
370 'v_range': [['7.6.3', '']],
371 'choices': ['emergency', 'alert', 'critical', 'error', 'warn', 'notice', 'info', 'debug', 'disable'],
372 'type': 'str'
373 },
374 'max-client-worker': {'v_range': [['7.6.3', '']], 'type': 'int'},
375 'max-log-quota': {'v_range': [['7.6.3', '']], 'type': 'int'},
376 'max-unrated-site': {'v_range': [['7.6.3', '']], 'type': 'int'},
377 'restrict-as1-dbver': {'v_range': [['7.6.3', '']], 'type': 'str'},
378 'restrict-as2-dbver': {'v_range': [['7.6.3', '']], 'type': 'str'},
379 'restrict-as4-dbver': {'v_range': [['7.6.3', '']], 'type': 'str'},
380 'restrict-av-dbver': {'v_range': [['7.6.3', '']], 'type': 'str'},
381 'restrict-av2-dbver': {'v_range': [['7.6.3', '']], 'type': 'str'},
382 'restrict-fq-dbver': {'v_range': [['7.6.3', '']], 'type': 'str'},
383 'restrict-iots-dbver': {'v_range': [['7.6.3', '']], 'type': 'str'},
384 'restrict-wf-dbver': {'v_range': [['7.6.3', '']], 'type': 'str'},
385 'server-override': {
386 'v_range': [['7.6.3', '']],
387 'type': 'dict',
388 'options': {
389 'servlist': {
390 'v_range': [['7.6.3', '']],
391 'type': 'list',
392 'options': {
393 'id': {'v_range': [['7.6.3', '']], 'type': 'int'},
394 'ip': {'v_range': [['7.6.3', '']], 'type': 'str'},
395 'ip6': {'v_range': [['7.6.3', '']], 'type': 'str'},
396 'port': {'v_range': [['7.6.3', '']], 'type': 'int'},
397 'service-type': {'v_range': [['7.6.3', '']], 'choices': ['fgd', 'fsa', 'fgfq', 'geoip', 'iot-collect'], 'type': 'str'}
398 },
399 'elements': 'dict'
400 },
401 'status': {'v_range': [['7.6.3', '']], 'choices': ['disable', 'enable'], 'type': 'str'}
402 }
403 },
404 'stat-log': {
405 'v_range': [['7.6.3', '']],
406 'choices': ['emergency', 'alert', 'critical', 'error', 'warn', 'notice', 'info', 'debug', 'disable'],
407 'type': 'str'
408 },
409 'stat-log-interval': {'v_range': [['7.6.3', '']], 'type': 'int'},
410 'stat-sync-interval': {'v_range': [['7.6.3', '']], 'type': 'int'},
411 'update-interval': {'v_range': [['7.6.3', '']], 'type': 'int'},
412 'update-log': {'v_range': [['7.6.3', '']], 'choices': ['disable', 'enable'], 'type': 'str'},
413 'wf-cache': {'v_range': [['7.6.3', '']], 'type': 'int'},
414 'wf-dn-cache-expire-time': {'v_range': [['7.6.3', '']], 'type': 'int'},
415 'wf-dn-cache-max-number': {'v_range': [['7.6.3', '']], 'type': 'int'},
416 'wf-log': {'v_range': [['7.6.3', '']], 'choices': ['disable', 'nourl', 'all'], 'type': 'str'},
417 'wf-preload': {'v_range': [['7.6.3', '']], 'choices': ['disable', 'enable'], 'type': 'str'}
418 }
419 }
420 }
421
422 module_option_spec = get_module_arg_spec('partial crud')
423 module_arg_spec.update(module_option_spec)
424 check_galaxy_version(module_arg_spec)
425 module = AnsibleModule(argument_spec=check_parameter_bypass(module_arg_spec, 'fmupdate_fgdsetting'),
426 supports_check_mode=True)
427 if not module._socket_path:
428 module.fail_json(msg='MUST RUN IN HTTPAPI MODE')
429 connection = Connection(module._socket_path)
430 fmgr = NAPIManager('partial crud', module_arg_spec, urls_list,
431 None, 'data', module, connection)
432 fmgr.process_partial_crud()
433 module.exit_json(meta=module.params)
434
435
436 if __name__ == '__main__':
437 main()