Debian Codegraph @

ansible_collections/fortinet/fortios/plugins/modules/fortios_monitor.py

raw symbols SCIP
1 #!/usr/bin/python
2 from __future__ import absolute_import, division, print_function
3
4 # Copyright 2020 Fortinet, Inc.
5 #
6 # This program 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 # This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
18 __metaclass__ = type
19
20 ANSIBLE_METADATA = {
21 "status": ["preview"],
22 "supported_by": "community",
23 "metadata_version": "1.1",
24 }
25 DOCUMENTATION = """
26 ---
27 module: fortios_monitor
28 version_added: "2.0.0"
29 short_description: Ansible Module for FortiOS Monitor API
30 description:
31 - Request FortiOS appliances to perform specific actions or procedures.
32 This module contain all the FortiOS monitor API.
33 author:
34 - Jie Xue (@JieX19)
35 - Link Zheng (@chillancezen)
36 - Hongbin Lu (@fgtdev-hblu)
37 - Frank Shen (@fshen01)
38 notes:
39 - Different selector may have different parameters, users are expected to look up them for a specific selector.
40 - For some selectors, the objects are global, no params are allowed to appear.
41 - Not all parameters are required for a selector.
42 - This module is exclusivly for FortiOS monitor API.
43 - The result of API request is stored in results.
44 requirements:
45 - install galaxy collection fortinet.fortios >= 2.0.0.
46 options:
47 access_token:
48 description:
49 - Token-based authentication.
50 Generated from GUI of Fortigate.
51 type: str
52 required: false
53 enable_log:
54 description:
55 - Enable/Disable logging for task.
56 type: bool
57 required: false
58 default: false
59 vdom:
60 description:
61 - Virtual domain, among those defined previously. A vdom is a
62 virtual instance of the FortiGate that can be configured and
63 used as a different unit.
64 type: str
65 default: root
66 required: false
67 selector:
68 description:
69 - selector of the retrieved fortimanager facts
70 type: str
71 required: true
72 choices:
73 - 'check.endpoint-control.registration-password'
74 - 'quarantine.endpoint-control.registration'
75 - 'unquarantine.endpoint-control.registration'
76 - 'block.endpoint-control.registration'
77 - 'unblock.endpoint-control.registration'
78 - 'deregister.endpoint-control.registration'
79 - 'clear_counters.firewall.acl'
80 - 'clear_counters.firewall.acl6'
81 - 'reset.firewall.policy'
82 - 'clear_counters.firewall.policy'
83 - 'reset.firewall.policy6'
84 - 'clear_counters.firewall.policy6'
85 - 'clear_counters.firewall.proxy-policy'
86 - 'clear_all.firewall.session'
87 - 'close.firewall.session'
88 - 'reset.firewall.shaper'
89 - 'reset.firewall.per-ip-shaper'
90 - 'cancel.fortiview.session'
91 - 'upgrade.license.database'
92 - 'reset.log.stats'
93 - 'login.registration.forticloud'
94 - 'create.registration.forticloud'
95 - 'logout.registration.forticloud'
96 - 'login.registration.forticare'
97 - 'create.registration.forticare'
98 - 'add-license.registration.forticare'
99 - 'add-license.registration.vdom'
100 - 'toggle-vdom-mode.system.admin'
101 - 'generate-key.system.api-user'
102 - 'update-comments.system.config-revision'
103 - 'delete.system.config-revision'
104 - 'save.system.config-revision'
105 - 'system.disconnect-admins'
106 - 'set.system.time'
107 - 'reboot.system.os'
108 - 'shutdown.system.os'
109 - 'revoke.system.dhcp'
110 - 'revoke.system.dhcp6'
111 - 'upgrade.system.firmware'
112 - 'start.system.fsck'
113 - 'system.change-password'
114 - 'system.password-policy-conform'
115 - 'reset.system.modem'
116 - 'connect.system.modem'
117 - 'disconnect.system.modem'
118 - 'update.system.modem'
119 - 'restart.system.sniffer'
120 - 'start.system.sniffer'
121 - 'stop.system.sniffer'
122 - 'test.system.automation-stitch'
123 - 'update.switch-controller.managed-switch'
124 - 'restart.switch-controller.managed-switch'
125 - 'poe-reset.switch-controller.managed-switch'
126 - 'factory-reset.switch-controller.managed-switch'
127 - 'download.switch-controller.fsw-firmware'
128 - 'push.switch-controller.fsw-firmware'
129 - 'upload.switch-controller.fsw-firmware'
130 - 'dhcp-renew.system.interface'
131 - 'start.system.usb-log'
132 - 'stop.system.usb-log'
133 - 'eject.system.usb-device'
134 - 'update.system.fortiguard'
135 - 'clear-statistics.system.fortiguard'
136 - 'test-availability.system.fortiguard'
137 - 'config.system.fortimanager'
138 - 'backup-action.system.fortimanager'
139 - 'dump.system.com-log'
140 - 'update.system.ha-peer'
141 - 'disconnect.system.ha-peer'
142 - 'run.system.compliance'
143 - 'restore.system.config'
144 - 'upload.system.vmlicense'
145 - 'trigger.system.security-rating'
146 - 'reset.extender-controller.extender'
147 - 'validate-gcp-key.system.sdn-connector'
148 - 'deauth.user.firewall'
149 - 'clear_users.user.banned'
150 - 'add_users.user.banned'
151 - 'clear_all.user.banned'
152 - 'activate.user.fortitoken'
153 - 'refresh.user.fortitoken'
154 - 'provision.user.fortitoken'
155 - 'send-activation.user.fortitoken'
156 - 'import-trial.user.fortitoken'
157 - 'import-mobile.user.fortitoken'
158 - 'import-seed.user.fortitoken'
159 - 'refresh-server.user.fsso'
160 - 'test-connect.user.radius'
161 - 'test.user.tacacs-plus'
162 - 'delete.webfilter.override'
163 - 'reset.webfilter.category-quota'
164 - 'tunnel_up.vpn.ipsec'
165 - 'tunnel_down.vpn.ipsec'
166 - 'tunnel_reset_stats.vpn.ipsec'
167 - 'clear_tunnel.vpn.ssl'
168 - 'delete.vpn.ssl'
169 - 'import.vpn-certificate.ca'
170 - 'import.vpn-certificate.crl'
171 - 'import.vpn-certificate.local'
172 - 'import.vpn-certificate.remote'
173 - 'generate.vpn-certificate.csr'
174 - 'reset.wanopt.history'
175 - 'reset.wanopt.webcache'
176 - 'reset.wanopt.peer_stats'
177 - 'reset.webcache.stats'
178 - 'set_status.wifi.managed_ap'
179 - 'download.wifi.firmware'
180 - 'push.wifi.firmware'
181 - 'upload.wifi.firmware'
182 - 'restart.wifi.managed_ap'
183 - 'reset.wifi.euclid'
184 - 'clear_all.wifi.rogue_ap'
185 - 'set_status.wifi.rogue_ap'
186 - 'reset.firewall.consolidated-policy'
187 - 'clear_counters.firewall.consolidated-policy'
188 - 'clear_counters.firewall.security-policy'
189 - 'add.firewall.clearpass-address'
190 - 'delete.firewall.clearpass-address'
191 - 'delete.log.local-report'
192 - 'migrate.registration.forticloud'
193 - 'change-vdom-mode.system.admin'
194 - 'delete.system.config-script'
195 - 'run.system.config-script'
196 - 'upload.system.config-script'
197 - 'diagnose.extender-controller.extender'
198 - 'upgrade.extender-controller.extender'
199 - 'add.nsx.service'
200 - 'update.system.sdn-connector'
201 - 'import.web-ui.language'
202 - 'create.web-ui.custom-language'
203 - 'update.web-ui.custom-language'
204 - 'email.user.guest'
205 - 'sms.user.guest'
206 - 'utm.rating-lookup'
207 - 'connect.wifi.network'
208 - 'scan.wifi.network'
209 - 'upload.wifi.region-image'
210 - 'refresh.azure.application-list'
211 - 'verify-cert.endpoint-control.ems'
212 - 'geoip.geoip-query'
213 - 'transfer.registration.forticare'
214 - 'register-device.registration.forticloud'
215 - 'register-appliance.system.csf'
216 - 'clear.system.sniffer'
217 - 'webhook.system.automation-stitch'
218 - 'format.system.logdisk'
219 - 'speed-test-trigger.system.interface'
220 - 'read-info.system.certificate'
221 - 'provision-user.vpn.ssl'
222 - 'upload.webproxy.pacfile'
223 - 'disassociate.wifi.client'
224 - 'start.wifi.spectrum'
225 - 'keep-alive.wifi.spectrum'
226 - 'stop.wifi.spectrum'
227 - 'start.wifi.vlan-probe'
228 - 'stop.wifi.vlan-probe'
229 - 'generate-keys.wifi.ssid'
230 - 'save.system.config'
231 - 'led-blink.wifi.managed_ap'
232 - 'auth.user.firewall'
233 - 'remove.user.device'
234 - 'clear.vpn.ike'
235 - 'reset.firewall.multicast-policy'
236 - 'reset.firewall.multicast-policy6'
237 - 'clear_counters.firewall.multicast-policy'
238 - 'clear_counters.firewall.multicast-policy6'
239 - 'clear-soft-in.router.bgp'
240 - 'clear-soft-out.router.bgp'
241 - 'enable-app-bandwidth-tracking.system.traffic-history'
242 - 'refresh.system.external-resource'
243 - 'reset.firewall.central-snat-map'
244 - 'clear-counters.firewall.central-snat-map'
245 - 'reset.firewall.dnat'
246 - 'clear-counters.firewall.dnat'
247 - 'close-multiple.firewall.session'
248 - 'close-multiple.firewall.session6'
249 - 'close-all.firewall.session'
250 - 'clear.system.crash-log'
251 - 'backup.system.config'
252 - 'abort.user.query'
253 - 'create.vpn-certificate.local'
254 - 'flush.firewall.gtp'
255 - 'kill.system.process'
256 - 'upload.system.hscalefw-license'
257 - 'download.system.vmlicense'
258 - 'start.network.debug-flow'
259 - 'stop.network.debug-flow'
260 - 'upload.system.lte-modem'
261 - 'upgrade.system.lte-modem'
262 - 'port-stats-reset.switch-controller.managed-switch'
263 - 'bounce-port.switch-controller.managed-switch'
264 - 'set-tier1.switch-controller.mclag-icl'
265 - 'wake-on-lan.system.interface'
266 - 'manual-update.system.fortiguard'
267 - 'purdue-level.user.device'
268 - 'deregister-device.registration.forticare'
269 - 'soft-reset-neighbor.router.bgp'
270 - 'download-eval.system.vmlicense'
271 - 'dynamic.system.external-resource'
272 - 'pse-config.switch-controller.recommendation'
273 - 'update.switch-controller.isl-lockdown'
274 - 'clear-counters.firewall.ztna-firewall-policy'
275 - 'update.forticonverter.eligibility'
276 - 'create.forticonverter.ticket'
277 - 'update.forticonverter.sn-list'
278 - 'upload.forticonverter.config'
279 - 'update.forticonverter.intf-list'
280 - 'forticonverter.set-source-sn'
281 - 'submit.forticonverter.intf-mapping'
282 - 'submit.forticonverter.mgmt-intf'
283 - 'submit.forticonverter.notes'
284 - 'submit.forticonverter.ticket'
285 - 'update.forticonverter.submitted-info'
286 - 'start.forticonverter.download'
287 - 'trial.user.fortitoken-cloud'
288 - 'unverify-cert.endpoint-control.ems'
289 - 'update-global-label.firewall.policy'
290 - 'update-global-label.firewall.security-policy'
291 - 'set-tier-plus.switch-controller.mclag-icl'
292 - 'user.password-policy-conform'
293 - 'change-password.user.local'
294 - 'report.sdwan.link-monitor-metrics'
295 - 'generic-address.system.external-resource'
296 - 'set.system.private-data-encryption'
297 - 'create-default.wifi.ap-profile'
298
299 params:
300 description:
301 - the parameter for each selector, see definition in above list.
302 type: dict
303 required: false
304 """
305
306 EXAMPLES = """
307 - name: Activate FortiToken
308 fortinet.fortios.fortios_monitor:
309 vdom: "root"
310 access_token: "your_own_value"
311 selector: 'activate.user.fortitoken'
312 params:
313 tokens: '<token string>'
314
315 - name: Reboot This Device
316 fortinet.fortios.fortios_monitor:
317 vdom: "root"
318 access_token: "you_own_value"
319 selector: 'reboot.system.os'
320 params:
321 event_log_message: 'Reboot Request From Ansible'
322 """
323
324 RETURN = """
325 build:
326 description: Build number of the fortigate image
327 returned: always
328 type: str
329 sample: '1547'
330 http_method:
331 description: Last method used to provision the content into FortiGate
332 returned: always
333 type: str
334 sample: 'GET'
335 name:
336 description: Name of the table used to fulfill the request
337 returned: always
338 type: str
339 sample: "firmware"
340 path:
341 description: Path of the table used to fulfill the request
342 returned: always
343 type: str
344 sample: "system"
345 revision:
346 description: Internal revision number
347 returned: always
348 type: str
349 sample: "17.0.2.10658"
350 serial:
351 description: Serial number of the unit
352 returned: always
353 type: str
354 sample: "FGVMEVYYQT3AB5352"
355 status:
356 description: Indication of the operation's result
357 returned: always
358 type: str
359 sample: "success"
360 vdom:
361 description: Virtual domain used
362 returned: always
363 type: str
364 sample: "root"
365 version:
366 description: Version of the FortiGate
367 returned: always
368 type: str
369 sample: "v5.6.3"
370 ansible_facts:
371 description: The list of fact subsets collected from the device
372 returned: always
373 type: dict
374
375 """
376
377 from ansible.module_utils.basic import AnsibleModule
378 from ansible.module_utils.connection import Connection
379 from ansible_collections.fortinet.fortios.plugins.module_utils.fortios.fortios import (
380 FortiOSHandler,
381 )
382 from ansible_collections.fortinet.fortios.plugins.module_utils.fortios.fortios import (
383 check_legacy_fortiosapi,
384 )
385 from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.common import (
386 FAIL_SOCKET_MSG,
387 )
388
389 module_selectors_defs = {
390 "check.endpoint-control.registration-password": {
391 "url": "endpoint-control/registration-password/check",
392 "params": {"password": {"type": "string", "required": "True"}},
393 },
394 "quarantine.endpoint-control.registration": {
395 "url": "endpoint-control/registration/quarantine",
396 "params": {
397 "uid": {"type": "string", "required": "False"},
398 "mac": {"type": "string", "required": "False"},
399 },
400 },
401 "unquarantine.endpoint-control.registration": {
402 "url": "endpoint-control/registration/unquarantine",
403 "params": {
404 "uid": {"type": "string", "required": "False"},
405 "mac": {"type": "string", "required": "False"},
406 },
407 },
408 "block.endpoint-control.registration": {
409 "url": "endpoint-control/registration/block",
410 "params": {
411 "uid": {"type": "string", "required": "False"},
412 "mac": {"type": "string", "required": "False"},
413 },
414 },
415 "unblock.endpoint-control.registration": {
416 "url": "endpoint-control/registration/unblock",
417 "params": {
418 "uid": {"type": "string", "required": "False"},
419 "mac": {"type": "string", "required": "False"},
420 },
421 },
422 "deregister.endpoint-control.registration": {
423 "url": "endpoint-control/registration/deregister",
424 "params": {
425 "uid": {"type": "string", "required": "False"},
426 "mac": {"type": "string", "required": "False"},
427 },
428 },
429 "clear_counters.firewall.acl": {
430 "url": "firewall/acl/clear_counters",
431 "params": {"policy": {"type": "int", "required": "False"}},
432 },
433 "clear_counters.firewall.acl6": {
434 "url": "firewall/acl6/clear_counters",
435 "params": {"policy": {"type": "int", "required": "False"}},
436 },
437 "reset.firewall.policy": {"url": "firewall/policy/reset", "params": {}},
438 "clear_counters.firewall.policy": {
439 "url": "firewall/policy/clear_counters",
440 "params": {"policy": {"type": "int", "required": "False"}},
441 },
442 "reset.firewall.policy6": {"url": "firewall/policy6/reset", "params": {}},
443 "clear_counters.firewall.policy6": {
444 "url": "firewall/policy6/clear_counters",
445 "params": {"policy": {"type": "int", "required": "False"}},
446 },
447 "clear_counters.firewall.proxy-policy": {
448 "url": "firewall/proxy-policy/clear_counters",
449 "params": {"policy": {"type": "int", "required": "False"}},
450 },
451 "clear_all.firewall.session": {"url": "firewall/session/clear_all", "params": {}},
452 "close.firewall.session": {
453 "url": "firewall/session/close",
454 "params": {
455 "pro": {"type": "string", "required": "True"},
456 "saddr": {"type": "string", "required": "True"},
457 "daddr": {"type": "string", "required": "True"},
458 "sport": {"type": "int", "required": "True"},
459 "dport": {"type": "int", "required": "True"},
460 },
461 },
462 "reset.firewall.shaper": {"url": "firewall/shaper/reset", "params": {}},
463 "reset.firewall.per-ip-shaper": {
464 "url": "firewall/per-ip-shaper/reset",
465 "params": {},
466 },
467 "cancel.fortiview.session": {
468 "url": "fortiview/session/cancel",
469 "params": {
470 "sessionid": {"type": "int", "required": "False"},
471 "device": {"type": "string", "required": "False"},
472 "report_by": {"type": "string", "required": "False"},
473 "view_level": {"type": "string", "required": "False"},
474 },
475 },
476 "upgrade.license.database": {
477 "url": "license/database/upgrade",
478 "params": {
479 "db_name": {"type": "string", "required": "True"},
480 "confirm_not_signed": {"type": "boolean", "required": "False"},
481 "confirm_not_ga_certified": {"type": "boolean", "required": "False"},
482 "file_id": {"type": "string", "required": "False"},
483 "file_content": {"type": "string", "required": "False"},
484 },
485 },
486 "reset.log.stats": {"url": "log/stats/reset", "params": {}},
487 "login.registration.forticloud": {
488 "url": "registration/forticloud/login",
489 "params": {
490 "email": {"type": "string", "required": "True"},
491 "password": {"type": "string", "required": "True"},
492 "send_logs": {"type": "boolean", "required": "False"},
493 "domain": {"type": "string", "required": "False"},
494 },
495 },
496 "create.registration.forticloud": {
497 "url": "registration/forticloud/create",
498 "params": {
499 "email": {"type": "string", "required": "True"},
500 "password": {"type": "string", "required": "True"},
501 "send_logs": {"type": "boolean", "required": "False"},
502 },
503 },
504 "logout.registration.forticloud": {
505 "url": "registration/forticloud/logout",
506 "params": {},
507 },
508 "login.registration.forticare": {
509 "url": "registration/forticare/login",
510 "params": {
511 "serial": {"type": "string", "required": "False"},
512 "email": {"type": "string", "required": "True"},
513 "password": {"type": "string", "required": "True"},
514 "reseller_name": {"type": "string", "required": "True"},
515 "reseller_id": {"type": "int", "required": "True"},
516 "agreement_accepted": {"type": "boolean", "required": "False"},
517 "is_government": {"type": "boolean", "required": "False"},
518 },
519 },
520 "create.registration.forticare": {
521 "url": "registration/forticare/create",
522 "params": {
523 "email": {"type": "string", "required": "True"},
524 "password": {"type": "string", "required": "True"},
525 "first_name": {"type": "string", "required": "True"},
526 "last_name": {"type": "string", "required": "True"},
527 "title": {"type": "string", "required": "False"},
528 "company": {"type": "string", "required": "True"},
529 "address": {"type": "string", "required": "True"},
530 "city": {"type": "string", "required": "True"},
531 "country_code": {"type": "int", "required": "True"},
532 "state": {"type": "string", "required": "True"},
533 "state_code": {"type": "string", "required": "False"},
534 "postal_code": {"type": "string", "required": "True"},
535 "phone": {"type": "string", "required": "True"},
536 "industry": {"type": "string", "required": "True"},
537 "industry_id": {"type": "int", "required": "True"},
538 "orgsize_id": {"type": "int", "required": "True"},
539 "reseller_name": {"type": "string", "required": "True"},
540 "reseller_id": {"type": "int", "required": "True"},
541 "is_government": {"type": "boolean", "required": "False"},
542 },
543 },
544 "add-license.registration.forticare": {
545 "url": "registration/forticare/add-license",
546 "params": {"registration_code": {"type": "string", "required": "True"}},
547 },
548 "add-license.registration.vdom": {
549 "url": "registration/vdom/add-license",
550 "params": {"license": {"type": "string", "required": "True"}},
551 },
552 "toggle-vdom-mode.system.admin": {
553 "url": "system/admin/toggle-vdom-mode",
554 "params": {},
555 },
556 "generate-key.system.api-user": {
557 "url": "system/api-user/generate-key",
558 "params": {
559 "api-user": {"type": "string", "required": "True"},
560 "expiry": {"type": "int", "required": "False"},
561 },
562 },
563 "update-comments.system.config-revision": {
564 "url": "system/config-revision/update-comments",
565 "params": {
566 "config_id": {"type": "int", "required": "False"},
567 "comments": {"type": "string", "required": "False"},
568 },
569 },
570 "delete.system.config-revision": {
571 "url": "system/config-revision/delete",
572 "params": {"config_ids": {"type": "array", "required": "True"}},
573 },
574 "save.system.config-revision": {
575 "url": "system/config-revision/save",
576 "params": {"comments": {"type": "string", "required": "False"}},
577 },
578 "system.disconnect-admins": {
579 "url": "system/disconnect-admins/select",
580 "params": {
581 "id": {"type": "int", "required": "False"},
582 "method": {"type": "string", "required": "False"},
583 "admins": {"type": "array", "required": "True"},
584 },
585 },
586 "set.system.time": {
587 "url": "system/time/set",
588 "params": {
589 "year": {"type": "int", "required": "True"},
590 "month": {"type": "int", "required": "True"},
591 "day": {"type": "int", "required": "True"},
592 "hour": {"type": "int", "required": "True"},
593 "minute": {"type": "int", "required": "True"},
594 "second": {"type": "int", "required": "True"},
595 },
596 },
597 "reboot.system.os": {
598 "url": "system/os/reboot",
599 "params": {"event_log_message": {"type": "string", "required": "False"}},
600 },
601 "shutdown.system.os": {
602 "url": "system/os/shutdown",
603 "params": {"event_log_message": {"type": "string", "required": "False"}},
604 },
605 "revoke.system.dhcp": {
606 "url": "system/dhcp/revoke",
607 "params": {"ip": {"type": "array", "required": "False"}},
608 },
609 "revoke.system.dhcp6": {
610 "url": "system/dhcp6/revoke",
611 "params": {"ip": {"type": "array", "required": "False"}},
612 },
613 "upgrade.system.firmware": {
614 "url": "system/firmware/upgrade",
615 "params": {
616 "source": {"type": "string", "required": "True"},
617 "url": {"type": "string", "required": "False"},
618 "passphrase": {"type": "string", "required": "False"},
619 "force": {"type": "boolean", "required": "False"},
620 "filename": {"type": "string", "required": "False"},
621 "format_partition": {"type": "boolean", "required": "False"},
622 "ignore_invalid_signature": {"type": "boolean", "required": "False"},
623 "file_id": {"type": "string", "required": "False"},
624 "ignore_admin_lockout_upon_downgrade": {
625 "type": "boolean",
626 "required": "False",
627 },
628 "file_content": {"type": "string", "required": "False"},
629 },
630 },
631 "start.system.fsck": {"url": "system/fsck/start", "params": {}},
632 "system.change-password": {
633 "url": "system/change-password/select",
634 "params": {
635 "mkey": {"type": "string", "required": "False"},
636 "old_password": {"type": "string", "required": "False"},
637 "new_password": {"type": "string", "required": "True"},
638 },
639 },
640 "system.password-policy-conform": {
641 "url": "system/password-policy-conform/select",
642 "params": {
643 "mkey": {"type": "string", "required": "False"},
644 "apply_to": {"type": "string", "required": "False"},
645 "password": {"type": "string", "required": "False"},
646 "old_password": {"type": "string", "required": "False"},
647 },
648 },
649 "reset.system.modem": {"url": "system/modem/reset", "params": {}},
650 "connect.system.modem": {"url": "system/modem/connect", "params": {}},
651 "disconnect.system.modem": {"url": "system/modem/disconnect", "params": {}},
652 "update.system.modem": {"url": "system/modem/update", "params": {}},
653 "restart.system.sniffer": {
654 "url": "system/sniffer/restart",
655 "params": {"mkey": {"type": "int", "required": "True"}},
656 },
657 "start.system.sniffer": {
658 "url": "system/sniffer/start",
659 "params": {"mkey": {"type": "int", "required": "True"}},
660 },
661 "stop.system.sniffer": {
662 "url": "system/sniffer/stop",
663 "params": {"mkey": {"type": "int", "required": "True"}},
664 },
665 "test.system.automation-stitch": {
666 "url": "system/automation-stitch/test",
667 "params": {
668 "mkey": {"type": "string", "required": "True"},
669 "log": {"type": "string", "required": "False"},
670 },
671 },
672 "update.switch-controller.managed-switch": {
673 "url": "switch-controller/managed-switch/update",
674 "params": {
675 "mkey": {"type": "string", "required": "False"},
676 "admin": {"type": "string", "required": "False"},
677 },
678 },
679 "restart.switch-controller.managed-switch": {
680 "url": "switch-controller/managed-switch/restart",
681 "params": {"mkey": {"type": "string", "required": "True"}},
682 },
683 "poe-reset.switch-controller.managed-switch": {
684 "url": "switch-controller/managed-switch/poe-reset",
685 "params": {
686 "mkey": {"type": "string", "required": "True"},
687 "port": {"type": "string", "required": "True"},
688 },
689 },
690 "factory-reset.switch-controller.managed-switch": {
691 "url": "switch-controller/managed-switch/factory-reset",
692 "params": {"mkey": {"type": "string", "required": "True"}},
693 },
694 "download.switch-controller.fsw-firmware": {
695 "url": "switch-controller/fsw-firmware/download",
696 "params": {"image_id": {"type": "string", "required": "True"}},
697 },
698 "push.switch-controller.fsw-firmware": {
699 "url": "switch-controller/fsw-firmware/push",
700 "params": {
701 "switch_id": {"type": "string", "required": "True"},
702 "image_id": {"type": "string", "required": "True"},
703 },
704 },
705 "upload.switch-controller.fsw-firmware": {
706 "url": "switch-controller/fsw-firmware/upload",
707 "params": {
708 "switch_ids": {"type": "string", "required": "False"},
709 "file_content": {"type": "string", "required": "False"},
710 },
711 },
712 "dhcp-renew.system.interface": {
713 "url": "system/interface/dhcp-renew",
714 "params": {
715 "mkey": {"type": "string", "required": "True"},
716 "ipv6": {"type": "boolean", "required": "False"},
717 },
718 },
719 "start.system.usb-log": {"url": "system/usb-log/start", "params": {}},
720 "stop.system.usb-log": {"url": "system/usb-log/stop", "params": {}},
721 "eject.system.usb-device": {"url": "system/usb-device/eject", "params": {}},
722 "update.system.fortiguard": {"url": "system/fortiguard/update", "params": {}},
723 "clear-statistics.system.fortiguard": {
724 "url": "system/fortiguard/clear-statistics",
725 "params": {},
726 },
727 "test-availability.system.fortiguard": {
728 "url": "system/fortiguard/test-availability",
729 "params": {
730 "protocol": {"type": "string", "required": "True"},
731 "port": {"type": "int", "required": "True"},
732 "service": {"type": "string", "required": "True"},
733 },
734 },
735 "config.system.fortimanager": {
736 "url": "system/fortimanager/config",
737 "params": {
738 "fortimanager_ip": {"type": "string", "required": "False"},
739 "unregister": {"type": "boolean", "required": "False"},
740 },
741 },
742 "backup-action.system.fortimanager": {
743 "url": "system/fortimanager/backup-action",
744 "params": {
745 "operation": {"type": "string", "required": "True"},
746 "objects": {"type": "array", "required": "True"},
747 },
748 },
749 "dump.system.com-log": {"url": "system/com-log/dump", "params": {}},
750 "update.system.ha-peer": {
751 "url": "system/ha-peer/update",
752 "params": {
753 "serial_no": {"type": "string", "required": "True"},
754 "vcluster_id": {"type": "int", "required": "False"},
755 "priority": {"type": "int", "required": "False"},
756 "hostname": {"type": "string", "required": "False"},
757 },
758 },
759 "disconnect.system.ha-peer": {
760 "url": "system/ha-peer/disconnect",
761 "params": {
762 "serial_no": {"type": "string", "required": "True"},
763 "interface": {"type": "string", "required": "True"},
764 "ip": {"type": "string", "required": "True"},
765 "mask": {"type": "string", "required": "True"},
766 },
767 },
768 "run.system.compliance": {"url": "system/compliance/run", "params": {}},
769 "restore.system.config": {
770 "url": "system/config/restore",
771 "params": {
772 "source": {"type": "string", "required": "True"},
773 "usb_filename": {"type": "string", "required": "False"},
774 "config_id": {"type": "int", "required": "False"},
775 "password": {"type": "string", "required": "False"},
776 "scope": {"type": "string", "required": "True"},
777 "vdom": {"type": "string", "required": "False"},
778 "confirm_password_mask": {"type": "boolean", "required": "False"},
779 "file_content": {"type": "string", "required": "False"},
780 },
781 },
782 "upload.system.vmlicense": {
783 "url": "system/vmlicense/upload",
784 "params": {"file_content": {"type": "string", "required": "False"}},
785 },
786 "trigger.system.security-rating": {
787 "url": "system/security-rating/trigger",
788 "params": {
789 "report_type": {"type": "string", "required": "False"},
790 "report_types": {"type": "array", "required": "False"},
791 },
792 },
793 "reset.extender-controller.extender": {
794 "url": "extender-controller/extender/reset",
795 "params": {"id": {"type": "string", "required": "True"}},
796 },
797 "validate-gcp-key.system.sdn-connector": {
798 "url": "system/sdn-connector/validate-gcp-key",
799 "params": {"private-key": {"type": "string", "required": "True"}},
800 },
801 "deauth.user.firewall": {
802 "url": "user/firewall/deauth",
803 "params": {
804 "user_type": {"type": "string", "required": "False"},
805 "id": {"type": "int", "required": "False"},
806 "ip": {"type": "string", "required": "False"},
807 "ip_version": {"type": "string", "required": "False"},
808 "method": {"type": "string", "required": "False"},
809 "all": {"type": "boolean", "required": "False"},
810 "users": {"type": "array", "required": "False"},
811 },
812 },
813 "clear_users.user.banned": {
814 "url": "user/banned/clear_users",
815 "params": {"ip_addresses": {"type": "array", "required": "True"}},
816 },
817 "add_users.user.banned": {
818 "url": "user/banned/add_users",
819 "params": {
820 "ip_addresses": {"type": "array", "required": "True"},
821 "expiry": {"type": "int", "required": "False"},
822 },
823 },
824 "clear_all.user.banned": {"url": "user/banned/clear_all", "params": {}},
825 "activate.user.fortitoken": {
826 "url": "user/fortitoken/activate",
827 "params": {"tokens": {"type": "array", "required": "False"}},
828 },
829 "refresh.user.fortitoken": {
830 "url": "user/fortitoken/refresh",
831 "params": {"tokens": {"type": "array", "required": "False"}},
832 },
833 "provision.user.fortitoken": {
834 "url": "user/fortitoken/provision",
835 "params": {"tokens": {"type": "array", "required": "False"}},
836 },
837 "send-activation.user.fortitoken": {
838 "url": "user/fortitoken/send-activation",
839 "params": {
840 "token": {"type": "string", "required": "True"},
841 "method": {"type": "string", "required": "False"},
842 "email": {"type": "string", "required": "False"},
843 "sms_phone": {"type": "string", "required": "False"},
844 },
845 },
846 "import-trial.user.fortitoken": {
847 "url": "user/fortitoken/import-trial",
848 "params": {},
849 },
850 "import-mobile.user.fortitoken": {
851 "url": "user/fortitoken/import-mobile",
852 "params": {"code": {"type": "string", "required": "True"}},
853 },
854 "import-seed.user.fortitoken": {
855 "url": "user/fortitoken/import-seed",
856 "params": {"file_content": {"type": "string", "required": "False"}},
857 },
858 "refresh-server.user.fsso": {"url": "user/fsso/refresh-server", "params": {}},
859 "test-connect.user.radius": {
860 "url": "user/radius/test-connect",
861 "params": {
862 "mkey": {"type": "string", "required": "False"},
863 "ordinal": {"type": "string", "required": "False"},
864 "server": {"type": "string", "required": "False"},
865 "secret": {"type": "string", "required": "False"},
866 "auth_type": {"type": "string", "required": "False"},
867 "user": {"type": "string", "required": "False"},
868 "password": {"type": "string", "required": "False"},
869 },
870 },
871 "test.user.tacacs-plus": {
872 "url": "user/tacacs-plus/test",
873 "params": {
874 "mkey": {"type": "string", "required": "False"},
875 "ordinal": {"type": "string", "required": "False"},
876 "server": {"type": "string", "required": "False"},
877 "secret": {"type": "string", "required": "False"},
878 "port": {"type": "int", "required": "False"},
879 "source_ip": {"type": "string", "required": "False"},
880 },
881 },
882 "delete.webfilter.override": {
883 "url": "webfilter/override/delete",
884 "params": {"mkey": {"type": "string", "required": "False"}},
885 },
886 "reset.webfilter.category-quota": {
887 "url": "webfilter/category-quota/reset",
888 "params": {
889 "profile": {"type": "string", "required": "False"},
890 "user": {"type": "string", "required": "False"},
891 },
892 },
893 "tunnel_up.vpn.ipsec": {
894 "url": "vpn/ipsec/tunnel_up",
895 "params": {
896 "p1name": {"type": "string", "required": "True"},
897 "p2name": {"type": "string", "required": "True"},
898 "p2serial": {"type": "int", "required": "False"},
899 },
900 },
901 "tunnel_down.vpn.ipsec": {
902 "url": "vpn/ipsec/tunnel_down",
903 "params": {
904 "p1name": {"type": "string", "required": "True"},
905 "p2name": {"type": "string", "required": "True"},
906 "p2serial": {"type": "int", "required": "False"},
907 },
908 },
909 "tunnel_reset_stats.vpn.ipsec": {
910 "url": "vpn/ipsec/tunnel_reset_stats",
911 "params": {"p1name": {"type": "string", "required": "True"}},
912 },
913 "clear_tunnel.vpn.ssl": {"url": "vpn/ssl/clear_tunnel", "params": {}},
914 "delete.vpn.ssl": {
915 "url": "vpn/ssl/delete",
916 "params": {
917 "type": {"type": "string", "required": "True"},
918 "index": {"type": "int", "required": "True"},
919 },
920 },
921 "import.vpn-certificate.ca": {
922 "url": "vpn-certificate/ca/import",
923 "params": {
924 "import_method": {"type": "string", "required": "True"},
925 "scep_url": {"type": "string", "required": "False"},
926 "scep_ca_id": {"type": "string", "required": "False"},
927 "scope": {"type": "string", "required": "False"},
928 "file_content": {"type": "string", "required": "False"},
929 },
930 },
931 "import.vpn-certificate.crl": {
932 "url": "vpn-certificate/crl/import",
933 "params": {
934 "scope": {"type": "string", "required": "False"},
935 "file_content": {"type": "string", "required": "False"},
936 },
937 },
938 "import.vpn-certificate.local": {
939 "url": "vpn-certificate/local/import",
940 "params": {
941 "type": {"type": "string", "required": "True"},
942 "certname": {"type": "string", "required": "False"},
943 "password": {"type": "string", "required": "False"},
944 "key_file_content": {"type": "string", "required": "False"},
945 "scope": {"type": "string", "required": "False"},
946 "acme_domain": {"type": "string", "required": "False"},
947 "acme_email": {"type": "string", "required": "False"},
948 "acme_ca_url": {"type": "string", "required": "False"},
949 "acme_rsa_key_size": {"type": "int", "required": "False"},
950 "acme_renew_window": {"type": "int", "required": "False"},
951 "file_content": {"type": "string", "required": "False"},
952 },
953 },
954 "import.vpn-certificate.remote": {
955 "url": "vpn-certificate/remote/import",
956 "params": {
957 "scope": {"type": "string", "required": "False"},
958 "file_content": {"type": "string", "required": "False"},
959 },
960 },
961 "generate.vpn-certificate.csr": {
962 "url": "vpn-certificate/csr/generate",
963 "params": {
964 "certname": {"type": "string", "required": "True"},
965 "subject": {"type": "string", "required": "True"},
966 "keytype": {"type": "string", "required": "True"},
967 "keysize": {"type": "int", "required": "False"},
968 "curvename": {"type": "string", "required": "False"},
969 "orgunits": {"type": "array", "required": "False"},
970 "org": {"type": "string", "required": "False"},
971 "city": {"type": "string", "required": "False"},
972 "state": {"type": "string", "required": "False"},
973 "countrycode": {"type": "string", "required": "False"},
974 "email": {"type": "string", "required": "False"},
975 "subject_alt_name": {"type": "string", "required": "False"},
976 "password": {"type": "string", "required": "False"},
977 "scep_url": {"type": "string", "required": "False"},
978 "scep_password": {"type": "string", "required": "False"},
979 "scope": {"type": "string", "required": "False"},
980 },
981 },
982 "reset.wanopt.history": {"url": "wanopt/history/reset", "params": {}},
983 "reset.wanopt.webcache": {"url": "wanopt/webcache/reset", "params": {}},
984 "reset.wanopt.peer_stats": {"url": "wanopt/peer_stats/reset", "params": {}},
985 "reset.webcache.stats": {"url": "webcache/stats/reset", "params": {}},
986 "set_status.wifi.managed_ap": {
987 "url": "wifi/managed_ap/set_status",
988 "params": {
989 "wtpname": {"type": "string", "required": "False"},
990 "admin": {"type": "string", "required": "False"},
991 },
992 },
993 "download.wifi.firmware": {
994 "url": "wifi/firmware/download",
995 "params": {"image_id": {"type": "string", "required": "True"}},
996 },
997 "push.wifi.firmware": {
998 "url": "wifi/firmware/push",
999 "params": {
1000 "serial": {"type": "string", "required": "True"},
1001 "image_id": {"type": "string", "required": "True"},
1002 },
1003 },
1004 "upload.wifi.firmware": {
1005 "url": "wifi/firmware/upload",
1006 "params": {
1007 "serials": {"type": "string", "required": "False"},
1008 "file_content": {"type": "string", "required": "False"},
1009 },
1010 },
1011 "restart.wifi.managed_ap": {
1012 "url": "wifi/managed_ap/restart",
1013 "params": {"wtpname": {"type": "string", "required": "False"}},
1014 },
1015 "reset.wifi.euclid": {"url": "wifi/euclid/reset", "params": {}},
1016 "clear_all.wifi.rogue_ap": {"url": "wifi/rogue_ap/clear_all", "params": {}},
1017 "set_status.wifi.rogue_ap": {
1018 "url": "wifi/rogue_ap/set_status",
1019 "params": {
1020 "bssid": {"type": "array", "required": "False"},
1021 "ssid": {"type": "array", "required": "False"},
1022 "status": {"type": "string", "required": "False"},
1023 },
1024 },
1025 "reset.firewall.consolidated-policy": {
1026 "url": "firewall/consolidated-policy/reset",
1027 "params": {},
1028 },
1029 "clear_counters.firewall.consolidated-policy": {
1030 "url": "firewall/consolidated-policy/clear_counters",
1031 "params": {"policy": {"type": "int", "required": "False"}},
1032 },
1033 "clear_counters.firewall.security-policy": {
1034 "url": "firewall/security-policy/clear_counters",
1035 "params": {"policy": {"type": "int", "required": "False"}},
1036 },
1037 "add.firewall.clearpass-address": {
1038 "url": "firewall/clearpass-address/add",
1039 "params": {
1040 "endpoint_ip": {"type": "array", "required": "True"},
1041 "spt": {"type": "string", "required": "False"},
1042 },
1043 },
1044 "delete.firewall.clearpass-address": {
1045 "url": "firewall/clearpass-address/delete",
1046 "params": {
1047 "endpoint_ip": {"type": "array", "required": "True"},
1048 "spt": {"type": "string", "required": "False"},
1049 },
1050 },
1051 "delete.log.local-report": {
1052 "url": "log/local-report/delete",
1053 "params": {"mkeys": {"type": "array", "required": "True"}},
1054 },
1055 "migrate.registration.forticloud": {
1056 "url": "registration/forticloud/migrate",
1057 "params": {
1058 "email": {"type": "string", "required": "True"},
1059 "password": {"type": "string", "required": "True"},
1060 },
1061 },
1062 "change-vdom-mode.system.admin": {
1063 "url": "system/admin/change-vdom-mode",
1064 "params": {"vdom-mode": {"type": "string", "required": "True"}},
1065 },
1066 "delete.system.config-script": {
1067 "url": "system/config-script/delete",
1068 "params": {"id_list": {"type": "array", "required": "True"}},
1069 },
1070 "run.system.config-script": {
1071 "url": "system/config-script/run",
1072 "params": {"remote_script": {"type": "string", "required": "True"}},
1073 },
1074 "upload.system.config-script": {
1075 "url": "system/config-script/upload",
1076 "params": {
1077 "filename": {"type": "string", "required": "False"},
1078 "file_content": {"type": "string", "required": "False"},
1079 },
1080 },
1081 "diagnose.extender-controller.extender": {
1082 "url": "extender-controller/extender/diagnose",
1083 "params": {
1084 "id": {"type": "string", "required": "True"},
1085 "cmd": {"type": "string", "required": "True"},
1086 },
1087 },
1088 "upgrade.extender-controller.extender": {
1089 "url": "extender-controller/extender/upgrade",
1090 "params": {
1091 "id": {"type": "string", "required": "True"},
1092 "file_content": {"type": "string", "required": "False"},
1093 },
1094 },
1095 "add.nsx.service": {
1096 "url": "nsx/service/add",
1097 "params": {"mkey": {"type": "string", "required": "True"}},
1098 },
1099 "update.system.sdn-connector": {
1100 "url": "system/sdn-connector/update",
1101 "params": {"mkey": {"type": "string", "required": "True"}},
1102 },
1103 "import.web-ui.language": {
1104 "url": "web-ui/language/import",
1105 "params": {"file_content": {"type": "string", "required": "False"}},
1106 },
1107 "create.web-ui.custom-language": {
1108 "url": "web-ui/custom-language/create",
1109 "params": {
1110 "lang_name": {"type": "string", "required": "True"},
1111 "lang_comments": {"type": "string", "required": "False"},
1112 "file_content": {"type": "string", "required": "False"},
1113 },
1114 },
1115 "update.web-ui.custom-language": {
1116 "url": "web-ui/custom-language/update",
1117 "params": {
1118 "mkey": {"type": "string", "required": "True"},
1119 "lang_name": {"type": "string", "required": "False"},
1120 "lang_comments": {"type": "string", "required": "False"},
1121 "file_content": {"type": "string", "required": "False"},
1122 },
1123 },
1124 "email.user.guest": {
1125 "url": "user/guest/email",
1126 "params": {
1127 "group": {"type": "string", "required": "True"},
1128 "guest": {"type": "array", "required": "True"},
1129 },
1130 },
1131 "sms.user.guest": {
1132 "url": "user/guest/sms",
1133 "params": {
1134 "group": {"type": "string", "required": "True"},
1135 "guest": {"type": "array", "required": "True"},
1136 },
1137 },
1138 "utm.rating-lookup": {
1139 "url": "utm/rating-lookup/select",
1140 "params": {
1141 "url": {"type": "array", "required": "False"},
1142 "lang": {"type": "string", "required": "False"},
1143 },
1144 },
1145 "connect.wifi.network": {
1146 "url": "wifi/network/connect",
1147 "params": {"ssid": {"type": "string", "required": "True"}},
1148 },
1149 "scan.wifi.network": {"url": "wifi/network/scan", "params": {}},
1150 "upload.wifi.region-image": {
1151 "url": "wifi/region-image/upload",
1152 "params": {
1153 "region_name": {"type": "string", "required": "True"},
1154 "image_type": {"type": "string", "required": "True"},
1155 "file_content": {"type": "string", "required": "False"},
1156 },
1157 },
1158 "refresh.azure.application-list": {
1159 "url": "azure/application-list/refresh",
1160 "params": {"last_update_time": {"type": "int", "required": "False"}},
1161 },
1162 "verify-cert.endpoint-control.ems": {
1163 "url": "endpoint-control/ems/verify-cert",
1164 "params": {
1165 "ems_id": {"type": "int", "required": "True"},
1166 "scope": {"type": "string", "required": "False"},
1167 "fingerprint": {"type": "string", "required": "True"},
1168 },
1169 },
1170 "geoip.geoip-query": {
1171 "url": "geoip/geoip-query/select",
1172 "params": {"ip_addresses": {"type": "array", "required": "True"}},
1173 },
1174 "transfer.registration.forticare": {
1175 "url": "registration/forticare/transfer",
1176 "params": {
1177 "email": {"type": "string", "required": "True"},
1178 "password": {"type": "string", "required": "True"},
1179 "old_email": {"type": "string", "required": "True"},
1180 "old_password": {"type": "string", "required": "True"},
1181 "is_government": {"type": "boolean", "required": "False"},
1182 },
1183 },
1184 "register-device.registration.forticloud": {
1185 "url": "registration/forticloud/register-device",
1186 "params": {
1187 "serial": {"type": "string", "required": "False"},
1188 "email": {"type": "string", "required": "True"},
1189 "password": {"type": "string", "required": "True"},
1190 "reseller": {"type": "string", "required": "True"},
1191 "reseller_id": {"type": "int", "required": "True"},
1192 "country": {"type": "string", "required": "True"},
1193 "is_government": {"type": "boolean", "required": "False"},
1194 "agreement_accepted": {"type": "boolean", "required": "False"},
1195 },
1196 },
1197 "register-appliance.system.csf": {
1198 "url": "system/csf/register-appliance",
1199 "params": {
1200 "type": {"type": "string", "required": "True"},
1201 "mgmt_ip": {"type": "string", "required": "True"},
1202 "mgmt_port": {"type": "int", "required": "False"},
1203 "mgmt_url_parameters": {"type": "array", "required": "False"},
1204 "serial": {"type": "string", "required": "True"},
1205 "hostname": {"type": "string", "required": "False"},
1206 },
1207 },
1208 "clear.system.sniffer": {
1209 "url": "system/sniffer/clear",
1210 "params": {"mkey": {"type": "int", "required": "True"}},
1211 },
1212 "webhook.system.automation-stitch": {
1213 "url": "system/automation-stitch/webhook",
1214 "params": {"mkey": {"type": "string", "required": "True"}},
1215 },
1216 "format.system.logdisk": {
1217 "url": "system/logdisk/format",
1218 "params": {"raid": {"type": "string", "required": "True"}},
1219 },
1220 "speed-test-trigger.system.interface": {
1221 "url": "system/interface/speed-test-trigger",
1222 "params": {"mkey": {"type": "string", "required": "True"}},
1223 },
1224 "read-info.system.certificate": {
1225 "url": "system/certificate/read-info",
1226 "params": {"value": {"type": "string", "required": "True"}},
1227 },
1228 "provision-user.vpn.ssl": {
1229 "url": "vpn/ssl/provision-user",
1230 "params": {
1231 "host": {"type": "string", "required": "True"},
1232 "port": {"type": "int", "required": "True"},
1233 "vpn_name": {"type": "string", "required": "True"},
1234 "method": {"type": "string", "required": "False"},
1235 "email_list": {"type": "string", "required": "False"},
1236 "phone_user_list": {"type": "string", "required": "False"},
1237 "phone_number_list": {"type": "string", "required": "False"},
1238 "sms_method": {"type": "string", "required": "False"},
1239 "sms_server": {"type": "string", "required": "False"},
1240 },
1241 },
1242 "upload.webproxy.pacfile": {
1243 "url": "webproxy/pacfile/upload",
1244 "params": {
1245 "filename": {"type": "string", "required": "False"},
1246 "file_content": {"type": "string", "required": "False"},
1247 },
1248 },
1249 "disassociate.wifi.client": {
1250 "url": "wifi/client/disassociate",
1251 "params": {"mac": {"type": "string", "required": "True"}},
1252 },
1253 "start.wifi.spectrum": {
1254 "url": "wifi/spectrum/start",
1255 "params": {
1256 "wtp_id": {"type": "string", "required": "True"},
1257 "radio_id": {"type": "int", "required": "True"},
1258 "channels": {"type": "array", "required": "True"},
1259 "duration": {"type": "int", "required": "True"},
1260 },
1261 },
1262 "keep-alive.wifi.spectrum": {
1263 "url": "wifi/spectrum/keep-alive",
1264 "params": {
1265 "wtp_id": {"type": "string", "required": "True"},
1266 "radio_id": {"type": "int", "required": "True"},
1267 "duration": {"type": "int", "required": "True"},
1268 },
1269 },
1270 "stop.wifi.spectrum": {
1271 "url": "wifi/spectrum/stop",
1272 "params": {
1273 "wtp_id": {"type": "string", "required": "True"},
1274 "radio_id": {"type": "int", "required": "True"},
1275 },
1276 },
1277 "start.wifi.vlan-probe": {
1278 "url": "wifi/vlan-probe/start",
1279 "params": {
1280 "ap_interface": {"type": "int", "required": "True"},
1281 "wtp": {"type": "string", "required": "True"},
1282 "start_vlan_id": {"type": "int", "required": "True"},
1283 "end_vlan_id": {"type": "int", "required": "True"},
1284 "retries": {"type": "int", "required": "True"},
1285 "timeout": {"type": "int", "required": "True"},
1286 },
1287 },
1288 "stop.wifi.vlan-probe": {
1289 "url": "wifi/vlan-probe/stop",
1290 "params": {
1291 "ap_interface": {"type": "int", "required": "True"},
1292 "wtp": {"type": "string", "required": "True"},
1293 },
1294 },
1295 "generate-keys.wifi.ssid": {
1296 "url": "wifi/ssid/generate-keys",
1297 "params": {
1298 "mpsk_profile": {"type": "string", "required": "True"},
1299 "group": {"type": "string", "required": "True"},
1300 "prefix": {"type": "string", "required": "True"},
1301 "count": {"type": "int", "required": "True"},
1302 "key_length": {"type": "int", "required": "True"},
1303 },
1304 },
1305 "save.system.config": {"url": "system/config/save", "params": {}},
1306 "led-blink.wifi.managed_ap": {
1307 "url": "wifi/managed_ap/led-blink",
1308 "params": {
1309 "serials": {"type": "array", "required": "True"},
1310 "blink": {"type": "boolean", "required": "True"},
1311 "duration": {"type": "int", "required": "False"},
1312 },
1313 },
1314 "auth.user.firewall": {
1315 "url": "user/firewall/auth",
1316 "params": {
1317 "username": {"type": "string", "required": "True"},
1318 "ip": {"type": "string", "required": "True"},
1319 "server": {"type": "string", "required": "False"},
1320 },
1321 },
1322 "remove.user.device": {
1323 "url": "user/device/remove",
1324 "params": {"macs": {"type": "array", "required": "False"}},
1325 },
1326 "clear.vpn.ike": {
1327 "url": "vpn/ike/clear",
1328 "params": {"mkey": {"type": "string", "required": "True"}},
1329 },
1330 "reset.firewall.multicast-policy": {
1331 "url": "firewall/multicast-policy/reset",
1332 "params": {},
1333 },
1334 "reset.firewall.multicast-policy6": {
1335 "url": "firewall/multicast-policy6/reset",
1336 "params": {},
1337 },
1338 "clear_counters.firewall.multicast-policy": {
1339 "url": "firewall/multicast-policy/clear_counters",
1340 "params": {"policy": {"type": "int", "required": "False"}},
1341 },
1342 "clear_counters.firewall.multicast-policy6": {
1343 "url": "firewall/multicast-policy6/clear_counters",
1344 "params": {"policy": {"type": "int", "required": "False"}},
1345 },
1346 "clear-soft-in.router.bgp": {"url": "router/bgp/clear-soft-in", "params": {}},
1347 "clear-soft-out.router.bgp": {"url": "router/bgp/clear-soft-out", "params": {}},
1348 "enable-app-bandwidth-tracking.system.traffic-history": {
1349 "url": "system/traffic-history/enable-app-bandwidth-tracking",
1350 "params": {},
1351 },
1352 "refresh.system.external-resource": {
1353 "url": "system/external-resource/refresh",
1354 "params": {
1355 "mkey": {"type": "string", "required": "True"},
1356 "check_status_only": {"type": "boolean", "required": "False"},
1357 "last_connection_time": {"type": "int", "required": "False"},
1358 },
1359 },
1360 "reset.firewall.central-snat-map": {
1361 "url": "firewall/central-snat-map/reset",
1362 "params": {},
1363 },
1364 "clear-counters.firewall.central-snat-map": {
1365 "url": "firewall/central-snat-map/clear-counters",
1366 "params": {"policy": {"type": "int", "required": "False"}},
1367 },
1368 "reset.firewall.dnat": {"url": "firewall/dnat/reset", "params": {}},
1369 "clear-counters.firewall.dnat": {
1370 "url": "firewall/dnat/clear-counters",
1371 "params": {
1372 "id": {"type": "int", "required": "False"},
1373 "is_ipv6": {"type": "boolean", "required": "False"},
1374 },
1375 },
1376 "close-multiple.firewall.session": {
1377 "url": "firewall/session/close-multiple",
1378 "params": {
1379 "proto": {"type": "string", "required": "False"},
1380 "saddr": {"type": "string", "required": "False"},
1381 "daddr": {"type": "string", "required": "False"},
1382 "sport": {"type": "int", "required": "False"},
1383 "dport": {"type": "int", "required": "False"},
1384 "naddr": {"type": "string", "required": "False"},
1385 "nport": {"type": "int", "required": "False"},
1386 "policy": {"type": "int", "required": "False"},
1387 },
1388 },
1389 "close-multiple.firewall.session6": {
1390 "url": "firewall/session6/close-multiple",
1391 "params": {
1392 "proto": {"type": "string", "required": "False"},
1393 "saddr": {"type": "string", "required": "False"},
1394 "daddr": {"type": "string", "required": "False"},
1395 "sport": {"type": "int", "required": "False"},
1396 "dport": {"type": "int", "required": "False"},
1397 "policy": {"type": "int", "required": "False"},
1398 },
1399 },
1400 "close-all.firewall.session": {"url": "firewall/session/close-all", "params": {}},
1401 "clear.system.crash-log": {"url": "system/crash-log/clear", "params": {}},
1402 "backup.system.config": {
1403 "url": "system/config/backup",
1404 "params": {
1405 "destination": {"type": "string", "required": "False"},
1406 "usb_filename": {"type": "string", "required": "False"},
1407 "password": {"type": "string", "required": "False"},
1408 "scope": {"type": "string", "required": "True"},
1409 "vdom": {"type": "string", "required": "False"},
1410 "password_mask": {"type": "boolean", "required": "False"},
1411 "file_format": {"type": "string", "required": "False"},
1412 },
1413 },
1414 "abort.user.query": {
1415 "url": "user/query/abort",
1416 "params": {"query_id": {"type": "int", "required": "True"}},
1417 },
1418 "create.vpn-certificate.local": {
1419 "url": "vpn-certificate/local/create",
1420 "params": {
1421 "certname": {"type": "string", "required": "True"},
1422 "common_name": {"type": "string", "required": "True"},
1423 "scope": {"type": "string", "required": "True"},
1424 },
1425 },
1426 "flush.firewall.gtp": {
1427 "url": "firewall/gtp/flush",
1428 "params": {
1429 "scope": {"type": "string", "required": "False"},
1430 "gtp_profile": {"type": "string", "required": "False"},
1431 "version": {"type": "int", "required": "False"},
1432 "imsi": {"type": "string", "required": "False"},
1433 "msisdn": {"type": "string", "required": "False"},
1434 "ms_addr": {"type": "string", "required": "False"},
1435 "ms_addr6": {"type": "string", "required": "False"},
1436 "cteid": {"type": "int", "required": "False"},
1437 "cteid_addr": {"type": "string", "required": "False"},
1438 "cteid_addr6": {"type": "string", "required": "False"},
1439 "fteid": {"type": "int", "required": "False"},
1440 "fteid_addr": {"type": "string", "required": "False"},
1441 "fteid_addr6": {"type": "string", "required": "False"},
1442 "apn": {"type": "string", "required": "False"},
1443 },
1444 },
1445 "kill.system.process": {
1446 "url": "system/process/kill",
1447 "params": {
1448 "pid": {"type": "int", "required": "True"},
1449 "signal": {"type": "int", "required": "False"},
1450 },
1451 },
1452 "upload.system.hscalefw-license": {
1453 "url": "system/hscalefw-license/upload",
1454 "params": {"license_key": {"type": "string", "required": "True"}},
1455 },
1456 "download.system.vmlicense": {
1457 "url": "system/vmlicense/download",
1458 "params": {
1459 "token": {"type": "string", "required": "False"},
1460 "proxy_url": {"type": "string", "required": "False"},
1461 },
1462 },
1463 "start.network.debug-flow": {
1464 "url": "network/debug-flow/start",
1465 "params": {
1466 "num_packets": {"type": "int", "required": "True"},
1467 "ipv6": {"type": "boolean", "required": "True"},
1468 "negate": {"type": "boolean", "required": "False"},
1469 "addr_from": {"type": "string", "required": "False"},
1470 "addr_to": {"type": "string", "required": "False"},
1471 "daddr_from": {"type": "string", "required": "False"},
1472 "daddr_to": {"type": "string", "required": "False"},
1473 "saddr_from": {"type": "string", "required": "False"},
1474 "saddr_to": {"type": "string", "required": "False"},
1475 "port_from": {"type": "int", "required": "False"},
1476 "port_to": {"type": "int", "required": "False"},
1477 "dport_from": {"type": "int", "required": "False"},
1478 "dport_to": {"type": "int", "required": "False"},
1479 "sport_from": {"type": "int", "required": "False"},
1480 "sport_to": {"type": "int", "required": "False"},
1481 "proto": {"type": "int", "required": "False"},
1482 },
1483 },
1484 "stop.network.debug-flow": {"url": "network/debug-flow/stop", "params": {}},
1485 "upload.system.lte-modem": {
1486 "url": "system/lte-modem/upload",
1487 "params": {
1488 "filename": {"type": "string", "required": "False"},
1489 "file_content": {"type": "string", "required": "False"},
1490 },
1491 },
1492 "upgrade.system.lte-modem": {"url": "system/lte-modem/upgrade", "params": {}},
1493 "port-stats-reset.switch-controller.managed-switch": {
1494 "url": "switch-controller/managed-switch/port-stats-reset",
1495 "params": {
1496 "mkey": {"type": "string", "required": "True"},
1497 "ports": {"type": "array", "required": "False"},
1498 },
1499 },
1500 "bounce-port.switch-controller.managed-switch": {
1501 "url": "switch-controller/managed-switch/bounce-port",
1502 "params": {
1503 "mkey": {"type": "string", "required": "True"},
1504 "port": {"type": "string", "required": "True"},
1505 "duration": {"type": "int", "required": "False"},
1506 "stop": {"type": "boolean", "required": "False"},
1507 },
1508 },
1509 "set-tier1.switch-controller.mclag-icl": {
1510 "url": "switch-controller/mclag-icl/set-tier1",
1511 "params": {
1512 "fortilink": {"type": "string", "required": "True"},
1513 "peer1": {"type": "string", "required": "True"},
1514 "peer2": {"type": "string", "required": "True"},
1515 },
1516 },
1517 "wake-on-lan.system.interface": {
1518 "url": "system/interface/wake-on-lan",
1519 "params": {
1520 "mkey": {"type": "string", "required": "True"},
1521 "mac": {"type": "string", "required": "True"},
1522 "protocol_option": {"type": "string", "required": "False"},
1523 "port": {"type": "int", "required": "False"},
1524 "address": {"type": "string", "required": "False"},
1525 "secureon_password": {"type": "string", "required": "False"},
1526 },
1527 },
1528 "manual-update.system.fortiguard": {
1529 "url": "system/fortiguard/manual-update",
1530 "params": {"file_content": {"type": "string", "required": "False"}},
1531 },
1532 "purdue-level.user.device": {
1533 "url": "user/device/purdue-level",
1534 "params": {
1535 "mac": {"type": "string", "required": "True"},
1536 "ip": {"type": "string", "required": "False"},
1537 "level": {"type": "string", "required": "True"},
1538 },
1539 },
1540 "deregister-device.registration.forticare": {
1541 "url": "registration/forticare/deregister-device",
1542 "params": {
1543 "email": {"type": "string", "required": "True"},
1544 "password": {"type": "string", "required": "True"},
1545 },
1546 },
1547 "soft-reset-neighbor.router.bgp": {
1548 "url": "router/bgp/soft-reset-neighbor",
1549 "params": {"ip": {"type": "string", "required": "True"}},
1550 },
1551 "download-eval.system.vmlicense": {
1552 "url": "system/vmlicense/download-eval",
1553 "params": {
1554 "account_id": {"type": "string", "required": "True"},
1555 "account_password": {"type": "string", "required": "True"},
1556 "is_government": {"type": "boolean", "required": "False"},
1557 },
1558 },
1559 "dynamic.system.external-resource": {
1560 "url": "system/external-resource/dynamic",
1561 "params": {"commands": {"type": "array", "required": "True"}},
1562 },
1563 "pse-config.switch-controller.recommendation": {
1564 "url": "switch-controller/recommendation/pse-config",
1565 "params": {"fortilink": {"type": "string", "required": "True"}},
1566 },
1567 "update.switch-controller.isl-lockdown": {
1568 "url": "switch-controller/isl-lockdown/update",
1569 "params": {
1570 "fortilink": {"type": "string", "required": "True"},
1571 "status": {"type": "string", "required": "True"},
1572 },
1573 },
1574 "clear-counters.firewall.ztna-firewall-policy": {
1575 "url": "firewall/ztna-firewall-policy/clear-counters",
1576 "params": {"policy": {"type": "int", "required": "False"}},
1577 },
1578 "update.forticonverter.eligibility": {
1579 "url": "forticonverter/eligibility/update",
1580 "params": {},
1581 },
1582 "create.forticonverter.ticket": {
1583 "url": "forticonverter/ticket/create",
1584 "params": {},
1585 },
1586 "update.forticonverter.sn-list": {
1587 "url": "forticonverter/sn-list/update",
1588 "params": {},
1589 },
1590 "upload.forticonverter.config": {
1591 "url": "forticonverter/config/upload",
1592 "params": {
1593 "ticket_id": {"type": "string", "required": "True"},
1594 "file_content": {"type": "string", "required": "False"},
1595 },
1596 },
1597 "update.forticonverter.intf-list": {
1598 "url": "forticonverter/intf-list/update",
1599 "params": {},
1600 },
1601 "forticonverter.set-source-sn": {
1602 "url": "forticonverter/set-source-sn/select",
1603 "params": {
1604 "source_sn": {"type": "string", "required": "True"},
1605 "ticket_id": {"type": "string", "required": "True"},
1606 },
1607 },
1608 "submit.forticonverter.intf-mapping": {
1609 "url": "forticonverter/intf-mapping/submit",
1610 "params": {
1611 "intf_mapping": {"type": "object", "required": "True"},
1612 "ticket_id": {"type": "string", "required": "True"},
1613 },
1614 },
1615 "submit.forticonverter.mgmt-intf": {
1616 "url": "forticonverter/mgmt-intf/submit",
1617 "params": {
1618 "intf_details": {"type": "object", "required": "True"},
1619 "ticket_id": {"type": "string", "required": "True"},
1620 },
1621 },
1622 "submit.forticonverter.notes": {
1623 "url": "forticonverter/notes/submit",
1624 "params": {
1625 "ticket_id": {"type": "string", "required": "True"},
1626 "contact_name": {"type": "string", "required": "True"},
1627 "contact_email": {"type": "string", "required": "True"},
1628 "contact_phone": {"type": "string", "required": "True"},
1629 "notes": {"type": "string", "required": "False"},
1630 },
1631 },
1632 "submit.forticonverter.ticket": {
1633 "url": "forticonverter/ticket/submit",
1634 "params": {"ticket_id": {"type": "string", "required": "True"}},
1635 },
1636 "update.forticonverter.submitted-info": {
1637 "url": "forticonverter/submitted-info/update",
1638 "params": {},
1639 },
1640 "start.forticonverter.download": {
1641 "url": "forticonverter/download/start",
1642 "params": {
1643 "ticket_id": {"type": "string", "required": "True"},
1644 "extension": {"type": "string", "required": "True"},
1645 },
1646 },
1647 "trial.user.fortitoken-cloud": {"url": "user/fortitoken-cloud/trial", "params": {}},
1648 "unverify-cert.endpoint-control.ems": {
1649 "url": "endpoint-control/ems/unverify-cert",
1650 "params": {
1651 "ems_id": {"type": "int", "required": "True"},
1652 "scope": {"type": "string", "required": "False"},
1653 },
1654 },
1655 "update-global-label.firewall.policy": {
1656 "url": "firewall/policy/update-global-label",
1657 "params": {
1658 "policyid": {"type": "string", "required": "True"},
1659 "current-label": {"type": "string", "required": "False"},
1660 "new-label": {"type": "string", "required": "False"},
1661 },
1662 },
1663 "update-global-label.firewall.security-policy": {
1664 "url": "firewall/security-policy/update-global-label",
1665 "params": {
1666 "policyid": {"type": "string", "required": "True"},
1667 "current-label": {"type": "string", "required": "False"},
1668 "new-label": {"type": "string", "required": "False"},
1669 },
1670 },
1671 "set-tier-plus.switch-controller.mclag-icl": {
1672 "url": "switch-controller/mclag-icl/set-tier-plus",
1673 "params": {
1674 "fortilink": {"type": "string", "required": "True"},
1675 "parent_peer1": {"type": "string", "required": "True"},
1676 "parent_peer2": {"type": "string", "required": "True"},
1677 "peer1": {"type": "string", "required": "True"},
1678 "peer2": {"type": "string", "required": "True"},
1679 "isl_port_group": {"type": "string", "required": "True"},
1680 },
1681 },
1682 "user.password-policy-conform": {
1683 "url": "user/password-policy-conform/select",
1684 "params": {
1685 "username": {"type": "string", "required": "False"},
1686 "password": {"type": "string", "required": "True"},
1687 },
1688 },
1689 "change-password.user.local": {
1690 "url": "user/local/change-password",
1691 "params": {
1692 "username": {"type": "string", "required": "True"},
1693 "new_password": {"type": "string", "required": "True"},
1694 },
1695 },
1696 "report.sdwan.link-monitor-metrics": {
1697 "url": "sdwan/link-monitor-metrics/report",
1698 "params": {
1699 "agent_ip": {"type": "string", "required": "True"},
1700 "application_name": {"type": "string", "required": "True"},
1701 "application_id": {"type": "int", "required": "True"},
1702 "latency": {"type": "double", "required": "True"},
1703 "jitter": {"type": "double", "required": "True"},
1704 "packet_loss": {"type": "double", "required": "True"},
1705 "ntt": {"type": "double", "required": "False"},
1706 "srt": {"type": "double", "required": "False"},
1707 "application_error": {"type": "double", "required": "False"},
1708 },
1709 },
1710 "generic-address.system.external-resource": {
1711 "url": "system/external-resource/generic-address",
1712 "params": {
1713 "mkey": {"type": "string", "required": "True"},
1714 "data": {"type": "object", "required": "True"},
1715 },
1716 },
1717 "set.system.private-data-encryption": {
1718 "url": "system/private-data-encryption/set",
1719 "params": {
1720 "enable": {"type": "boolean", "required": "True"},
1721 "password": {"type": "string", "required": "False"},
1722 },
1723 },
1724 "create-default.wifi.ap-profile": {
1725 "url": "wifi/ap-profile/create-default",
1726 "params": {"platform": {"type": "string", "required": "True"}},
1727 },
1728 }
1729
1730
1731 def is_successful_status(resp):
1732 return (
1733 "status" in resp
1734 and resp["status"] == "success"
1735 or "http_status" in resp
1736 and resp["http_status"] == 200
1737 or "http_method" in resp
1738 and resp["http_method"] == "DELETE"
1739 and resp["http_status"] == 404
1740 )
1741
1742
1743 def validate_parameters(fos):
1744 # parameter validation will not block task, warning will be provided in case of parameters validation.
1745 mod_params = fos._module.params
1746 selector = mod_params["selector"]
1747 params = mod_params["params"]
1748
1749 if params:
1750 for param_key, param_value in params.items():
1751 if not isinstance(param_value, (bool, int, str, list)):
1752 return False, {
1753 "message": "value of param:%s must be atomic" % (param_key)
1754 }
1755
1756 acceptable_param_names = list(module_selectors_defs[selector]["params"].keys())
1757 provided_param_names = list(params.keys() if params else [])
1758
1759 params_valid = True
1760 for param_name in acceptable_param_names:
1761 if param_name not in provided_param_names and eval(
1762 module_selectors_defs[selector]["params"][param_name]["required"]
1763 ):
1764 params_valid = False
1765 break
1766 if params_valid:
1767 for param_name in provided_param_names:
1768 if param_name not in acceptable_param_names:
1769 params_valid = False
1770 break
1771 if not params_valid:
1772 param_summary = [
1773 "%s(%s, %s)"
1774 % (
1775 param_name,
1776 param["type"],
1777 "required" if eval(param["required"]) else "optional",
1778 )
1779 for param_name, param in module_selectors_defs[selector]["params"].items()
1780 ]
1781 fos._module.warn(
1782 "selector:%s expects params:%s" % (selector, str(param_summary))
1783 )
1784 return True, {}
1785
1786
1787 def fortios_monitor(fos):
1788 valid, result = validate_parameters(fos)
1789 if not valid:
1790 return True, False, result
1791
1792 params = fos._module.params
1793
1794 selector = params["selector"]
1795 selector_params = params["params"]
1796
1797 selector_url = module_selectors_defs[selector]["url"]
1798 request_headers = None
1799 if selector in ["generate-key.system.api-user"] or selector_url in [
1800 "system/api-user/generate-key"
1801 ]:
1802 request_headers = {"X-Admin-Passwd": True}
1803
1804 resp = fos.monitor_post(
1805 selector_url, vdom=params["vdom"], data=selector_params, headers=request_headers
1806 )
1807
1808 return not is_successful_status(resp), False, resp
1809
1810
1811 def main():
1812 fields = {
1813 "access_token": {"required": False, "type": "str", "no_log": True},
1814 "vdom": {"required": False, "type": "str", "default": "root"},
1815 "enable_log": {"required": False, "type": "bool", "default": False},
1816 "params": {"required": False, "type": "dict"},
1817 "selector": {
1818 "required": True,
1819 "type": "str",
1820 "choices": [
1821 "check.endpoint-control.registration-password",
1822 "quarantine.endpoint-control.registration",
1823 "unquarantine.endpoint-control.registration",
1824 "block.endpoint-control.registration",
1825 "unblock.endpoint-control.registration",
1826 "deregister.endpoint-control.registration",
1827 "clear_counters.firewall.acl",
1828 "clear_counters.firewall.acl6",
1829 "reset.firewall.policy",
1830 "clear_counters.firewall.policy",
1831 "reset.firewall.policy6",
1832 "clear_counters.firewall.policy6",
1833 "clear_counters.firewall.proxy-policy",
1834 "clear_all.firewall.session",
1835 "close.firewall.session",
1836 "reset.firewall.shaper",
1837 "reset.firewall.per-ip-shaper",
1838 "cancel.fortiview.session",
1839 "upgrade.license.database",
1840 "reset.log.stats",
1841 "login.registration.forticloud",
1842 "create.registration.forticloud",
1843 "logout.registration.forticloud",
1844 "login.registration.forticare",
1845 "create.registration.forticare",
1846 "add-license.registration.forticare",
1847 "add-license.registration.vdom",
1848 "toggle-vdom-mode.system.admin",
1849 "generate-key.system.api-user",
1850 "update-comments.system.config-revision",
1851 "delete.system.config-revision",
1852 "save.system.config-revision",
1853 "system.disconnect-admins",
1854 "set.system.time",
1855 "reboot.system.os",
1856 "shutdown.system.os",
1857 "revoke.system.dhcp",
1858 "revoke.system.dhcp6",
1859 "upgrade.system.firmware",
1860 "start.system.fsck",
1861 "system.change-password",
1862 "system.password-policy-conform",
1863 "reset.system.modem",
1864 "connect.system.modem",
1865 "disconnect.system.modem",
1866 "update.system.modem",
1867 "restart.system.sniffer",
1868 "start.system.sniffer",
1869 "stop.system.sniffer",
1870 "test.system.automation-stitch",
1871 "update.switch-controller.managed-switch",
1872 "restart.switch-controller.managed-switch",
1873 "poe-reset.switch-controller.managed-switch",
1874 "factory-reset.switch-controller.managed-switch",
1875 "download.switch-controller.fsw-firmware",
1876 "push.switch-controller.fsw-firmware",
1877 "upload.switch-controller.fsw-firmware",
1878 "dhcp-renew.system.interface",
1879 "start.system.usb-log",
1880 "stop.system.usb-log",
1881 "eject.system.usb-device",
1882 "update.system.fortiguard",
1883 "clear-statistics.system.fortiguard",
1884 "test-availability.system.fortiguard",
1885 "config.system.fortimanager",
1886 "backup-action.system.fortimanager",
1887 "dump.system.com-log",
1888 "update.system.ha-peer",
1889 "disconnect.system.ha-peer",
1890 "run.system.compliance",
1891 "restore.system.config",
1892 "upload.system.vmlicense",
1893 "trigger.system.security-rating",
1894 "reset.extender-controller.extender",
1895 "validate-gcp-key.system.sdn-connector",
1896 "deauth.user.firewall",
1897 "clear_users.user.banned",
1898 "add_users.user.banned",
1899 "clear_all.user.banned",
1900 "activate.user.fortitoken",
1901 "refresh.user.fortitoken",
1902 "provision.user.fortitoken",
1903 "send-activation.user.fortitoken",
1904 "import-trial.user.fortitoken",
1905 "import-mobile.user.fortitoken",
1906 "import-seed.user.fortitoken",
1907 "refresh-server.user.fsso",
1908 "test-connect.user.radius",
1909 "test.user.tacacs-plus",
1910 "delete.webfilter.override",
1911 "reset.webfilter.category-quota",
1912 "tunnel_up.vpn.ipsec",
1913 "tunnel_down.vpn.ipsec",
1914 "tunnel_reset_stats.vpn.ipsec",
1915 "clear_tunnel.vpn.ssl",
1916 "delete.vpn.ssl",
1917 "import.vpn-certificate.ca",
1918 "import.vpn-certificate.crl",
1919 "import.vpn-certificate.local",
1920 "import.vpn-certificate.remote",
1921 "generate.vpn-certificate.csr",
1922 "reset.wanopt.history",
1923 "reset.wanopt.webcache",
1924 "reset.wanopt.peer_stats",
1925 "reset.webcache.stats",
1926 "set_status.wifi.managed_ap",
1927 "download.wifi.firmware",
1928 "push.wifi.firmware",
1929 "upload.wifi.firmware",
1930 "restart.wifi.managed_ap",
1931 "reset.wifi.euclid",
1932 "clear_all.wifi.rogue_ap",
1933 "set_status.wifi.rogue_ap",
1934 "reset.firewall.consolidated-policy",
1935 "clear_counters.firewall.consolidated-policy",
1936 "clear_counters.firewall.security-policy",
1937 "add.firewall.clearpass-address",
1938 "delete.firewall.clearpass-address",
1939 "delete.log.local-report",
1940 "migrate.registration.forticloud",
1941 "change-vdom-mode.system.admin",
1942 "delete.system.config-script",
1943 "run.system.config-script",
1944 "upload.system.config-script",
1945 "diagnose.extender-controller.extender",
1946 "upgrade.extender-controller.extender",
1947 "add.nsx.service",
1948 "update.system.sdn-connector",
1949 "import.web-ui.language",
1950 "create.web-ui.custom-language",
1951 "update.web-ui.custom-language",
1952 "email.user.guest",
1953 "sms.user.guest",
1954 "utm.rating-lookup",
1955 "connect.wifi.network",
1956 "scan.wifi.network",
1957 "upload.wifi.region-image",
1958 "refresh.azure.application-list",
1959 "verify-cert.endpoint-control.ems",
1960 "geoip.geoip-query",
1961 "transfer.registration.forticare",
1962 "register-device.registration.forticloud",
1963 "register-appliance.system.csf",
1964 "clear.system.sniffer",
1965 "webhook.system.automation-stitch",
1966 "format.system.logdisk",
1967 "speed-test-trigger.system.interface",
1968 "read-info.system.certificate",
1969 "provision-user.vpn.ssl",
1970 "upload.webproxy.pacfile",
1971 "disassociate.wifi.client",
1972 "start.wifi.spectrum",
1973 "keep-alive.wifi.spectrum",
1974 "stop.wifi.spectrum",
1975 "start.wifi.vlan-probe",
1976 "stop.wifi.vlan-probe",
1977 "generate-keys.wifi.ssid",
1978 "save.system.config",
1979 "led-blink.wifi.managed_ap",
1980 "auth.user.firewall",
1981 "remove.user.device",
1982 "clear.vpn.ike",
1983 "reset.firewall.multicast-policy",
1984 "reset.firewall.multicast-policy6",
1985 "clear_counters.firewall.multicast-policy",
1986 "clear_counters.firewall.multicast-policy6",
1987 "clear-soft-in.router.bgp",
1988 "clear-soft-out.router.bgp",
1989 "enable-app-bandwidth-tracking.system.traffic-history",
1990 "refresh.system.external-resource",
1991 "reset.firewall.central-snat-map",
1992 "clear-counters.firewall.central-snat-map",
1993 "reset.firewall.dnat",
1994 "clear-counters.firewall.dnat",
1995 "close-multiple.firewall.session",
1996 "close-multiple.firewall.session6",
1997 "close-all.firewall.session",
1998 "clear.system.crash-log",
1999 "backup.system.config",
2000 "abort.user.query",
2001 "create.vpn-certificate.local",
2002 "flush.firewall.gtp",
2003 "kill.system.process",
2004 "upload.system.hscalefw-license",
2005 "download.system.vmlicense",
2006 "start.network.debug-flow",
2007 "stop.network.debug-flow",
2008 "upload.system.lte-modem",
2009 "upgrade.system.lte-modem",
2010 "port-stats-reset.switch-controller.managed-switch",
2011 "bounce-port.switch-controller.managed-switch",
2012 "set-tier1.switch-controller.mclag-icl",
2013 "wake-on-lan.system.interface",
2014 "manual-update.system.fortiguard",
2015 "purdue-level.user.device",
2016 "deregister-device.registration.forticare",
2017 "soft-reset-neighbor.router.bgp",
2018 "download-eval.system.vmlicense",
2019 "dynamic.system.external-resource",
2020 "pse-config.switch-controller.recommendation",
2021 "update.switch-controller.isl-lockdown",
2022 "clear-counters.firewall.ztna-firewall-policy",
2023 "update.forticonverter.eligibility",
2024 "create.forticonverter.ticket",
2025 "update.forticonverter.sn-list",
2026 "upload.forticonverter.config",
2027 "update.forticonverter.intf-list",
2028 "forticonverter.set-source-sn",
2029 "submit.forticonverter.intf-mapping",
2030 "submit.forticonverter.mgmt-intf",
2031 "submit.forticonverter.notes",
2032 "submit.forticonverter.ticket",
2033 "update.forticonverter.submitted-info",
2034 "start.forticonverter.download",
2035 "trial.user.fortitoken-cloud",
2036 "unverify-cert.endpoint-control.ems",
2037 "update-global-label.firewall.policy",
2038 "update-global-label.firewall.security-policy",
2039 "set-tier-plus.switch-controller.mclag-icl",
2040 "user.password-policy-conform",
2041 "change-password.user.local",
2042 "report.sdwan.link-monitor-metrics",
2043 "generic-address.system.external-resource",
2044 "set.system.private-data-encryption",
2045 "create-default.wifi.ap-profile",
2046 ],
2047 },
2048 }
2049
2050 module = AnsibleModule(argument_spec=fields, supports_check_mode=False)
2051 check_legacy_fortiosapi(module)
2052
2053 is_error = False
2054 has_changed = False
2055 result = None
2056
2057 versions_check_result = None
2058 if module._socket_path:
2059 connection = Connection(module._socket_path)
2060 # Checking system status prevents upload.system.vmlicense from uploading a licence to a newly installed machine.
2061 connection.set_custom_option("check_system_status", False)
2062
2063 if "access_token" in module.params:
2064 connection.set_custom_option("access_token", module.params["access_token"])
2065
2066 # Logging for fact module could be disabled/enabled.
2067 if "enable_log" in module.params:
2068 connection.set_custom_option("enable_log", module.params["enable_log"])
2069 else:
2070 connection.set_custom_option("enable_log", False)
2071
2072 fos = FortiOSHandler(connection, module)
2073
2074 is_error, has_changed, result = fortios_monitor(fos)
2075 else:
2076 module.fail_json(**FAIL_SOCKET_MSG)
2077
2078 if versions_check_result and versions_check_result["matched"] is False:
2079 module.warn(
2080 "Ansible has detected version mismatch between FortOS system and galaxy, see more details by specifying option -vvv"
2081 )
2082
2083 if not is_error:
2084 if versions_check_result and versions_check_result["matched"] is False:
2085 module.exit_json(
2086 changed=has_changed,
2087 version_check_warning=versions_check_result,
2088 meta=result,
2089 )
2090 else:
2091 module.exit_json(changed=has_changed, meta=result)
2092 else:
2093 if versions_check_result and versions_check_result["matched"] is False:
2094 module.fail_json(
2095 msg="Error in repo",
2096 version_check_warning=versions_check_result,
2097 meta=result,
2098 )
2099 else:
2100 module.fail_json(msg="Error in repo", meta=result)
2101
2102
2103 if __name__ == "__main__":
2104 main()