Debian Codegraph @

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

raw symbols SCIP
1 #!/usr/bin/python
2 from __future__ import absolute_import, division, print_function
3
4 # Copyright: (c) 2022 Fortinet
5 # GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
6 #
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
11
12 __metaclass__ = type
13
14 ANSIBLE_METADATA = {
15 "status": ["preview"],
16 "supported_by": "community",
17 "metadata_version": "1.1",
18 }
19
20 DOCUMENTATION = """
21 ---
22 module: fortios_system_sdwan
23 short_description: Configure redundant Internet connections with multiple outbound links and health-check profiles in Fortinet's FortiOS and FortiGate.
24 description:
25 - This module is able to configure a FortiGate or FortiOS (FOS) device by allowing the
26 user to set and modify system feature and sdwan category.
27 Examples include all parameters and values need to be adjusted to datasources before usage.
28 Tested with FOS v6.0.0
29 version_added: "2.0.0"
30 author:
31 - Link Zheng (@chillancezen)
32 - Jie Xue (@JieX19)
33 - Hongbin Lu (@fgtdev-hblu)
34 - Frank Shen (@frankshen01)
35 - Miguel Angel Munoz (@mamunozgonzalez)
36 - Nicolas Thomas (@thomnico)
37 notes:
38 - Legacy fortiosapi has been deprecated, httpapi is the preferred way to run playbooks
39
40 - The module supports check_mode.
41
42 requirements:
43 - ansible>=2.16
44 options:
45 access_token:
46 description:
47 - Token-based authentication.
48 Generated from GUI of Fortigate.
49 type: str
50 required: false
51 enable_log:
52 description:
53 - Enable/Disable logging for task.
54 type: bool
55 required: false
56 default: false
57 vdom:
58 description:
59 - Virtual domain, among those defined previously. A vdom is a
60 virtual instance of the FortiGate that can be configured and
61 used as a different unit.
62 type: str
63 default: root
64 member_path:
65 type: str
66 description:
67 - Member attribute path to operate on.
68 - Delimited by a slash character if there are more than one attribute.
69 - Parameter marked with member_path is legitimate for doing member operation.
70 member_state:
71 type: str
72 description:
73 - Add or delete a member under specified attribute path.
74 - When member_state is specified, the state option is ignored.
75 choices:
76 - 'present'
77 - 'absent'
78
79 system_sdwan:
80 description:
81 - Configure redundant Internet connections with multiple outbound links and health-check profiles.
82 default: null
83 type: dict
84 suboptions:
85 app_perf_log_period:
86 description:
87 - Time interval in seconds that application performance logs are generated (0 - 3600).
88 type: int
89 duplication:
90 description:
91 - Create SD-WAN duplication rule.
92 type: list
93 elements: dict
94 suboptions:
95 dstaddr:
96 description:
97 - Destination address or address group names.
98 type: list
99 elements: dict
100 suboptions:
101 name:
102 description:
103 - Address or address group name. Source firewall.address.name firewall.addrgrp.name.
104 required: true
105 type: str
106 dstaddr6:
107 description:
108 - Destination address6 or address6 group names.
109 type: list
110 elements: dict
111 suboptions:
112 name:
113 description:
114 - Address6 or address6 group name. Source firewall.address6.name firewall.addrgrp6.name.
115 required: true
116 type: str
117 dstintf:
118 description:
119 - Outgoing (egress) interfaces or zones.
120 type: list
121 elements: dict
122 suboptions:
123 name:
124 description:
125 - Interface, zone or SDWAN zone name. Source system.interface.name system.zone.name system.sdwan.zone.name.
126 required: true
127 type: str
128 id:
129 description:
130 - Duplication rule ID (1 - 255). see <a href='#notes'>Notes</a>.
131 required: true
132 type: int
133 packet_de_duplication:
134 description:
135 - Enable/disable discarding of packets that have been duplicated.
136 type: str
137 choices:
138 - 'enable'
139 - 'disable'
140 packet_duplication:
141 description:
142 - Configure packet duplication method.
143 type: str
144 choices:
145 - 'disable'
146 - 'force'
147 - 'on-demand'
148 service:
149 description:
150 - Service and service group name.
151 type: list
152 elements: dict
153 suboptions:
154 name:
155 description:
156 - Service and service group name. Source firewall.service.custom.name firewall.service.group.name.
157 required: true
158 type: str
159 service_id:
160 description:
161 - SD-WAN service rule ID list.
162 type: list
163 elements: dict
164 suboptions:
165 id:
166 description:
167 - SD-WAN service rule ID. see <a href='#notes'>Notes</a>. Source system.sdwan.service.id.
168 required: true
169 type: int
170 sla_match_service:
171 description:
172 - Enable/disable packet duplication matching health-check SLAs in service rule.
173 type: str
174 choices:
175 - 'enable'
176 - 'disable'
177 srcaddr:
178 description:
179 - Source address or address group names.
180 type: list
181 elements: dict
182 suboptions:
183 name:
184 description:
185 - Address or address group name. Source firewall.address.name firewall.addrgrp.name.
186 required: true
187 type: str
188 srcaddr6:
189 description:
190 - Source address6 or address6 group names.
191 type: list
192 elements: dict
193 suboptions:
194 name:
195 description:
196 - Address6 or address6 group name. Source firewall.address6.name firewall.addrgrp6.name.
197 required: true
198 type: str
199 srcintf:
200 description:
201 - Incoming (ingress) interfaces or zones.
202 type: list
203 elements: dict
204 suboptions:
205 name:
206 description:
207 - Interface, zone or SDWAN zone name. Source system.interface.name system.zone.name system.sdwan.zone.name.
208 required: true
209 type: str
210 duplication_max_discrepancy:
211 description:
212 - Maximum discrepancy between two packets for deduplication in milliseconds (250 - 1000).
213 type: int
214 duplication_max_num:
215 description:
216 - Maximum number of interface members a packet is duplicated in the SD-WAN zone (2 - 4).
217 type: int
218 fail_alert_interfaces:
219 description:
220 - Physical interfaces that will be alerted.
221 type: list
222 elements: dict
223 suboptions:
224 name:
225 description:
226 - Physical interface name. Source system.interface.name.
227 required: true
228 type: str
229 fail_detect:
230 description:
231 - Enable/disable SD-WAN Internet connection status checking (failure detection).
232 type: str
233 choices:
234 - 'enable'
235 - 'disable'
236 health_check:
237 description:
238 - SD-WAN status checking or health checking. Identify a server on the Internet and determine how SD-WAN verifies that the FortiGate can
239 communicate with it.
240 type: list
241 elements: dict
242 suboptions:
243 addr_mode:
244 description:
245 - Address mode (IPv4 or IPv6).
246 type: str
247 choices:
248 - 'ipv4'
249 - 'ipv6'
250 agent_probe_timeout:
251 description:
252 - Time to wait before a probe packet is considered lost when detect-mode is agent (5000 - 3600*1000 msec).
253 type: int
254 bandwidth_weight:
255 description:
256 - Coefficient of reciprocal of available bidirectional bandwidth in the formula of custom-profile-1.
257 type: int
258 class_id:
259 description:
260 - Traffic class ID. Source firewall.traffic-class.class-id.
261 type: int
262 detect_mode:
263 description:
264 - The mode determining how to detect the server.
265 type: str
266 choices:
267 - 'active'
268 - 'passive'
269 - 'prefer-passive'
270 - 'remote'
271 - 'agent-based'
272 diffservcode:
273 description:
274 - Differentiated services code point (DSCP) in the IP header of the probe packet.
275 type: str
276 dns_match_ip:
277 description:
278 - Response IP expected from DNS server if the protocol is DNS.
279 type: str
280 dns_request_domain:
281 description:
282 - Fully qualified domain name to resolve for the DNS probe.
283 type: str
284 embed_measured_health:
285 description:
286 - Enable/disable embedding measured health information.
287 type: str
288 choices:
289 - 'enable'
290 - 'disable'
291 failtime:
292 description:
293 - Number of failures before server is considered lost (1 - 3600).
294 type: int
295 fortiguard:
296 description:
297 - Enable/disable use of FortiGuard predefined server.
298 type: str
299 choices:
300 - 'disable'
301 - 'enable'
302 fortiguard_name:
303 description:
304 - Predefined health-check target name. Source system.health-check-fortiguard.name.
305 type: str
306 ftp_file:
307 description:
308 - Full path and file name on the FTP server to download for FTP health-check to probe.
309 type: str
310 ftp_mode:
311 description:
312 - FTP mode.
313 type: str
314 choices:
315 - 'passive'
316 - 'port'
317 ha_priority:
318 description:
319 - HA election priority (1 - 50).
320 type: int
321 http_agent:
322 description:
323 - String in the http-agent field in the HTTP header.
324 type: str
325 http_get:
326 description:
327 - URL used to communicate with the server if the protocol if the protocol is HTTP.
328 type: str
329 http_match:
330 description:
331 - Response string expected from the server if the protocol is HTTP.
332 type: str
333 interval:
334 description:
335 - Status check interval in milliseconds, or the time between attempting to connect to the server (20 - 3600*1000 msec).
336 type: int
337 jitter_weight:
338 description:
339 - Coefficient of jitter in the formula of custom-profile-1.
340 type: int
341 latency_weight:
342 description:
343 - Coefficient of latency in the formula of custom-profile-1.
344 type: int
345 members:
346 description:
347 - Member sequence number list.
348 type: list
349 elements: dict
350 suboptions:
351 seq_num:
352 description:
353 - Member sequence number. see <a href='#notes'>Notes</a>. Source system.sdwan.members.seq-num.
354 required: true
355 type: int
356 mos_codec:
357 description:
358 - Codec to use for MOS calculation .
359 type: str
360 choices:
361 - 'g711'
362 - 'g722'
363 - 'g729'
364 name:
365 description:
366 - Status check or health check name.
367 required: true
368 type: str
369 packet_loss_weight:
370 description:
371 - Coefficient of packet-loss in the formula of custom-profile-1.
372 type: int
373 packet_size:
374 description:
375 - Packet size of a TWAMP test session. (124/158 - 1024)
376 type: int
377 password:
378 description:
379 - TWAMP controller password in authentication mode.
380 type: str
381 port:
382 description:
383 - 'Port number used to communicate with the server over the selected protocol (0 - 65535).'
384 type: int
385 probe_count:
386 description:
387 - Number of most recent probes that should be used to calculate latency and jitter (5 - 30).
388 type: int
389 probe_packets:
390 description:
391 - Enable/disable transmission of probe packets.
392 type: str
393 choices:
394 - 'disable'
395 - 'enable'
396 probe_timeout:
397 description:
398 - Time to wait before a probe packet is considered lost (20 - 3600*1000 msec).
399 type: int
400 protocol:
401 description:
402 - Protocol used to determine if the FortiGate can communicate with the server.
403 type: str
404 choices:
405 - 'ping'
406 - 'tcp-echo'
407 - 'udp-echo'
408 - 'http'
409 - 'https'
410 - 'twamp'
411 - 'dns'
412 - 'tcp-connect'
413 - 'ftp'
414 - 'ping6'
415 quality_measured_method:
416 description:
417 - Method to measure the quality of tcp-connect.
418 type: str
419 choices:
420 - 'half-open'
421 - 'half-close'
422 recoverytime:
423 description:
424 - Number of successful responses received before server is considered recovered (1 - 3600).
425 type: int
426 remote_probe_timeout:
427 description:
428 - Time to wait before a probe packet is considered lost when detect-mode is remote (20 - 3600*1000 msec).
429 type: int
430 security_mode:
431 description:
432 - Twamp controller security mode.
433 type: str
434 choices:
435 - 'none'
436 - 'authentication'
437 server:
438 description:
439 - IP address or FQDN name of the server.
440 type: list
441 elements: str
442 sla:
443 description:
444 - Service level agreement (SLA).
445 type: list
446 elements: dict
447 suboptions:
448 custom_profile_threshold:
449 description:
450 - Custom profile threshold for SLA to be marked as pass(0 - 10000000).
451 type: int
452 id:
453 description:
454 - SLA ID. see <a href='#notes'>Notes</a>.
455 required: true
456 type: int
457 jitter_threshold:
458 description:
459 - Jitter for SLA to make decision in milliseconds. (0 - 10000000).
460 type: int
461 latency_threshold:
462 description:
463 - Latency for SLA to make decision in milliseconds. (0 - 10000000).
464 type: int
465 link_cost_factor:
466 description:
467 - Criteria on which to base link selection.
468 type: list
469 elements: str
470 choices:
471 - 'latency'
472 - 'jitter'
473 - 'packet-loss'
474 - 'custom-profile-1'
475 - 'mos'
476 - 'remote'
477 mos_threshold:
478 description:
479 - Minimum mean opinion score for SLA to be marked as pass(1.0 - 5.0).
480 type: str
481 packetloss_threshold:
482 description:
483 - Packet loss for SLA to make decision in percentage. (0 - 100).
484 type: int
485 priority_in_sla:
486 description:
487 - Value to be distributed into routing table when in-sla (0 - 65535).
488 type: int
489 priority_out_sla:
490 description:
491 - Value to be distributed into routing table when out-sla (0 - 65535).
492 type: int
493 sla_fail_log_period:
494 description:
495 - Time interval in seconds that SLA fail log messages will be generated (0 - 3600).
496 type: int
497 sla_id_redistribute:
498 description:
499 - Select the ID from the SLA sub-table. The selected SLA"s priority value will be distributed into the routing table (0 - 32).
500 type: int
501 sla_pass_log_period:
502 description:
503 - Time interval in seconds that SLA pass log messages will be generated (0 - 3600).
504 type: int
505 source:
506 description:
507 - Source IP address used in the health-check packet to the server.
508 type: str
509 source6:
510 description:
511 - Source IPv6 address used in the health-check packet to server.
512 type: str
513 system_dns:
514 description:
515 - Enable/disable system DNS as the probe server.
516 type: str
517 choices:
518 - 'disable'
519 - 'enable'
520 threshold_alert_jitter:
521 description:
522 - Alert threshold for jitter (ms).
523 type: int
524 threshold_alert_latency:
525 description:
526 - Alert threshold for latency (ms).
527 type: int
528 threshold_alert_packetloss:
529 description:
530 - Alert threshold for packet loss (percentage).
531 type: int
532 threshold_warning_jitter:
533 description:
534 - Warning threshold for jitter (ms).
535 type: int
536 threshold_warning_latency:
537 description:
538 - Warning threshold for latency (ms).
539 type: int
540 threshold_warning_packetloss:
541 description:
542 - Warning threshold for packet loss (percentage).
543 type: int
544 update_bgp_route:
545 description:
546 - Enable/disable updating the BGP route.
547 type: str
548 choices:
549 - 'enable'
550 - 'disable'
551 update_cascade_interface:
552 description:
553 - Enable/disable update cascade interface.
554 type: str
555 choices:
556 - 'enable'
557 - 'disable'
558 update_static_route:
559 description:
560 - Enable/disable updating the static route.
561 type: str
562 choices:
563 - 'enable'
564 - 'disable'
565 user:
566 description:
567 - The user name to access probe server.
568 type: str
569 vrf:
570 description:
571 - Virtual Routing Forwarding ID.
572 type: int
573 health_check_fortiguard:
574 description:
575 - SD-WAN status checking or health checking. Identify a server predefine by FortiGuard and determine how SD-WAN verifies that FGT can
576 communicate with it.
577 type: list
578 elements: dict
579 suboptions:
580 addr_mode:
581 description:
582 - Address mode (IPv4 or IPv6).
583 type: str
584 choices:
585 - 'ipv4'
586 - 'ipv6'
587 class_id:
588 description:
589 - Traffic class ID. Source firewall.traffic-class.class-id.
590 type: int
591 detect_mode:
592 description:
593 - The mode determining how to detect the server.
594 type: str
595 choices:
596 - 'active'
597 - 'passive'
598 - 'prefer-passive'
599 - 'remote'
600 - 'agent-based'
601 diffservcode:
602 description:
603 - Differentiated services code point (DSCP) in the IP header of the probe packet.
604 type: str
605 dns_match_ip:
606 description:
607 - Response IP expected from DNS server if the protocol is DNS.
608 type: str
609 dns_request_domain:
610 description:
611 - Fully qualified domain name to resolve for the DNS probe.
612 type: str
613 embed_measured_health:
614 description:
615 - Enable/disable embedding measured health information.
616 type: str
617 choices:
618 - 'enable'
619 - 'disable'
620 failtime:
621 description:
622 - Number of failures before server is considered lost (1 - 3600).
623 type: int
624 ftp_file:
625 description:
626 - Full path and file name on the FTP server to download for FTP health-check to probe.
627 type: str
628 ftp_mode:
629 description:
630 - FTP mode.
631 type: str
632 choices:
633 - 'passive'
634 - 'port'
635 ha_priority:
636 description:
637 - HA election priority (1 - 50).
638 type: int
639 http_agent:
640 description:
641 - String in the http-agent field in the HTTP header.
642 type: str
643 http_get:
644 description:
645 - URL used to communicate with the server if the protocol if the protocol is HTTP.
646 type: str
647 http_match:
648 description:
649 - Response string expected from the server if the protocol is HTTP.
650 type: str
651 interval:
652 description:
653 - Status check interval in milliseconds, or the time between attempting to connect to the server (20 - 3600*1000 msec).
654 type: int
655 members:
656 description:
657 - Member sequence number list.
658 type: list
659 elements: dict
660 suboptions:
661 seq_num:
662 description:
663 - Member sequence number. see <a href='#notes'>Notes</a>. Source system.sdwan.members.seq-num.
664 required: true
665 type: int
666 mos_codec:
667 description:
668 - Codec to use for MOS calculation .
669 type: str
670 choices:
671 - 'g711'
672 - 'g722'
673 - 'g729'
674 packet_size:
675 description:
676 - Packet size of a TWAMP test session. (124/158 - 1024)
677 type: int
678 password:
679 description:
680 - TWAMP controller password in authentication mode.
681 type: str
682 port:
683 description:
684 - 'Port number used to communicate with the server over the selected protocol (0 - 65535).'
685 type: int
686 probe_count:
687 description:
688 - Number of most recent probes that should be used to calculate latency and jitter (5 - 30).
689 type: int
690 probe_packets:
691 description:
692 - Enable/disable transmission of probe packets.
693 type: str
694 choices:
695 - 'disable'
696 - 'enable'
697 probe_timeout:
698 description:
699 - Time to wait before a probe packet is considered lost (20 - 3600*1000 msec).
700 type: int
701 protocol:
702 description:
703 - Protocol used to determine if the FortiGate can communicate with the server.
704 type: str
705 choices:
706 - 'ping'
707 - 'tcp-echo'
708 - 'udp-echo'
709 - 'http'
710 - 'https'
711 - 'twamp'
712 - 'dns'
713 - 'tcp-connect'
714 - 'ftp'
715 quality_measured_method:
716 description:
717 - Method to measure the quality of tcp-connect.
718 type: str
719 choices:
720 - 'half-open'
721 - 'half-close'
722 recoverytime:
723 description:
724 - Number of successful responses received before server is considered recovered (1 - 3600).
725 type: int
726 security_mode:
727 description:
728 - Twamp controller security mode.
729 type: str
730 choices:
731 - 'none'
732 - 'authentication'
733 server:
734 description:
735 - Predefined IP address or FQDN name from FortiGuard.
736 type: list
737 elements: str
738 sla:
739 description:
740 - Service level agreement (SLA).
741 type: list
742 elements: dict
743 suboptions:
744 id:
745 description:
746 - SLA ID. see <a href='#notes'>Notes</a>.
747 required: true
748 type: int
749 jitter_threshold:
750 description:
751 - Jitter for SLA to make decision in milliseconds. (0 - 10000000).
752 type: int
753 latency_threshold:
754 description:
755 - Latency for SLA to make decision in milliseconds. (0 - 10000000).
756 type: int
757 link_cost_factor:
758 description:
759 - Criteria on which to base link selection.
760 type: list
761 elements: str
762 choices:
763 - 'latency'
764 - 'jitter'
765 - 'packet-loss'
766 - 'mos'
767 - 'remote'
768 mos_threshold:
769 description:
770 - Minimum Mean Opinion Score for SLA to be marked as pass. (1.0 - 5.0).
771 type: str
772 packetloss_threshold:
773 description:
774 - Packet loss for SLA to make decision in percentage. (0 - 100).
775 type: int
776 priority_in_sla:
777 description:
778 - Value to be distributed into routing table when in-sla (0 - 65535).
779 type: int
780 priority_out_sla:
781 description:
782 - Value to be distributed into routing table when out-sla (0 - 65535).
783 type: int
784 sla_fail_log_period:
785 description:
786 - Time interval in seconds that SLA fail log messages will be generated (0 - 3600).
787 type: int
788 sla_id_redistribute:
789 description:
790 - Select the ID from the SLA sub-table. The selected SLA"s priority value will be distributed into the routing table (0 - 32).
791 type: int
792 sla_pass_log_period:
793 description:
794 - Time interval in seconds that SLA pass log messages will be generated (0 - 3600).
795 type: int
796 source:
797 description:
798 - Source IP address used in the health-check packet to the server.
799 type: str
800 source6:
801 description:
802 - Source IPv6 address used in the health-check packet to server.
803 type: str
804 system_dns:
805 description:
806 - Enable/disable system DNS as the probe server.
807 type: str
808 choices:
809 - 'disable'
810 - 'enable'
811 target_name:
812 description:
813 - Status check or predefined health-check targets name.
814 required: true
815 type: str
816 threshold_alert_jitter:
817 description:
818 - Alert threshold for jitter (ms).
819 type: int
820 threshold_alert_latency:
821 description:
822 - Alert threshold for latency (ms).
823 type: int
824 threshold_alert_packetloss:
825 description:
826 - Alert threshold for packet loss (percentage).
827 type: int
828 threshold_warning_jitter:
829 description:
830 - Warning threshold for jitter (ms).
831 type: int
832 threshold_warning_latency:
833 description:
834 - Warning threshold for latency (ms).
835 type: int
836 threshold_warning_packetloss:
837 description:
838 - Warning threshold for packet loss (percentage).
839 type: int
840 update_cascade_interface:
841 description:
842 - Enable/disable update cascade interface.
843 type: str
844 choices:
845 - 'enable'
846 - 'disable'
847 update_static_route:
848 description:
849 - Enable/disable updating the static route.
850 type: str
851 choices:
852 - 'enable'
853 - 'disable'
854 user:
855 description:
856 - The user name to access probe server.
857 type: str
858 vrf:
859 description:
860 - Virtual Routing Forwarding ID.
861 type: int
862 load_balance_mode:
863 description:
864 - Algorithm or mode to use for load balancing Internet traffic to SD-WAN members.
865 type: str
866 choices:
867 - 'source-ip-based'
868 - 'weight-based'
869 - 'usage-based'
870 - 'source-dest-ip-based'
871 - 'measured-volume-based'
872 members:
873 description:
874 - FortiGate interfaces added to the SD-WAN.
875 type: list
876 elements: dict
877 suboptions:
878 comment:
879 description:
880 - Comments.
881 type: str
882 cost:
883 description:
884 - Cost of this interface for services in SLA mode (0 - 4294967295).
885 type: int
886 gateway:
887 description:
888 - The default gateway for this interface. Usually the default gateway of the Internet service provider that this interface is
889 connected to.
890 type: str
891 gateway6:
892 description:
893 - IPv6 gateway.
894 type: str
895 ingress_spillover_threshold:
896 description:
897 - Ingress spillover threshold for this interface (0 - 16776000 kbit/s). When this traffic volume threshold is reached, new
898 sessions spill over to other interfaces in the SD-WAN.
899 type: int
900 interface:
901 description:
902 - Interface name. Source system.interface.name.
903 type: str
904 preferred_source:
905 description:
906 - Preferred source of route for this member.
907 type: str
908 priority:
909 description:
910 - Priority of the interface for IPv4 (1 - 65535). Used for SD-WAN rules or priority rules.
911 type: int
912 priority_in_sla:
913 description:
914 - Preferred priority of routes to this member when this member is in-sla (0 - 65535).
915 type: int
916 priority_out_sla:
917 description:
918 - Preferred priority of routes to this member when this member is out-of-sla (0 - 65535).
919 type: int
920 priority6:
921 description:
922 - Priority of the interface for IPv6 (1 - 65535). Used for SD-WAN rules or priority rules.
923 type: int
924 seq_num:
925 description:
926 - Sequence number(1-512). see <a href='#notes'>Notes</a>.
927 required: true
928 type: int
929 source:
930 description:
931 - Source IP address used in the health-check packet to the server.
932 type: str
933 source6:
934 description:
935 - Source IPv6 address used in the health-check packet to the server.
936 type: str
937 spillover_threshold:
938 description:
939 - Egress spillover threshold for this interface (0 - 16776000 kbit/s). When this traffic volume threshold is reached, new sessions
940 spill over to other interfaces in the SD-WAN.
941 type: int
942 status:
943 description:
944 - Enable/disable this interface in the SD-WAN.
945 type: str
946 choices:
947 - 'disable'
948 - 'enable'
949 transport_group:
950 description:
951 - Measured transport group (0 - 255).
952 type: int
953 volume_ratio:
954 description:
955 - Measured volume ratio (this value / sum of all values = percentage of link volume, 1 - 255).
956 type: int
957 weight:
958 description:
959 - Weight of this interface for weighted load balancing. (1 - 255) More traffic is directed to interfaces with higher weights.
960 type: int
961 zone:
962 description:
963 - Zone name. Source system.sdwan.zone.name.
964 type: str
965 neighbor:
966 description:
967 - Create SD-WAN neighbor from BGP neighbor table to control route advertisements according to SLA status.
968 type: list
969 elements: dict
970 suboptions:
971 health_check:
972 description:
973 - SD-WAN health-check name. Source system.sdwan.health-check.name.
974 type: str
975 ip:
976 description:
977 - IP/IPv6 address of neighbor or neighbor-group name. Source router.bgp.neighbor-group.name router.bgp.neighbor.ip.
978 required: true
979 type: str
980 member:
981 description:
982 - Member sequence number list. Source system.sdwan.members.seq-num.
983 type: list
984 elements: dict
985 suboptions:
986 seq_num:
987 description:
988 - Member sequence number. see <a href='#notes'>Notes</a>. Source system.sdwan.members.seq-num.
989 required: true
990 type: int
991 minimum_sla_meet_members:
992 description:
993 - Minimum number of members which meet SLA when the neighbor is preferred.
994 type: int
995 mode:
996 description:
997 - What metric to select the neighbor.
998 type: str
999 choices:
1000 - 'sla'
1001 - 'speedtest'
1002 role:
1003 description:
1004 - Role of neighbor.
1005 type: str
1006 choices:
1007 - 'standalone'
1008 - 'primary'
1009 - 'secondary'
1010 route_metric:
1011 description:
1012 - Route-metric of neighbor.
1013 type: str
1014 choices:
1015 - 'preferable'
1016 - 'priority'
1017 service_id:
1018 description:
1019 - SD-WAN service ID to work with the neighbor. Source system.sdwan.service.id.
1020 type: int
1021 sla_id:
1022 description:
1023 - SLA ID.
1024 type: int
1025 neighbor_hold_boot_time:
1026 description:
1027 - Waiting period in seconds when switching from the primary neighbor to the secondary neighbor from the neighbor start. (0 - 10000000).
1028 type: int
1029 neighbor_hold_down:
1030 description:
1031 - Enable/disable hold switching from the secondary neighbor to the primary neighbor.
1032 type: str
1033 choices:
1034 - 'enable'
1035 - 'disable'
1036 neighbor_hold_down_time:
1037 description:
1038 - Waiting period in seconds when switching from the secondary neighbor to the primary neighbor when hold-down is disabled. (0 - 10000000).
1039 type: int
1040 service:
1041 description:
1042 - Create SD-WAN rules (also called services) to control how sessions are distributed to interfaces in the SD-WAN.
1043 type: list
1044 elements: dict
1045 suboptions:
1046 addr_mode:
1047 description:
1048 - Address mode (IPv4 or IPv6).
1049 type: str
1050 choices:
1051 - 'ipv4'
1052 - 'ipv6'
1053 agent_exclusive:
1054 description:
1055 - Set/unset the service as agent use exclusively.
1056 type: str
1057 choices:
1058 - 'enable'
1059 - 'disable'
1060 bandwidth_weight:
1061 description:
1062 - Coefficient of reciprocal of available bidirectional bandwidth in the formula of custom-profile-1.
1063 type: int
1064 comment:
1065 description:
1066 - Comments.
1067 type: str
1068 default:
1069 description:
1070 - Enable/disable use of SD-WAN as default service.
1071 type: str
1072 choices:
1073 - 'enable'
1074 - 'disable'
1075 dscp_forward:
1076 description:
1077 - Enable/disable forward traffic DSCP tag.
1078 type: str
1079 choices:
1080 - 'enable'
1081 - 'disable'
1082 dscp_forward_tag:
1083 description:
1084 - Forward traffic DSCP tag.
1085 type: str
1086 dscp_reverse:
1087 description:
1088 - Enable/disable reverse traffic DSCP tag.
1089 type: str
1090 choices:
1091 - 'enable'
1092 - 'disable'
1093 dscp_reverse_tag:
1094 description:
1095 - Reverse traffic DSCP tag.
1096 type: str
1097 dst:
1098 description:
1099 - Destination address name.
1100 type: list
1101 elements: dict
1102 suboptions:
1103 name:
1104 description:
1105 - Address or address group name. Source firewall.address.name firewall.addrgrp.name.
1106 required: true
1107 type: str
1108 dst_negate:
1109 description:
1110 - Enable/disable negation of destination address match.
1111 type: str
1112 choices:
1113 - 'enable'
1114 - 'disable'
1115 dst6:
1116 description:
1117 - Destination address6 name.
1118 type: list
1119 elements: dict
1120 suboptions:
1121 name:
1122 description:
1123 - Address6 or address6 group name. Source firewall.address6.name firewall.addrgrp6.name.
1124 required: true
1125 type: str
1126 end_port:
1127 description:
1128 - End destination port number.
1129 type: int
1130 end_src_port:
1131 description:
1132 - End source port number.
1133 type: int
1134 fib_best_match_force:
1135 description:
1136 - Enable/disable force using fib-best-match oif as outgoing interface.
1137 type: str
1138 choices:
1139 - 'disable'
1140 - 'enable'
1141 gateway:
1142 description:
1143 - Enable/disable SD-WAN service gateway.
1144 type: str
1145 choices:
1146 - 'enable'
1147 - 'disable'
1148 groups:
1149 description:
1150 - User groups.
1151 type: list
1152 elements: dict
1153 suboptions:
1154 name:
1155 description:
1156 - Group name. Source user.group.name.
1157 required: true
1158 type: str
1159 hash_mode:
1160 description:
1161 - Hash algorithm for selected priority members for load balance mode.
1162 type: str
1163 choices:
1164 - 'round-robin'
1165 - 'source-ip-based'
1166 - 'source-dest-ip-based'
1167 - 'inbandwidth'
1168 - 'outbandwidth'
1169 - 'bibandwidth'
1170 health_check:
1171 description:
1172 - Health check list.
1173 type: list
1174 elements: dict
1175 suboptions:
1176 name:
1177 description:
1178 - Health check name. Source system.sdwan.health-check.name.
1179 required: true
1180 type: str
1181 hold_down_time:
1182 description:
1183 - Waiting period in seconds when switching from the back-up member to the primary member (0 - 10000000).
1184 type: int
1185 id:
1186 description:
1187 - SD-WAN rule ID (1 - 4000). see <a href='#notes'>Notes</a>.
1188 required: true
1189 type: int
1190 input_device:
1191 description:
1192 - Source interface name.
1193 type: list
1194 elements: dict
1195 suboptions:
1196 name:
1197 description:
1198 - Interface name. Source system.interface.name.
1199 required: true
1200 type: str
1201 input_device_negate:
1202 description:
1203 - Enable/disable negation of input device match.
1204 type: str
1205 choices:
1206 - 'enable'
1207 - 'disable'
1208 input_zone:
1209 description:
1210 - Source input-zone name.
1211 type: list
1212 elements: dict
1213 suboptions:
1214 name:
1215 description:
1216 - Zone. Source system.sdwan.zone.name.
1217 required: true
1218 type: str
1219 internet_service:
1220 description:
1221 - Enable/disable use of Internet service for application-based load balancing.
1222 type: str
1223 choices:
1224 - 'enable'
1225 - 'disable'
1226 internet_service_app_ctrl:
1227 description:
1228 - Application control based Internet Service ID list.
1229 type: list
1230 elements: dict
1231 suboptions:
1232 id:
1233 description:
1234 - Application control based Internet Service ID. see <a href='#notes'>Notes</a>.
1235 required: true
1236 type: int
1237 internet_service_app_ctrl_category:
1238 description:
1239 - IDs of one or more application control categories.
1240 type: list
1241 elements: dict
1242 suboptions:
1243 id:
1244 description:
1245 - Application control category ID. see <a href='#notes'>Notes</a>.
1246 required: true
1247 type: int
1248 internet_service_app_ctrl_group:
1249 description:
1250 - Application control based Internet Service group list.
1251 type: list
1252 elements: dict
1253 suboptions:
1254 name:
1255 description:
1256 - Application control based Internet Service group name. Source application.group.name.
1257 required: true
1258 type: str
1259 internet_service_custom:
1260 description:
1261 - Custom Internet service name list.
1262 type: list
1263 elements: dict
1264 suboptions:
1265 name:
1266 description:
1267 - Custom Internet service name. Source firewall.internet-service-custom.name.
1268 required: true
1269 type: str
1270 internet_service_custom_group:
1271 description:
1272 - Custom Internet Service group list.
1273 type: list
1274 elements: dict
1275 suboptions:
1276 name:
1277 description:
1278 - Custom Internet Service group name. Source firewall.internet-service-custom-group.name.
1279 required: true
1280 type: str
1281 internet_service_fortiguard:
1282 description:
1283 - FortiGuard Internet service name list.
1284 type: list
1285 elements: dict
1286 suboptions:
1287 name:
1288 description:
1289 - FortiGuard Internet service name. Source firewall.internet-service-fortiguard.name.
1290 required: true
1291 type: str
1292 internet_service_group:
1293 description:
1294 - Internet Service group list.
1295 type: list
1296 elements: dict
1297 suboptions:
1298 name:
1299 description:
1300 - Internet Service group name. Source firewall.internet-service-group.name.
1301 required: true
1302 type: str
1303 internet_service_name:
1304 description:
1305 - Internet service name list.
1306 type: list
1307 elements: dict
1308 suboptions:
1309 name:
1310 description:
1311 - Internet service name. Source firewall.internet-service-name.name.
1312 required: true
1313 type: str
1314 jitter_weight:
1315 description:
1316 - Coefficient of jitter in the formula of custom-profile-1.
1317 type: int
1318 latency_weight:
1319 description:
1320 - Coefficient of latency in the formula of custom-profile-1.
1321 type: int
1322 link_cost_factor:
1323 description:
1324 - Link cost factor.
1325 type: str
1326 choices:
1327 - 'latency'
1328 - 'jitter'
1329 - 'packet-loss'
1330 - 'inbandwidth'
1331 - 'outbandwidth'
1332 - 'bibandwidth'
1333 - 'custom-profile-1'
1334 link_cost_threshold:
1335 description:
1336 - Percentage threshold change of link cost values that will result in policy route regeneration (0 - 10000000).
1337 type: int
1338 load_balance:
1339 description:
1340 - Enable/disable load-balance.
1341 type: str
1342 choices:
1343 - 'enable'
1344 - 'disable'
1345 minimum_sla_meet_members:
1346 description:
1347 - Minimum number of members which meet SLA.
1348 type: int
1349 mode:
1350 description:
1351 - Control how the SD-WAN rule sets the priority of interfaces in the SD-WAN.
1352 type: str
1353 choices:
1354 - 'auto'
1355 - 'manual'
1356 - 'priority'
1357 - 'sla'
1358 - 'load-balance'
1359 name:
1360 description:
1361 - SD-WAN rule name.
1362 type: str
1363 packet_loss_weight:
1364 description:
1365 - Coefficient of packet-loss in the formula of custom-profile-1.
1366 type: int
1367 passive_measurement:
1368 description:
1369 - Enable/disable passive measurement based on the service criteria.
1370 type: str
1371 choices:
1372 - 'enable'
1373 - 'disable'
1374 priority_members:
1375 description:
1376 - Member sequence number list.
1377 type: list
1378 elements: dict
1379 suboptions:
1380 seq_num:
1381 description:
1382 - Member sequence number. see <a href='#notes'>Notes</a>. Source system.sdwan.members.seq-num.
1383 required: true
1384 type: int
1385 priority_zone:
1386 description:
1387 - Priority zone name list.
1388 type: list
1389 elements: dict
1390 suboptions:
1391 name:
1392 description:
1393 - Priority zone name. Source system.sdwan.zone.name.
1394 required: true
1395 type: str
1396 protocol:
1397 description:
1398 - Protocol number.
1399 type: int
1400 quality_link:
1401 description:
1402 - Quality grade.
1403 type: int
1404 role:
1405 description:
1406 - Service role to work with neighbor.
1407 type: str
1408 choices:
1409 - 'standalone'
1410 - 'primary'
1411 - 'secondary'
1412 route_tag:
1413 description:
1414 - IPv4 route map route-tag.
1415 type: int
1416 shortcut:
1417 description:
1418 - Enable/disable shortcut for this service.
1419 type: str
1420 choices:
1421 - 'enable'
1422 - 'disable'
1423 shortcut_priority:
1424 description:
1425 - High priority of ADVPN shortcut for this service.
1426 type: str
1427 choices:
1428 - 'enable'
1429 - 'disable'
1430 - 'auto'
1431 shortcut_stickiness:
1432 description:
1433 - Enable/disable shortcut-stickiness of ADVPN.
1434 type: str
1435 choices:
1436 - 'enable'
1437 - 'disable'
1438 sla:
1439 description:
1440 - Service level agreement (SLA).
1441 type: list
1442 elements: dict
1443 suboptions:
1444 health_check:
1445 description:
1446 - SD-WAN health-check. Source system.sdwan.health-check.name.
1447 required: true
1448 type: str
1449 id:
1450 description:
1451 - SLA ID.
1452 type: int
1453 sla_compare_method:
1454 description:
1455 - Method to compare SLA value for SLA mode.
1456 type: str
1457 choices:
1458 - 'order'
1459 - 'number'
1460 sla_stickiness:
1461 description:
1462 - Enable/disable SLA stickiness .
1463 type: str
1464 choices:
1465 - 'enable'
1466 - 'disable'
1467 src:
1468 description:
1469 - Source address name.
1470 type: list
1471 elements: dict
1472 suboptions:
1473 name:
1474 description:
1475 - Address or address group name. Source firewall.address.name firewall.addrgrp.name.
1476 required: true
1477 type: str
1478 src_negate:
1479 description:
1480 - Enable/disable negation of source address match.
1481 type: str
1482 choices:
1483 - 'enable'
1484 - 'disable'
1485 src6:
1486 description:
1487 - Source address6 name.
1488 type: list
1489 elements: dict
1490 suboptions:
1491 name:
1492 description:
1493 - Address6 or address6 group name. Source firewall.address6.name firewall.addrgrp6.name.
1494 required: true
1495 type: str
1496 standalone_action:
1497 description:
1498 - Enable/disable service when selected neighbor role is standalone while service role is not standalone.
1499 type: str
1500 choices:
1501 - 'enable'
1502 - 'disable'
1503 start_port:
1504 description:
1505 - Start destination port number.
1506 type: int
1507 start_src_port:
1508 description:
1509 - Start source port number.
1510 type: int
1511 status:
1512 description:
1513 - Enable/disable SD-WAN service.
1514 type: str
1515 choices:
1516 - 'enable'
1517 - 'disable'
1518 tie_break:
1519 description:
1520 - Method of selecting member if more than one meets the SLA.
1521 type: str
1522 choices:
1523 - 'zone'
1524 - 'cfg-order'
1525 - 'fib-best-match'
1526 - 'priority'
1527 - 'input-device'
1528 tos:
1529 description:
1530 - Type of service bit pattern.
1531 type: str
1532 tos_mask:
1533 description:
1534 - Type of service evaluated bits.
1535 type: str
1536 use_shortcut_sla:
1537 description:
1538 - Enable/disable use of ADVPN shortcut for quality comparison.
1539 type: str
1540 choices:
1541 - 'enable'
1542 - 'disable'
1543 users:
1544 description:
1545 - User name.
1546 type: list
1547 elements: dict
1548 suboptions:
1549 name:
1550 description:
1551 - User name. Source user.local.name.
1552 required: true
1553 type: str
1554 zone_mode:
1555 description:
1556 - Enable/disable zone mode.
1557 type: str
1558 choices:
1559 - 'enable'
1560 - 'disable'
1561 speedtest_bypass_routing:
1562 description:
1563 - Enable/disable bypass routing when speedtest on a SD-WAN member.
1564 type: str
1565 choices:
1566 - 'disable'
1567 - 'enable'
1568 status:
1569 description:
1570 - Enable/disable SD-WAN.
1571 type: str
1572 choices:
1573 - 'disable'
1574 - 'enable'
1575 zone:
1576 description:
1577 - Configure SD-WAN zones.
1578 type: list
1579 elements: dict
1580 suboptions:
1581 advpn_health_check:
1582 description:
1583 - Health check for ADVPN local overlay link quality. Source system.sdwan.health-check.name.
1584 type: str
1585 advpn_select:
1586 description:
1587 - Enable/disable selection of ADVPN based on SDWAN information.
1588 type: str
1589 choices:
1590 - 'enable'
1591 - 'disable'
1592 minimum_sla_meet_members:
1593 description:
1594 - Minimum number of members which meet SLA when the neighbor is preferred.
1595 type: int
1596 name:
1597 description:
1598 - Zone name.
1599 required: true
1600 type: str
1601 service_sla_tie_break:
1602 description:
1603 - Method of selecting member if more than one meets the SLA.
1604 type: str
1605 choices:
1606 - 'cfg-order'
1607 - 'fib-best-match'
1608 - 'priority'
1609 - 'input-device'
1610 """
1611
1612 EXAMPLES = """
1613 - name: Configure redundant Internet connections with multiple outbound links and health-check profiles.
1614 fortinet.fortios.fortios_system_sdwan:
1615 vdom: "{{ vdom }}"
1616 system_sdwan:
1617 app_perf_log_period: "0"
1618 duplication:
1619 -
1620 dstaddr:
1621 -
1622 name: "default_name_6 (source firewall.address.name firewall.addrgrp.name)"
1623 dstaddr6:
1624 -
1625 name: "default_name_8 (source firewall.address6.name firewall.addrgrp6.name)"
1626 dstintf:
1627 -
1628 name: "default_name_10 (source system.interface.name system.zone.name system.sdwan.zone.name)"
1629 id: "11"
1630 packet_de_duplication: "enable"
1631 packet_duplication: "disable"
1632 service:
1633 -
1634 name: "default_name_15 (source firewall.service.custom.name firewall.service.group.name)"
1635 service_id:
1636 -
1637 id: "17 (source system.sdwan.service.id)"
1638 sla_match_service: "enable"
1639 srcaddr:
1640 -
1641 name: "default_name_20 (source firewall.address.name firewall.addrgrp.name)"
1642 srcaddr6:
1643 -
1644 name: "default_name_22 (source firewall.address6.name firewall.addrgrp6.name)"
1645 srcintf:
1646 -
1647 name: "default_name_24 (source system.interface.name system.zone.name system.sdwan.zone.name)"
1648 duplication_max_discrepancy: "250"
1649 duplication_max_num: "2"
1650 fail_alert_interfaces:
1651 -
1652 name: "default_name_28 (source system.interface.name)"
1653 fail_detect: "enable"
1654 health_check:
1655 -
1656 addr_mode: "ipv4"
1657 agent_probe_timeout: "60000"
1658 bandwidth_weight: "0"
1659 class_id: "0"
1660 detect_mode: "active"
1661 diffservcode: "<your_own_value>"
1662 dns_match_ip: "<your_own_value>"
1663 dns_request_domain: "<your_own_value>"
1664 embed_measured_health: "enable"
1665 failtime: "5"
1666 fortiguard: "disable"
1667 fortiguard_name: "<your_own_value> (source system.health-check-fortiguard.name)"
1668 ftp_file: "<your_own_value>"
1669 ftp_mode: "passive"
1670 ha_priority: "1"
1671 http_agent: "<your_own_value>"
1672 http_get: "<your_own_value>"
1673 http_match: "<your_own_value>"
1674 interval: "500"
1675 jitter_weight: "0"
1676 latency_weight: "0"
1677 members:
1678 -
1679 seq_num: "<you_own_value>"
1680 mos_codec: "g711"
1681 name: "default_name_55"
1682 packet_loss_weight: "0"
1683 packet_size: "124"
1684 password: "<your_own_value>"
1685 port: "0"
1686 probe_count: "30"
1687 probe_packets: "disable"
1688 probe_timeout: "500"
1689 protocol: "ping"
1690 quality_measured_method: "half-open"
1691 recoverytime: "5"
1692 remote_probe_timeout: "5000"
1693 security_mode: "none"
1694 server: "192.168.100.40"
1695 sla:
1696 -
1697 custom_profile_threshold: "0"
1698 id: "71"
1699 jitter_threshold: "5"
1700 latency_threshold: "5"
1701 link_cost_factor: "latency"
1702 mos_threshold: "<your_own_value>"
1703 packetloss_threshold: "0"
1704 priority_in_sla: "0"
1705 priority_out_sla: "0"
1706 sla_fail_log_period: "0"
1707 sla_id_redistribute: "0"
1708 sla_pass_log_period: "0"
1709 source: "<your_own_value>"
1710 source6: "<your_own_value>"
1711 system_dns: "disable"
1712 threshold_alert_jitter: "0"
1713 threshold_alert_latency: "0"
1714 threshold_alert_packetloss: "0"
1715 threshold_warning_jitter: "0"
1716 threshold_warning_latency: "0"
1717 threshold_warning_packetloss: "0"
1718 update_bgp_route: "enable"
1719 update_cascade_interface: "enable"
1720 update_static_route: "enable"
1721 user: "<your_own_value>"
1722 vrf: "0"
1723 health_check_fortiguard:
1724 -
1725 addr_mode: "ipv4"
1726 class_id: "0"
1727 detect_mode: "active"
1728 diffservcode: "<your_own_value>"
1729 dns_match_ip: "<your_own_value>"
1730 dns_request_domain: "<your_own_value>"
1731 embed_measured_health: "enable"
1732 failtime: "5"
1733 ftp_file: "<your_own_value>"
1734 ftp_mode: "passive"
1735 ha_priority: "1"
1736 http_agent: "<your_own_value>"
1737 http_get: "<your_own_value>"
1738 http_match: "<your_own_value>"
1739 interval: "500"
1740 members:
1741 -
1742 seq_num: "<you_own_value>"
1743 mos_codec: "g711"
1744 packet_size: "124"
1745 password: "<your_own_value>"
1746 port: "0"
1747 probe_count: "30"
1748 probe_packets: "disable"
1749 probe_timeout: "500"
1750 protocol: "ping"
1751 quality_measured_method: "half-open"
1752 recoverytime: "5"
1753 security_mode: "none"
1754 server: "192.168.100.40"
1755 sla:
1756 -
1757 id: "127"
1758 jitter_threshold: "5"
1759 latency_threshold: "5"
1760 link_cost_factor: "latency"
1761 mos_threshold: "<your_own_value>"
1762 packetloss_threshold: "0"
1763 priority_in_sla: "0"
1764 priority_out_sla: "0"
1765 sla_fail_log_period: "0"
1766 sla_id_redistribute: "0"
1767 sla_pass_log_period: "0"
1768 source: "<your_own_value>"
1769 source6: "<your_own_value>"
1770 system_dns: "disable"
1771 target_name: "<your_own_value>"
1772 threshold_alert_jitter: "0"
1773 threshold_alert_latency: "0"
1774 threshold_alert_packetloss: "0"
1775 threshold_warning_jitter: "0"
1776 threshold_warning_latency: "0"
1777 threshold_warning_packetloss: "0"
1778 update_cascade_interface: "enable"
1779 update_static_route: "enable"
1780 user: "<your_own_value>"
1781 vrf: "0"
1782 load_balance_mode: "source-ip-based"
1783 members:
1784 -
1785 comment: "Comments."
1786 cost: "0"
1787 gateway: "<your_own_value>"
1788 gateway6: "<your_own_value>"
1789 ingress_spillover_threshold: "0"
1790 interface: "<your_own_value> (source system.interface.name)"
1791 preferred_source: "<your_own_value>"
1792 priority: "1"
1793 priority_in_sla: "0"
1794 priority_out_sla: "0"
1795 priority6: "1024"
1796 seq_num: "<you_own_value>"
1797 source: "<your_own_value>"
1798 source6: "<your_own_value>"
1799 spillover_threshold: "0"
1800 status: "disable"
1801 transport_group: "0"
1802 volume_ratio: "1"
1803 weight: "1"
1804 zone: "<your_own_value> (source system.sdwan.zone.name)"
1805 neighbor:
1806 -
1807 health_check: "<your_own_value> (source system.sdwan.health-check.name)"
1808 ip: "<your_own_value> (source router.bgp.neighbor-group.name router.bgp.neighbor.ip)"
1809 member:
1810 -
1811 seq_num: "<you_own_value>"
1812 minimum_sla_meet_members: "1"
1813 mode: "sla"
1814 role: "standalone"
1815 route_metric: "preferable"
1816 service_id: "0"
1817 sla_id: "0"
1818 neighbor_hold_boot_time: "0"
1819 neighbor_hold_down: "enable"
1820 neighbor_hold_down_time: "0"
1821 service:
1822 -
1823 addr_mode: "ipv4"
1824 agent_exclusive: "enable"
1825 bandwidth_weight: "0"
1826 comment: "Comments."
1827 default: "enable"
1828 dscp_forward: "enable"
1829 dscp_forward_tag: "<your_own_value>"
1830 dscp_reverse: "enable"
1831 dscp_reverse_tag: "<your_own_value>"
1832 dst:
1833 -
1834 name: "default_name_199 (source firewall.address.name firewall.addrgrp.name)"
1835 dst_negate: "enable"
1836 dst6:
1837 -
1838 name: "default_name_202 (source firewall.address6.name firewall.addrgrp6.name)"
1839 end_port: "65535"
1840 end_src_port: "65535"
1841 fib_best_match_force: "disable"
1842 gateway: "enable"
1843 groups:
1844 -
1845 name: "default_name_208 (source user.group.name)"
1846 hash_mode: "round-robin"
1847 health_check:
1848 -
1849 name: "default_name_211 (source system.sdwan.health-check.name)"
1850 hold_down_time: "0"
1851 id: "213"
1852 input_device:
1853 -
1854 name: "default_name_215 (source system.interface.name)"
1855 input_device_negate: "enable"
1856 input_zone:
1857 -
1858 name: "default_name_218 (source system.sdwan.zone.name)"
1859 internet_service: "enable"
1860 internet_service_app_ctrl:
1861 -
1862 id: "221"
1863 internet_service_app_ctrl_category:
1864 -
1865 id: "223"
1866 internet_service_app_ctrl_group:
1867 -
1868 name: "default_name_225 (source application.group.name)"
1869 internet_service_custom:
1870 -
1871 name: "default_name_227 (source firewall.internet-service-custom.name)"
1872 internet_service_custom_group:
1873 -
1874 name: "default_name_229 (source firewall.internet-service-custom-group.name)"
1875 internet_service_fortiguard:
1876 -
1877 name: "default_name_231 (source firewall.internet-service-fortiguard.name)"
1878 internet_service_group:
1879 -
1880 name: "default_name_233 (source firewall.internet-service-group.name)"
1881 internet_service_name:
1882 -
1883 name: "default_name_235 (source firewall.internet-service-name.name)"
1884 jitter_weight: "0"
1885 latency_weight: "0"
1886 link_cost_factor: "latency"
1887 link_cost_threshold: "10"
1888 load_balance: "enable"
1889 minimum_sla_meet_members: "0"
1890 mode: "auto"
1891 name: "default_name_243"
1892 packet_loss_weight: "0"
1893 passive_measurement: "enable"
1894 priority_members:
1895 -
1896 seq_num: "<you_own_value>"
1897 priority_zone:
1898 -
1899 name: "default_name_249 (source system.sdwan.zone.name)"
1900 protocol: "0"
1901 quality_link: "0"
1902 role: "standalone"
1903 route_tag: "0"
1904 shortcut: "enable"
1905 shortcut_priority: "enable"
1906 shortcut_stickiness: "enable"
1907 sla:
1908 -
1909 health_check: "<your_own_value> (source system.sdwan.health-check.name)"
1910 id: "259"
1911 sla_compare_method: "order"
1912 sla_stickiness: "enable"
1913 src:
1914 -
1915 name: "default_name_263 (source firewall.address.name firewall.addrgrp.name)"
1916 src_negate: "enable"
1917 src6:
1918 -
1919 name: "default_name_266 (source firewall.address6.name firewall.addrgrp6.name)"
1920 standalone_action: "enable"
1921 start_port: "1"
1922 start_src_port: "1"
1923 status: "enable"
1924 tie_break: "zone"
1925 tos: "<your_own_value>"
1926 tos_mask: "<your_own_value>"
1927 use_shortcut_sla: "enable"
1928 users:
1929 -
1930 name: "default_name_276 (source user.local.name)"
1931 zone_mode: "enable"
1932 speedtest_bypass_routing: "disable"
1933 status: "disable"
1934 zone:
1935 -
1936 advpn_health_check: "<your_own_value> (source system.sdwan.health-check.name)"
1937 advpn_select: "enable"
1938 minimum_sla_meet_members: "1"
1939 name: "default_name_284"
1940 service_sla_tie_break: "cfg-order"
1941 """
1942
1943 RETURN = """
1944 build:
1945 description: Build number of the fortigate image
1946 returned: always
1947 type: str
1948 sample: '1547'
1949 http_method:
1950 description: Last method used to provision the content into FortiGate
1951 returned: always
1952 type: str
1953 sample: 'PUT'
1954 http_status:
1955 description: Last result given by FortiGate on last operation applied
1956 returned: always
1957 type: str
1958 sample: "200"
1959 mkey:
1960 description: Master key (id) used in the last call to FortiGate
1961 returned: success
1962 type: str
1963 sample: "id"
1964 name:
1965 description: Name of the table used to fulfill the request
1966 returned: always
1967 type: str
1968 sample: "urlfilter"
1969 path:
1970 description: Path of the table used to fulfill the request
1971 returned: always
1972 type: str
1973 sample: "webfilter"
1974 revision:
1975 description: Internal revision number
1976 returned: always
1977 type: str
1978 sample: "17.0.2.10658"
1979 serial:
1980 description: Serial number of the unit
1981 returned: always
1982 type: str
1983 sample: "FGVMEVYYQT3AB5352"
1984 status:
1985 description: Indication of the operation's result
1986 returned: always
1987 type: str
1988 sample: "success"
1989 vdom:
1990 description: Virtual domain used
1991 returned: always
1992 type: str
1993 sample: "root"
1994 version:
1995 description: Version of the FortiGate
1996 returned: always
1997 type: str
1998 sample: "v5.6.3"
1999 """
2000 from ansible.module_utils.basic import AnsibleModule
2001 from ansible.module_utils.connection import Connection
2002 from ansible_collections.fortinet.fortios.plugins.module_utils.fortios.fortios import (
2003 FortiOSHandler,
2004 )
2005 from ansible_collections.fortinet.fortios.plugins.module_utils.fortios.fortios import (
2006 check_legacy_fortiosapi,
2007 )
2008 from ansible_collections.fortinet.fortios.plugins.module_utils.fortios.fortios import (
2009 schema_to_module_spec,
2010 )
2011 from ansible_collections.fortinet.fortios.plugins.module_utils.fortios.fortios import (
2012 check_schema_versioning,
2013 )
2014 from ansible_collections.fortinet.fortios.plugins.module_utils.fortimanager.common import (
2015 FAIL_SOCKET_MSG,
2016 )
2017 from ansible_collections.fortinet.fortios.plugins.module_utils.fortios.data_post_processor import (
2018 remove_invalid_fields,
2019 )
2020 from ansible_collections.fortinet.fortios.plugins.module_utils.fortios.comparison import (
2021 is_same_comparison,
2022 )
2023 from ansible_collections.fortinet.fortios.plugins.module_utils.fortios.comparison import (
2024 serialize,
2025 )
2026 from ansible_collections.fortinet.fortios.plugins.module_utils.fortios.comparison import (
2027 find_current_values,
2028 )
2029 from ansible_collections.fortinet.fortios.plugins.module_utils.fortios.comparison import (
2030 unify_data_format,
2031 )
2032
2033
2034 def filter_system_sdwan_data(json):
2035 option_list = [
2036 "app_perf_log_period",
2037 "duplication",
2038 "duplication_max_discrepancy",
2039 "duplication_max_num",
2040 "fail_alert_interfaces",
2041 "fail_detect",
2042 "health_check",
2043 "health_check_fortiguard",
2044 "load_balance_mode",
2045 "members",
2046 "neighbor",
2047 "neighbor_hold_boot_time",
2048 "neighbor_hold_down",
2049 "neighbor_hold_down_time",
2050 "service",
2051 "speedtest_bypass_routing",
2052 "status",
2053 "zone",
2054 ]
2055
2056 json = remove_invalid_fields(json)
2057 dictionary = {}
2058
2059 for attribute in option_list:
2060 if attribute in json and json[attribute] is not None:
2061 dictionary[attribute] = json[attribute]
2062
2063 return dictionary
2064
2065
2066 def flatten_single_path(data, path, index):
2067 if (
2068 not data
2069 or index == len(path)
2070 or path[index] not in data
2071 or (not data[path[index]] and not isinstance(data[path[index]], list))
2072 ):
2073 return
2074
2075 if index == len(path) - 1:
2076 data[path[index]] = " ".join(str(elem) for elem in data[path[index]])
2077 if len(data[path[index]]) == 0:
2078 data[path[index]] = None
2079 elif isinstance(data[path[index]], list):
2080 for value in data[path[index]]:
2081 flatten_single_path(value, path, index + 1)
2082 else:
2083 flatten_single_path(data[path[index]], path, index + 1)
2084
2085
2086 def flatten_multilists_attributes(data):
2087 multilist_attrs = [
2088 ["health_check", "server"],
2089 ["health_check", "sla", "link_cost_factor"],
2090 ["health_check_fortiguard", "server"],
2091 ["health_check_fortiguard", "sla", "link_cost_factor"],
2092 ]
2093
2094 for attr in multilist_attrs:
2095 flatten_single_path(data, attr, 0)
2096
2097 return data
2098
2099
2100 def underscore_to_hyphen(data):
2101 new_data = None
2102 if isinstance(data, list):
2103 new_data = []
2104 for i, elem in enumerate(data):
2105 new_data.append(underscore_to_hyphen(elem))
2106 elif isinstance(data, dict):
2107 new_data = {}
2108 for k, v in data.items():
2109 new_data[k.replace("_", "-")] = underscore_to_hyphen(v)
2110 else:
2111 return data
2112 return new_data
2113
2114
2115 def system_sdwan(data, fos, check_mode=False):
2116
2117 state = None
2118 vdom = data["vdom"]
2119 parameters = None
2120 state = data.get("state", None)
2121 system_sdwan_data = data["system_sdwan"]
2122
2123 filtered_data = filter_system_sdwan_data(system_sdwan_data)
2124 filtered_data = flatten_multilists_attributes(filtered_data)
2125 converted_data = underscore_to_hyphen(filtered_data)
2126
2127 # check_mode starts from here
2128 if check_mode:
2129 diff = {
2130 "before": "",
2131 "after": filtered_data,
2132 }
2133 mkeyname = fos.get_mkeyname(None, None)
2134 mkey = fos.get_mkey("system", "sdwan", filtered_data, vdom=vdom)
2135 current_data = fos.get(
2136 "system", "sdwan", vdom=vdom, mkey=mkey, parameters=parameters
2137 )
2138 is_existed = (
2139 current_data
2140 and current_data.get("http_status") == 200
2141 and (
2142 mkeyname
2143 and isinstance(current_data.get("results"), list)
2144 and len(current_data["results"]) > 0
2145 or not mkeyname
2146 and current_data["results"] # global object response
2147 )
2148 )
2149
2150 # 2. if it exists and the state is 'present' then compare current settings with desired
2151 if state == "present" or state is True or state is None:
2152 # for non global modules, mkeyname must exist and it's a new module when mkey is None
2153 if mkeyname is not None and mkey is None:
2154 return False, True, filtered_data, diff
2155
2156 # if mkey exists then compare each other
2157 # record exits and they're matched or not
2158 copied_filtered_data = filtered_data.copy()
2159 copied_filtered_data.pop(mkeyname, None)
2160 unified_filtered_data = unify_data_format(copied_filtered_data)
2161
2162 current_data_results = current_data.get("results", {})
2163 current_config = (
2164 current_data_results[0]
2165 if mkeyname
2166 and isinstance(current_data_results, list)
2167 and len(current_data_results) > 0
2168 else current_data_results
2169 )
2170 if is_existed:
2171 unified_current_values = find_current_values(
2172 unified_filtered_data,
2173 unify_data_format(current_config),
2174 )
2175
2176 is_same = is_same_comparison(
2177 serialize(unified_current_values), serialize(unified_filtered_data)
2178 )
2179
2180 return (
2181 False,
2182 not is_same,
2183 filtered_data,
2184 {"before": unified_current_values, "after": unified_filtered_data},
2185 )
2186
2187 # record does not exist
2188 return False, True, filtered_data, diff
2189
2190 if state == "absent":
2191 if mkey is None:
2192 return (
2193 False,
2194 False,
2195 filtered_data,
2196 {"before": current_data["results"][0], "after": ""},
2197 )
2198
2199 if is_existed:
2200 return (
2201 False,
2202 True,
2203 filtered_data,
2204 {"before": current_data["results"][0], "after": ""},
2205 )
2206 return False, False, filtered_data, {}
2207
2208 return True, False, {"reason: ": "Must provide state parameter"}, {}
2209 # pass post processed data to member operations
2210 # no need to do underscore_to_hyphen since do_member_operation handles it by itself
2211 data_copy = data.copy()
2212 data_copy["system_sdwan"] = filtered_data
2213 fos.do_member_operation(
2214 "system",
2215 "sdwan",
2216 data_copy,
2217 )
2218
2219 return fos.set(
2220 "system", "sdwan", data=converted_data, vdom=vdom, parameters=parameters
2221 )
2222
2223
2224 def is_successful_status(resp):
2225 return (
2226 "status" in resp
2227 and resp["status"] == "success"
2228 or "http_status" in resp
2229 and resp["http_status"] == 200
2230 or "http_method" in resp
2231 and resp["http_method"] == "DELETE"
2232 and resp["http_status"] == 404
2233 )
2234
2235
2236 def fortios_system(data, fos, check_mode):
2237
2238 if data["system_sdwan"]:
2239 resp = system_sdwan(data, fos, check_mode)
2240 else:
2241 fos._module.fail_json(msg="missing task body: %s" % ("system_sdwan"))
2242 if isinstance(resp, tuple) and len(resp) == 4:
2243 return resp
2244 return (
2245 not is_successful_status(resp),
2246 is_successful_status(resp)
2247 and (resp["revision_changed"] if "revision_changed" in resp else True),
2248 resp,
2249 {},
2250 )
2251
2252
2253 versioned_schema = {
2254 "v_range": [["v6.4.0", ""]],
2255 "type": "dict",
2256 "children": {
2257 "status": {
2258 "v_range": [["v6.4.0", ""]],
2259 "type": "string",
2260 "options": [{"value": "disable"}, {"value": "enable"}],
2261 },
2262 "load_balance_mode": {
2263 "v_range": [["v6.4.0", ""]],
2264 "type": "string",
2265 "options": [
2266 {"value": "source-ip-based"},
2267 {"value": "weight-based"},
2268 {"value": "usage-based"},
2269 {"value": "source-dest-ip-based"},
2270 {"value": "measured-volume-based"},
2271 ],
2272 },
2273 "speedtest_bypass_routing": {
2274 "v_range": [["v7.0.1", ""]],
2275 "type": "string",
2276 "options": [{"value": "disable"}, {"value": "enable"}],
2277 },
2278 "duplication_max_num": {
2279 "v_range": [["v6.4.0", "v6.4.0"], ["v6.4.4", ""]],
2280 "type": "integer",
2281 },
2282 "duplication_max_discrepancy": {"v_range": [["v7.6.1", ""]], "type": "integer"},
2283 "neighbor_hold_down": {
2284 "v_range": [["v6.4.0", ""]],
2285 "type": "string",
2286 "options": [{"value": "enable"}, {"value": "disable"}],
2287 },
2288 "neighbor_hold_down_time": {"v_range": [["v6.4.0", ""]], "type": "integer"},
2289 "app_perf_log_period": {"v_range": [["v7.4.0", ""]], "type": "integer"},
2290 "neighbor_hold_boot_time": {"v_range": [["v6.4.0", ""]], "type": "integer"},
2291 "fail_detect": {
2292 "v_range": [["v6.4.0", ""]],
2293 "type": "string",
2294 "options": [{"value": "enable"}, {"value": "disable"}],
2295 },
2296 "fail_alert_interfaces": {
2297 "type": "list",
2298 "elements": "dict",
2299 "children": {
2300 "name": {
2301 "v_range": [["v6.4.0", ""]],
2302 "type": "string",
2303 "required": True,
2304 }
2305 },
2306 "v_range": [["v6.4.0", ""]],
2307 },
2308 "zone": {
2309 "type": "list",
2310 "elements": "dict",
2311 "children": {
2312 "name": {
2313 "v_range": [["v6.4.0", ""]],
2314 "type": "string",
2315 "required": True,
2316 },
2317 "advpn_select": {
2318 "v_range": [["v7.4.2", ""]],
2319 "type": "string",
2320 "options": [{"value": "enable"}, {"value": "disable"}],
2321 },
2322 "advpn_health_check": {"v_range": [["v7.4.2", ""]], "type": "string"},
2323 "service_sla_tie_break": {
2324 "v_range": [["v6.4.4", ""]],
2325 "type": "string",
2326 "options": [
2327 {"value": "cfg-order"},
2328 {"value": "fib-best-match"},
2329 {"value": "priority", "v_range": [["v7.6.4", ""]]},
2330 {"value": "input-device", "v_range": [["v7.2.0", ""]]},
2331 ],
2332 },
2333 "minimum_sla_meet_members": {
2334 "v_range": [["v7.4.1", ""]],
2335 "type": "integer",
2336 },
2337 },
2338 "v_range": [["v6.4.0", ""]],
2339 },
2340 "members": {
2341 "type": "list",
2342 "elements": "dict",
2343 "children": {
2344 "seq_num": {
2345 "v_range": [["v6.4.0", ""]],
2346 "type": "integer",
2347 "required": True,
2348 },
2349 "interface": {"v_range": [["v6.4.0", ""]], "type": "string"},
2350 "zone": {"v_range": [["v6.4.0", ""]], "type": "string"},
2351 "gateway": {"v_range": [["v6.4.0", ""]], "type": "string"},
2352 "preferred_source": {"v_range": [["v7.4.0", ""]], "type": "string"},
2353 "source": {"v_range": [["v6.4.0", ""]], "type": "string"},
2354 "gateway6": {"v_range": [["v6.4.0", ""]], "type": "string"},
2355 "source6": {"v_range": [["v6.4.0", ""]], "type": "string"},
2356 "cost": {"v_range": [["v6.4.0", ""]], "type": "integer"},
2357 "weight": {"v_range": [["v6.4.0", ""]], "type": "integer"},
2358 "priority": {"v_range": [["v6.4.0", ""]], "type": "integer"},
2359 "priority6": {"v_range": [["v7.0.0", ""]], "type": "integer"},
2360 "priority_in_sla": {"v_range": [["v7.6.0", ""]], "type": "integer"},
2361 "priority_out_sla": {"v_range": [["v7.6.0", ""]], "type": "integer"},
2362 "spillover_threshold": {"v_range": [["v6.4.0", ""]], "type": "integer"},
2363 "ingress_spillover_threshold": {
2364 "v_range": [["v6.4.0", ""]],
2365 "type": "integer",
2366 },
2367 "volume_ratio": {"v_range": [["v6.4.0", ""]], "type": "integer"},
2368 "status": {
2369 "v_range": [["v6.4.0", ""]],
2370 "type": "string",
2371 "options": [{"value": "disable"}, {"value": "enable"}],
2372 },
2373 "transport_group": {"v_range": [["v7.4.2", ""]], "type": "integer"},
2374 "comment": {"v_range": [["v6.4.0", ""]], "type": "string"},
2375 },
2376 "v_range": [["v6.4.0", ""]],
2377 },
2378 "health_check": {
2379 "type": "list",
2380 "elements": "dict",
2381 "children": {
2382 "name": {
2383 "v_range": [["v6.4.0", ""]],
2384 "type": "string",
2385 "required": True,
2386 },
2387 "fortiguard": {
2388 "v_range": [["v7.6.1", ""]],
2389 "type": "string",
2390 "options": [{"value": "disable"}, {"value": "enable"}],
2391 },
2392 "fortiguard_name": {"v_range": [["v7.6.1", ""]], "type": "string"},
2393 "probe_packets": {
2394 "v_range": [["v6.4.0", ""]],
2395 "type": "string",
2396 "options": [{"value": "disable"}, {"value": "enable"}],
2397 },
2398 "addr_mode": {
2399 "v_range": [["v6.4.0", ""]],
2400 "type": "string",
2401 "options": [{"value": "ipv4"}, {"value": "ipv6"}],
2402 },
2403 "system_dns": {
2404 "v_range": [["v6.4.0", ""]],
2405 "type": "string",
2406 "options": [{"value": "disable"}, {"value": "enable"}],
2407 },
2408 "server": {
2409 "v_range": [["v6.4.0", ""]],
2410 "type": "list",
2411 "multiple_values": True,
2412 "elements": "str",
2413 },
2414 "detect_mode": {
2415 "v_range": [["v7.0.0", ""]],
2416 "type": "string",
2417 "options": [
2418 {"value": "active"},
2419 {"value": "passive"},
2420 {"value": "prefer-passive"},
2421 {"value": "remote", "v_range": [["v7.2.1", ""]]},
2422 {"value": "agent-based", "v_range": [["v7.2.4", ""]]},
2423 ],
2424 },
2425 "protocol": {
2426 "v_range": [["v6.4.0", ""]],
2427 "type": "string",
2428 "options": [
2429 {"value": "ping"},
2430 {"value": "tcp-echo"},
2431 {"value": "udp-echo"},
2432 {"value": "http"},
2433 {"value": "https", "v_range": [["v7.4.1", ""]]},
2434 {"value": "twamp"},
2435 {"value": "dns"},
2436 {
2437 "value": "tcp-connect",
2438 "v_range": [["v6.4.0", "v6.4.0"], ["v6.4.4", ""]],
2439 },
2440 {
2441 "value": "ftp",
2442 "v_range": [["v6.4.0", "v6.4.0"], ["v6.4.4", ""]],
2443 },
2444 {"value": "ping6", "v_range": [["v6.4.1", "v6.4.1"]]},
2445 ],
2446 },
2447 "port": {"v_range": [["v6.4.0", ""]], "type": "integer"},
2448 "quality_measured_method": {
2449 "v_range": [["v6.4.0", "v6.4.0"], ["v6.4.4", ""]],
2450 "type": "string",
2451 "options": [{"value": "half-open"}, {"value": "half-close"}],
2452 },
2453 "security_mode": {
2454 "v_range": [["v6.4.0", ""]],
2455 "type": "string",
2456 "options": [{"value": "none"}, {"value": "authentication"}],
2457 },
2458 "user": {
2459 "v_range": [["v6.4.0", "v6.4.0"], ["v6.4.4", ""]],
2460 "type": "string",
2461 },
2462 "password": {"v_range": [["v6.4.0", ""]], "type": "string"},
2463 "packet_size": {"v_range": [["v6.4.0", ""]], "type": "integer"},
2464 "ha_priority": {"v_range": [["v6.4.0", ""]], "type": "integer"},
2465 "ftp_mode": {
2466 "v_range": [["v6.4.0", "v6.4.0"], ["v6.4.4", ""]],
2467 "type": "string",
2468 "options": [{"value": "passive"}, {"value": "port"}],
2469 },
2470 "ftp_file": {
2471 "v_range": [["v6.4.0", "v6.4.0"], ["v6.4.4", ""]],
2472 "type": "string",
2473 },
2474 "http_get": {"v_range": [["v6.4.0", ""]], "type": "string"},
2475 "http_agent": {"v_range": [["v6.4.0", ""]], "type": "string"},
2476 "http_match": {"v_range": [["v6.4.0", ""]], "type": "string"},
2477 "dns_request_domain": {"v_range": [["v6.4.0", ""]], "type": "string"},
2478 "dns_match_ip": {
2479 "v_range": [["v6.4.0", "v6.4.0"], ["v6.4.4", ""]],
2480 "type": "string",
2481 },
2482 "interval": {"v_range": [["v6.4.0", ""]], "type": "integer"},
2483 "probe_timeout": {"v_range": [["v6.4.0", ""]], "type": "integer"},
2484 "agent_probe_timeout": {"v_range": [["v7.6.3", ""]], "type": "integer"},
2485 "remote_probe_timeout": {
2486 "v_range": [["v7.6.3", ""]],
2487 "type": "integer",
2488 },
2489 "failtime": {"v_range": [["v6.4.0", ""]], "type": "integer"},
2490 "recoverytime": {"v_range": [["v6.4.0", ""]], "type": "integer"},
2491 "probe_count": {"v_range": [["v6.4.0", ""]], "type": "integer"},
2492 "diffservcode": {"v_range": [["v6.4.0", ""]], "type": "string"},
2493 "update_cascade_interface": {
2494 "v_range": [["v6.4.0", ""]],
2495 "type": "string",
2496 "options": [{"value": "enable"}, {"value": "disable"}],
2497 },
2498 "update_static_route": {
2499 "v_range": [["v6.4.0", ""]],
2500 "type": "string",
2501 "options": [{"value": "enable"}, {"value": "disable"}],
2502 },
2503 "update_bgp_route": {
2504 "v_range": [["v7.6.5", ""]],
2505 "type": "string",
2506 "options": [{"value": "enable"}, {"value": "disable"}],
2507 },
2508 "embed_measured_health": {
2509 "v_range": [["v7.2.1", ""]],
2510 "type": "string",
2511 "options": [{"value": "enable"}, {"value": "disable"}],
2512 },
2513 "sla_id_redistribute": {"v_range": [["v7.2.1", ""]], "type": "integer"},
2514 "sla_fail_log_period": {"v_range": [["v6.4.0", ""]], "type": "integer"},
2515 "sla_pass_log_period": {"v_range": [["v6.4.0", ""]], "type": "integer"},
2516 "threshold_warning_packetloss": {
2517 "v_range": [["v6.4.0", ""]],
2518 "type": "integer",
2519 },
2520 "threshold_alert_packetloss": {
2521 "v_range": [["v6.4.0", ""]],
2522 "type": "integer",
2523 },
2524 "threshold_warning_latency": {
2525 "v_range": [["v6.4.0", ""]],
2526 "type": "integer",
2527 },
2528 "threshold_alert_latency": {
2529 "v_range": [["v6.4.0", ""]],
2530 "type": "integer",
2531 },
2532 "threshold_warning_jitter": {
2533 "v_range": [["v6.4.0", ""]],
2534 "type": "integer",
2535 },
2536 "threshold_alert_jitter": {
2537 "v_range": [["v6.4.0", ""]],
2538 "type": "integer",
2539 },
2540 "vrf": {"v_range": [["v7.2.0", ""]], "type": "integer"},
2541 "source": {"v_range": [["v7.2.0", ""]], "type": "string"},
2542 "source6": {"v_range": [["v7.4.0", ""]], "type": "string"},
2543 "members": {
2544 "type": "list",
2545 "elements": "dict",
2546 "children": {
2547 "seq_num": {
2548 "v_range": [["v6.4.0", ""]],
2549 "type": "integer",
2550 "required": True,
2551 }
2552 },
2553 "v_range": [["v6.4.0", ""]],
2554 },
2555 "mos_codec": {
2556 "v_range": [["v7.2.0", ""]],
2557 "type": "string",
2558 "options": [
2559 {"value": "g711"},
2560 {"value": "g722"},
2561 {"value": "g729"},
2562 ],
2563 },
2564 "class_id": {"v_range": [["v7.4.0", ""]], "type": "integer"},
2565 "packet_loss_weight": {"v_range": [["v7.6.4", ""]], "type": "integer"},
2566 "latency_weight": {"v_range": [["v7.6.4", ""]], "type": "integer"},
2567 "jitter_weight": {"v_range": [["v7.6.4", ""]], "type": "integer"},
2568 "bandwidth_weight": {"v_range": [["v7.6.4", ""]], "type": "integer"},
2569 "sla": {
2570 "type": "list",
2571 "elements": "dict",
2572 "children": {
2573 "id": {
2574 "v_range": [["v6.4.0", ""]],
2575 "type": "integer",
2576 "required": True,
2577 },
2578 "link_cost_factor": {
2579 "v_range": [["v6.4.0", ""]],
2580 "type": "list",
2581 "options": [
2582 {"value": "latency"},
2583 {"value": "jitter"},
2584 {"value": "packet-loss"},
2585 {
2586 "value": "custom-profile-1",
2587 "v_range": [["v7.6.4", ""]],
2588 },
2589 {"value": "mos", "v_range": [["v7.2.0", ""]]},
2590 {"value": "remote", "v_range": [["v7.6.0", ""]]},
2591 ],
2592 "multiple_values": True,
2593 "elements": "str",
2594 },
2595 "latency_threshold": {
2596 "v_range": [["v6.4.0", ""]],
2597 "type": "integer",
2598 },
2599 "jitter_threshold": {
2600 "v_range": [["v6.4.0", ""]],
2601 "type": "integer",
2602 },
2603 "packetloss_threshold": {
2604 "v_range": [["v6.4.0", ""]],
2605 "type": "integer",
2606 },
2607 "mos_threshold": {
2608 "v_range": [["v7.2.0", ""]],
2609 "type": "string",
2610 },
2611 "custom_profile_threshold": {
2612 "v_range": [["v7.6.4", ""]],
2613 "type": "integer",
2614 },
2615 "priority_in_sla": {
2616 "v_range": [["v7.2.1", ""]],
2617 "type": "integer",
2618 },
2619 "priority_out_sla": {
2620 "v_range": [["v7.2.1", ""]],
2621 "type": "integer",
2622 },
2623 },
2624 "v_range": [["v6.4.0", ""]],
2625 },
2626 },
2627 "v_range": [["v6.4.0", ""]],
2628 },
2629 "service": {
2630 "type": "list",
2631 "elements": "dict",
2632 "children": {
2633 "id": {
2634 "v_range": [["v6.4.0", ""]],
2635 "type": "integer",
2636 "required": True,
2637 },
2638 "name": {"v_range": [["v6.4.0", ""]], "type": "string"},
2639 "addr_mode": {
2640 "v_range": [["v6.4.0", ""]],
2641 "type": "string",
2642 "options": [{"value": "ipv4"}, {"value": "ipv6"}],
2643 },
2644 "load_balance": {
2645 "v_range": [["v7.4.1", ""]],
2646 "type": "string",
2647 "options": [{"value": "enable"}, {"value": "disable"}],
2648 },
2649 "input_device": {
2650 "type": "list",
2651 "elements": "dict",
2652 "children": {
2653 "name": {
2654 "v_range": [["v6.4.0", ""]],
2655 "type": "string",
2656 "required": True,
2657 }
2658 },
2659 "v_range": [["v6.4.0", ""]],
2660 },
2661 "input_device_negate": {
2662 "v_range": [["v6.4.0", ""]],
2663 "type": "string",
2664 "options": [{"value": "enable"}, {"value": "disable"}],
2665 },
2666 "input_zone": {
2667 "type": "list",
2668 "elements": "dict",
2669 "children": {
2670 "name": {
2671 "v_range": [["v7.2.0", ""]],
2672 "type": "string",
2673 "required": True,
2674 }
2675 },
2676 "v_range": [["v7.2.0", ""]],
2677 },
2678 "mode": {
2679 "v_range": [["v6.4.0", ""]],
2680 "type": "string",
2681 "options": [
2682 {"value": "auto"},
2683 {"value": "manual"},
2684 {"value": "priority"},
2685 {"value": "sla"},
2686 {"value": "load-balance", "v_range": [["v6.4.0", "v7.4.0"]]},
2687 ],
2688 },
2689 "zone_mode": {
2690 "v_range": [["v7.4.1", ""]],
2691 "type": "string",
2692 "options": [{"value": "enable"}, {"value": "disable"}],
2693 },
2694 "minimum_sla_meet_members": {
2695 "v_range": [["v6.4.0", "v6.4.0"], ["v6.4.4", ""]],
2696 "type": "integer",
2697 },
2698 "hash_mode": {
2699 "v_range": [["v6.4.0", "v6.4.0"], ["v6.4.4", ""]],
2700 "type": "string",
2701 "options": [
2702 {"value": "round-robin"},
2703 {"value": "source-ip-based"},
2704 {"value": "source-dest-ip-based"},
2705 {"value": "inbandwidth"},
2706 {"value": "outbandwidth"},
2707 {"value": "bibandwidth"},
2708 ],
2709 },
2710 "shortcut_priority": {
2711 "v_range": [["v7.4.2", ""]],
2712 "type": "string",
2713 "options": [
2714 {"value": "enable"},
2715 {"value": "disable"},
2716 {"value": "auto"},
2717 ],
2718 },
2719 "role": {
2720 "v_range": [["v6.4.0", ""]],
2721 "type": "string",
2722 "options": [
2723 {"value": "standalone"},
2724 {"value": "primary"},
2725 {"value": "secondary"},
2726 ],
2727 },
2728 "standalone_action": {
2729 "v_range": [["v6.4.0", ""]],
2730 "type": "string",
2731 "options": [{"value": "enable"}, {"value": "disable"}],
2732 },
2733 "quality_link": {"v_range": [["v6.4.0", ""]], "type": "integer"},
2734 "tos": {"v_range": [["v6.4.0", ""]], "type": "string"},
2735 "tos_mask": {"v_range": [["v6.4.0", ""]], "type": "string"},
2736 "protocol": {"v_range": [["v6.4.0", ""]], "type": "integer"},
2737 "start_port": {"v_range": [["v6.4.0", ""]], "type": "integer"},
2738 "end_port": {"v_range": [["v6.4.0", ""]], "type": "integer"},
2739 "start_src_port": {"v_range": [["v7.4.1", ""]], "type": "integer"},
2740 "end_src_port": {"v_range": [["v7.4.1", ""]], "type": "integer"},
2741 "dst": {
2742 "type": "list",
2743 "elements": "dict",
2744 "children": {
2745 "name": {
2746 "v_range": [["v6.4.0", ""]],
2747 "type": "string",
2748 "required": True,
2749 }
2750 },
2751 "v_range": [["v6.4.0", ""]],
2752 },
2753 "dst_negate": {
2754 "v_range": [["v6.4.0", ""]],
2755 "type": "string",
2756 "options": [{"value": "enable"}, {"value": "disable"}],
2757 },
2758 "src": {
2759 "type": "list",
2760 "elements": "dict",
2761 "children": {
2762 "name": {
2763 "v_range": [["v6.4.0", ""]],
2764 "type": "string",
2765 "required": True,
2766 }
2767 },
2768 "v_range": [["v6.4.0", ""]],
2769 },
2770 "dst6": {
2771 "type": "list",
2772 "elements": "dict",
2773 "children": {
2774 "name": {
2775 "v_range": [["v6.4.0", ""]],
2776 "type": "string",
2777 "required": True,
2778 }
2779 },
2780 "v_range": [["v6.4.0", ""]],
2781 },
2782 "src6": {
2783 "type": "list",
2784 "elements": "dict",
2785 "children": {
2786 "name": {
2787 "v_range": [["v6.4.0", ""]],
2788 "type": "string",
2789 "required": True,
2790 }
2791 },
2792 "v_range": [["v6.4.0", ""]],
2793 },
2794 "src_negate": {
2795 "v_range": [["v6.4.0", ""]],
2796 "type": "string",
2797 "options": [{"value": "enable"}, {"value": "disable"}],
2798 },
2799 "users": {
2800 "type": "list",
2801 "elements": "dict",
2802 "children": {
2803 "name": {
2804 "v_range": [["v6.4.0", ""]],
2805 "type": "string",
2806 "required": True,
2807 }
2808 },
2809 "v_range": [["v6.4.0", ""]],
2810 },
2811 "groups": {
2812 "type": "list",
2813 "elements": "dict",
2814 "children": {
2815 "name": {
2816 "v_range": [["v6.4.0", ""]],
2817 "type": "string",
2818 "required": True,
2819 }
2820 },
2821 "v_range": [["v6.4.0", ""]],
2822 },
2823 "internet_service": {
2824 "v_range": [["v6.4.0", ""]],
2825 "type": "string",
2826 "options": [{"value": "enable"}, {"value": "disable"}],
2827 },
2828 "internet_service_custom": {
2829 "type": "list",
2830 "elements": "dict",
2831 "children": {
2832 "name": {
2833 "v_range": [["v6.4.0", ""]],
2834 "type": "string",
2835 "required": True,
2836 }
2837 },
2838 "v_range": [["v6.4.0", ""]],
2839 },
2840 "internet_service_custom_group": {
2841 "type": "list",
2842 "elements": "dict",
2843 "children": {
2844 "name": {
2845 "v_range": [["v6.4.0", ""]],
2846 "type": "string",
2847 "required": True,
2848 }
2849 },
2850 "v_range": [["v6.4.0", ""]],
2851 },
2852 "internet_service_fortiguard": {
2853 "type": "list",
2854 "elements": "dict",
2855 "children": {
2856 "name": {
2857 "v_range": [["v7.6.4", ""]],
2858 "type": "string",
2859 "required": True,
2860 }
2861 },
2862 "v_range": [["v7.6.4", ""]],
2863 },
2864 "internet_service_name": {
2865 "type": "list",
2866 "elements": "dict",
2867 "children": {
2868 "name": {
2869 "v_range": [["v6.4.0", ""]],
2870 "type": "string",
2871 "required": True,
2872 }
2873 },
2874 "v_range": [["v6.4.0", ""]],
2875 },
2876 "internet_service_group": {
2877 "type": "list",
2878 "elements": "dict",
2879 "children": {
2880 "name": {
2881 "v_range": [["v6.4.0", ""]],
2882 "type": "string",
2883 "required": True,
2884 }
2885 },
2886 "v_range": [["v6.4.0", ""]],
2887 },
2888 "internet_service_app_ctrl": {
2889 "type": "list",
2890 "elements": "dict",
2891 "children": {
2892 "id": {
2893 "v_range": [["v6.4.0", ""]],
2894 "type": "integer",
2895 "required": True,
2896 }
2897 },
2898 "v_range": [["v6.4.0", ""]],
2899 },
2900 "internet_service_app_ctrl_group": {
2901 "type": "list",
2902 "elements": "dict",
2903 "children": {
2904 "name": {
2905 "v_range": [["v6.4.0", ""]],
2906 "type": "string",
2907 "required": True,
2908 }
2909 },
2910 "v_range": [["v6.4.0", ""]],
2911 },
2912 "internet_service_app_ctrl_category": {
2913 "type": "list",
2914 "elements": "dict",
2915 "children": {
2916 "id": {
2917 "v_range": [["v7.2.0", ""]],
2918 "type": "integer",
2919 "required": True,
2920 }
2921 },
2922 "v_range": [["v7.2.0", ""]],
2923 },
2924 "health_check": {
2925 "type": "list",
2926 "elements": "dict",
2927 "children": {
2928 "name": {
2929 "v_range": [["v6.4.0", ""]],
2930 "type": "string",
2931 "required": True,
2932 }
2933 },
2934 "v_range": [["v6.4.0", ""]],
2935 },
2936 "link_cost_factor": {
2937 "v_range": [["v6.4.0", ""]],
2938 "type": "string",
2939 "options": [
2940 {"value": "latency"},
2941 {"value": "jitter"},
2942 {"value": "packet-loss"},
2943 {"value": "inbandwidth"},
2944 {"value": "outbandwidth"},
2945 {"value": "bibandwidth"},
2946 {"value": "custom-profile-1"},
2947 ],
2948 },
2949 "packet_loss_weight": {"v_range": [["v6.4.0", ""]], "type": "integer"},
2950 "latency_weight": {"v_range": [["v6.4.0", ""]], "type": "integer"},
2951 "jitter_weight": {"v_range": [["v6.4.0", ""]], "type": "integer"},
2952 "bandwidth_weight": {"v_range": [["v6.4.0", ""]], "type": "integer"},
2953 "link_cost_threshold": {"v_range": [["v6.4.0", ""]], "type": "integer"},
2954 "hold_down_time": {"v_range": [["v6.4.0", ""]], "type": "integer"},
2955 "sla_stickiness": {
2956 "v_range": [["v7.4.1", ""]],
2957 "type": "string",
2958 "options": [{"value": "enable"}, {"value": "disable"}],
2959 },
2960 "dscp_forward": {
2961 "v_range": [["v6.4.0", ""]],
2962 "type": "string",
2963 "options": [{"value": "enable"}, {"value": "disable"}],
2964 },
2965 "dscp_reverse": {
2966 "v_range": [["v6.4.0", ""]],
2967 "type": "string",
2968 "options": [{"value": "enable"}, {"value": "disable"}],
2969 },
2970 "dscp_forward_tag": {"v_range": [["v6.4.0", ""]], "type": "string"},
2971 "dscp_reverse_tag": {"v_range": [["v6.4.0", ""]], "type": "string"},
2972 "sla": {
2973 "type": "list",
2974 "elements": "dict",
2975 "children": {
2976 "health_check": {
2977 "v_range": [["v6.4.0", ""]],
2978 "type": "string",
2979 "required": True,
2980 },
2981 "id": {"v_range": [["v6.4.0", ""]], "type": "integer"},
2982 },
2983 "v_range": [["v6.4.0", ""]],
2984 },
2985 "priority_members": {
2986 "type": "list",
2987 "elements": "dict",
2988 "children": {
2989 "seq_num": {
2990 "v_range": [["v6.4.0", ""]],
2991 "type": "integer",
2992 "required": True,
2993 }
2994 },
2995 "v_range": [["v6.4.0", ""]],
2996 },
2997 "priority_zone": {
2998 "type": "list",
2999 "elements": "dict",
3000 "children": {
3001 "name": {
3002 "v_range": [["v7.0.1", ""]],
3003 "type": "string",
3004 "required": True,
3005 }
3006 },
3007 "v_range": [["v7.0.1", ""]],
3008 },
3009 "status": {
3010 "v_range": [["v6.4.0", ""]],
3011 "type": "string",
3012 "options": [{"value": "enable"}, {"value": "disable"}],
3013 },
3014 "gateway": {
3015 "v_range": [["v6.4.0", ""]],
3016 "type": "string",
3017 "options": [{"value": "enable"}, {"value": "disable"}],
3018 },
3019 "default": {
3020 "v_range": [["v6.4.0", ""]],
3021 "type": "string",
3022 "options": [{"value": "enable"}, {"value": "disable"}],
3023 },
3024 "sla_compare_method": {
3025 "v_range": [["v6.4.0", ""]],
3026 "type": "string",
3027 "options": [{"value": "order"}, {"value": "number"}],
3028 },
3029 "fib_best_match_force": {
3030 "v_range": [["v7.6.3", ""]],
3031 "type": "string",
3032 "options": [{"value": "disable"}, {"value": "enable"}],
3033 },
3034 "tie_break": {
3035 "v_range": [["v6.4.4", ""]],
3036 "type": "string",
3037 "options": [
3038 {"value": "zone"},
3039 {"value": "cfg-order"},
3040 {"value": "fib-best-match"},
3041 {"value": "priority", "v_range": [["v7.6.4", ""]]},
3042 {"value": "input-device", "v_range": [["v7.2.0", ""]]},
3043 ],
3044 },
3045 "use_shortcut_sla": {
3046 "v_range": [["v6.4.4", ""]],
3047 "type": "string",
3048 "options": [{"value": "enable"}, {"value": "disable"}],
3049 },
3050 "passive_measurement": {
3051 "v_range": [["v7.0.2", ""]],
3052 "type": "string",
3053 "options": [{"value": "enable"}, {"value": "disable"}],
3054 },
3055 "agent_exclusive": {
3056 "v_range": [["v7.2.4", ""]],
3057 "type": "string",
3058 "options": [{"value": "enable"}, {"value": "disable"}],
3059 },
3060 "shortcut": {
3061 "v_range": [["v7.4.0", ""]],
3062 "type": "string",
3063 "options": [{"value": "enable"}, {"value": "disable"}],
3064 },
3065 "comment": {"v_range": [["v7.6.0", ""]], "type": "string"},
3066 "shortcut_stickiness": {
3067 "v_range": [["v7.4.0", "v7.4.0"]],
3068 "type": "string",
3069 "options": [{"value": "enable"}, {"value": "disable"}],
3070 },
3071 "route_tag": {"v_range": [["v6.4.0", "v7.2.4"]], "type": "integer"},
3072 },
3073 "v_range": [["v6.4.0", ""]],
3074 },
3075 "neighbor": {
3076 "type": "list",
3077 "elements": "dict",
3078 "children": {
3079 "ip": {"v_range": [["v6.4.0", ""]], "type": "string", "required": True},
3080 "member": {
3081 "type": "list",
3082 "elements": "dict",
3083 "children": {
3084 "seq_num": {
3085 "v_range": [["v7.2.0", ""]],
3086 "type": "integer",
3087 "required": True,
3088 }
3089 },
3090 "v_range": [["v6.4.0", ""]],
3091 },
3092 "service_id": {"v_range": [["v7.4.1", ""]], "type": "integer"},
3093 "minimum_sla_meet_members": {
3094 "v_range": [["v7.2.0", ""]],
3095 "type": "integer",
3096 },
3097 "mode": {
3098 "v_range": [["v7.0.1", ""]],
3099 "type": "string",
3100 "options": [{"value": "sla"}, {"value": "speedtest"}],
3101 },
3102 "role": {
3103 "v_range": [["v6.4.0", ""]],
3104 "type": "string",
3105 "options": [
3106 {"value": "standalone"},
3107 {"value": "primary"},
3108 {"value": "secondary"},
3109 ],
3110 },
3111 "route_metric": {
3112 "v_range": [["v7.6.1", ""]],
3113 "type": "string",
3114 "options": [{"value": "preferable"}, {"value": "priority"}],
3115 },
3116 "health_check": {"v_range": [["v6.4.0", ""]], "type": "string"},
3117 "sla_id": {"v_range": [["v6.4.0", ""]], "type": "integer"},
3118 },
3119 "v_range": [["v6.4.0", ""]],
3120 },
3121 "duplication": {
3122 "type": "list",
3123 "elements": "dict",
3124 "children": {
3125 "id": {
3126 "v_range": [["v6.4.0", "v6.4.0"], ["v6.4.4", ""]],
3127 "type": "integer",
3128 "required": True,
3129 },
3130 "service_id": {
3131 "type": "list",
3132 "elements": "dict",
3133 "children": {
3134 "id": {
3135 "v_range": [["v6.4.4", ""]],
3136 "type": "integer",
3137 "required": True,
3138 }
3139 },
3140 "v_range": [["v6.4.4", ""]],
3141 },
3142 "srcaddr": {
3143 "type": "list",
3144 "elements": "dict",
3145 "children": {
3146 "name": {
3147 "v_range": [["v6.4.0", "v6.4.0"], ["v6.4.4", ""]],
3148 "type": "string",
3149 "required": True,
3150 }
3151 },
3152 "v_range": [["v6.4.0", "v6.4.0"], ["v6.4.4", ""]],
3153 },
3154 "dstaddr": {
3155 "type": "list",
3156 "elements": "dict",
3157 "children": {
3158 "name": {
3159 "v_range": [["v6.4.0", "v6.4.0"], ["v6.4.4", ""]],
3160 "type": "string",
3161 "required": True,
3162 }
3163 },
3164 "v_range": [["v6.4.0", "v6.4.0"], ["v6.4.4", ""]],
3165 },
3166 "srcaddr6": {
3167 "type": "list",
3168 "elements": "dict",
3169 "children": {
3170 "name": {
3171 "v_range": [["v6.4.0", "v6.4.0"], ["v6.4.4", ""]],
3172 "type": "string",
3173 "required": True,
3174 }
3175 },
3176 "v_range": [["v6.4.0", "v6.4.0"], ["v6.4.4", ""]],
3177 },
3178 "dstaddr6": {
3179 "type": "list",
3180 "elements": "dict",
3181 "children": {
3182 "name": {
3183 "v_range": [["v6.4.0", "v6.4.0"], ["v6.4.4", ""]],
3184 "type": "string",
3185 "required": True,
3186 }
3187 },
3188 "v_range": [["v6.4.0", "v6.4.0"], ["v6.4.4", ""]],
3189 },
3190 "srcintf": {
3191 "type": "list",
3192 "elements": "dict",
3193 "children": {
3194 "name": {
3195 "v_range": [["v6.4.0", "v6.4.0"], ["v6.4.4", ""]],
3196 "type": "string",
3197 "required": True,
3198 }
3199 },
3200 "v_range": [["v6.4.0", "v6.4.0"], ["v6.4.4", ""]],
3201 },
3202 "dstintf": {
3203 "type": "list",
3204 "elements": "dict",
3205 "children": {
3206 "name": {
3207 "v_range": [["v6.4.0", "v6.4.0"], ["v6.4.4", ""]],
3208 "type": "string",
3209 "required": True,
3210 }
3211 },
3212 "v_range": [["v6.4.0", "v6.4.0"], ["v6.4.4", ""]],
3213 },
3214 "service": {
3215 "type": "list",
3216 "elements": "dict",
3217 "children": {
3218 "name": {
3219 "v_range": [["v6.4.0", "v6.4.0"], ["v6.4.4", ""]],
3220 "type": "string",
3221 "required": True,
3222 }
3223 },
3224 "v_range": [["v6.4.0", "v6.4.0"], ["v6.4.4", ""]],
3225 },
3226 "packet_duplication": {
3227 "v_range": [["v6.4.0", "v6.4.0"], ["v6.4.4", ""]],
3228 "type": "string",
3229 "options": [
3230 {"value": "disable"},
3231 {"value": "force"},
3232 {"value": "on-demand"},
3233 ],
3234 },
3235 "sla_match_service": {
3236 "v_range": [["v7.2.0", ""]],
3237 "type": "string",
3238 "options": [{"value": "enable"}, {"value": "disable"}],
3239 },
3240 "packet_de_duplication": {
3241 "v_range": [["v6.4.0", "v6.4.0"], ["v6.4.4", ""]],
3242 "type": "string",
3243 "options": [{"value": "enable"}, {"value": "disable"}],
3244 },
3245 },
3246 "v_range": [["v6.4.0", "v6.4.0"], ["v6.4.4", ""]],
3247 },
3248 "health_check_fortiguard": {
3249 "type": "list",
3250 "elements": "dict",
3251 "children": {
3252 "target_name": {
3253 "v_range": [["v7.6.0", "v7.6.0"]],
3254 "type": "string",
3255 "required": True,
3256 },
3257 "probe_packets": {
3258 "v_range": [["v7.6.0", "v7.6.0"]],
3259 "type": "string",
3260 "options": [{"value": "disable"}, {"value": "enable"}],
3261 },
3262 "addr_mode": {
3263 "v_range": [["v7.6.0", "v7.6.0"]],
3264 "type": "string",
3265 "options": [{"value": "ipv4"}, {"value": "ipv6"}],
3266 },
3267 "system_dns": {
3268 "v_range": [["v7.6.0", "v7.6.0"]],
3269 "type": "string",
3270 "options": [{"value": "disable"}, {"value": "enable"}],
3271 },
3272 "server": {
3273 "v_range": [["v7.6.0", "v7.6.0"]],
3274 "type": "list",
3275 "multiple_values": True,
3276 "elements": "str",
3277 },
3278 "detect_mode": {
3279 "v_range": [["v7.6.0", "v7.6.0"]],
3280 "type": "string",
3281 "options": [
3282 {"value": "active"},
3283 {"value": "passive"},
3284 {"value": "prefer-passive"},
3285 {"value": "remote"},
3286 {"value": "agent-based"},
3287 ],
3288 },
3289 "protocol": {
3290 "v_range": [["v7.6.0", "v7.6.0"]],
3291 "type": "string",
3292 "options": [
3293 {"value": "ping"},
3294 {"value": "tcp-echo"},
3295 {"value": "udp-echo"},
3296 {"value": "http"},
3297 {"value": "https"},
3298 {"value": "twamp"},
3299 {"value": "dns"},
3300 {"value": "tcp-connect"},
3301 {"value": "ftp"},
3302 ],
3303 },
3304 "port": {"v_range": [["v7.6.0", "v7.6.0"]], "type": "integer"},
3305 "quality_measured_method": {
3306 "v_range": [["v7.6.0", "v7.6.0"]],
3307 "type": "string",
3308 "options": [{"value": "half-open"}, {"value": "half-close"}],
3309 },
3310 "security_mode": {
3311 "v_range": [["v7.6.0", "v7.6.0"]],
3312 "type": "string",
3313 "options": [{"value": "none"}, {"value": "authentication"}],
3314 },
3315 "user": {"v_range": [["v7.6.0", "v7.6.0"]], "type": "string"},
3316 "password": {"v_range": [["v7.6.0", "v7.6.0"]], "type": "string"},
3317 "packet_size": {"v_range": [["v7.6.0", "v7.6.0"]], "type": "integer"},
3318 "ha_priority": {"v_range": [["v7.6.0", "v7.6.0"]], "type": "integer"},
3319 "ftp_mode": {
3320 "v_range": [["v7.6.0", "v7.6.0"]],
3321 "type": "string",
3322 "options": [{"value": "passive"}, {"value": "port"}],
3323 },
3324 "ftp_file": {"v_range": [["v7.6.0", "v7.6.0"]], "type": "string"},
3325 "http_get": {"v_range": [["v7.6.0", "v7.6.0"]], "type": "string"},
3326 "http_agent": {"v_range": [["v7.6.0", "v7.6.0"]], "type": "string"},
3327 "http_match": {"v_range": [["v7.6.0", "v7.6.0"]], "type": "string"},
3328 "dns_request_domain": {
3329 "v_range": [["v7.6.0", "v7.6.0"]],
3330 "type": "string",
3331 },
3332 "dns_match_ip": {"v_range": [["v7.6.0", "v7.6.0"]], "type": "string"},
3333 "interval": {"v_range": [["v7.6.0", "v7.6.0"]], "type": "integer"},
3334 "probe_timeout": {"v_range": [["v7.6.0", "v7.6.0"]], "type": "integer"},
3335 "failtime": {"v_range": [["v7.6.0", "v7.6.0"]], "type": "integer"},
3336 "recoverytime": {"v_range": [["v7.6.0", "v7.6.0"]], "type": "integer"},
3337 "probe_count": {"v_range": [["v7.6.0", "v7.6.0"]], "type": "integer"},
3338 "diffservcode": {"v_range": [["v7.6.0", "v7.6.0"]], "type": "string"},
3339 "update_cascade_interface": {
3340 "v_range": [["v7.6.0", "v7.6.0"]],
3341 "type": "string",
3342 "options": [{"value": "enable"}, {"value": "disable"}],
3343 },
3344 "update_static_route": {
3345 "v_range": [["v7.6.0", "v7.6.0"]],
3346 "type": "string",
3347 "options": [{"value": "enable"}, {"value": "disable"}],
3348 },
3349 "embed_measured_health": {
3350 "v_range": [["v7.6.0", "v7.6.0"]],
3351 "type": "string",
3352 "options": [{"value": "enable"}, {"value": "disable"}],
3353 },
3354 "sla_id_redistribute": {
3355 "v_range": [["v7.6.0", "v7.6.0"]],
3356 "type": "integer",
3357 },
3358 "sla_fail_log_period": {
3359 "v_range": [["v7.6.0", "v7.6.0"]],
3360 "type": "integer",
3361 },
3362 "sla_pass_log_period": {
3363 "v_range": [["v7.6.0", "v7.6.0"]],
3364 "type": "integer",
3365 },
3366 "threshold_warning_packetloss": {
3367 "v_range": [["v7.6.0", "v7.6.0"]],
3368 "type": "integer",
3369 },
3370 "threshold_alert_packetloss": {
3371 "v_range": [["v7.6.0", "v7.6.0"]],
3372 "type": "integer",
3373 },
3374 "threshold_warning_latency": {
3375 "v_range": [["v7.6.0", "v7.6.0"]],
3376 "type": "integer",
3377 },
3378 "threshold_alert_latency": {
3379 "v_range": [["v7.6.0", "v7.6.0"]],
3380 "type": "integer",
3381 },
3382 "threshold_warning_jitter": {
3383 "v_range": [["v7.6.0", "v7.6.0"]],
3384 "type": "integer",
3385 },
3386 "threshold_alert_jitter": {
3387 "v_range": [["v7.6.0", "v7.6.0"]],
3388 "type": "integer",
3389 },
3390 "vrf": {"v_range": [["v7.6.0", "v7.6.0"]], "type": "integer"},
3391 "source": {"v_range": [["v7.6.0", "v7.6.0"]], "type": "string"},
3392 "source6": {"v_range": [["v7.6.0", "v7.6.0"]], "type": "string"},
3393 "members": {
3394 "type": "list",
3395 "elements": "dict",
3396 "children": {
3397 "seq_num": {
3398 "v_range": [["v7.6.0", "v7.6.0"]],
3399 "type": "integer",
3400 "required": True,
3401 }
3402 },
3403 "v_range": [["v7.6.0", "v7.6.0"]],
3404 },
3405 "mos_codec": {
3406 "v_range": [["v7.6.0", "v7.6.0"]],
3407 "type": "string",
3408 "options": [
3409 {"value": "g711"},
3410 {"value": "g722"},
3411 {"value": "g729"},
3412 ],
3413 },
3414 "class_id": {"v_range": [["v7.6.0", "v7.6.0"]], "type": "integer"},
3415 "sla": {
3416 "type": "list",
3417 "elements": "dict",
3418 "children": {
3419 "id": {
3420 "v_range": [["v7.6.0", "v7.6.0"]],
3421 "type": "integer",
3422 "required": True,
3423 },
3424 "link_cost_factor": {
3425 "v_range": [["v7.6.0", "v7.6.0"]],
3426 "type": "list",
3427 "options": [
3428 {"value": "latency"},
3429 {"value": "jitter"},
3430 {"value": "packet-loss"},
3431 {"value": "mos"},
3432 {"value": "remote"},
3433 ],
3434 "multiple_values": True,
3435 "elements": "str",
3436 },
3437 "latency_threshold": {
3438 "v_range": [["v7.6.0", "v7.6.0"]],
3439 "type": "integer",
3440 },
3441 "jitter_threshold": {
3442 "v_range": [["v7.6.0", "v7.6.0"]],
3443 "type": "integer",
3444 },
3445 "packetloss_threshold": {
3446 "v_range": [["v7.6.0", "v7.6.0"]],
3447 "type": "integer",
3448 },
3449 "mos_threshold": {
3450 "v_range": [["v7.6.0", "v7.6.0"]],
3451 "type": "string",
3452 },
3453 "priority_in_sla": {
3454 "v_range": [["v7.6.0", "v7.6.0"]],
3455 "type": "integer",
3456 },
3457 "priority_out_sla": {
3458 "v_range": [["v7.6.0", "v7.6.0"]],
3459 "type": "integer",
3460 },
3461 },
3462 "v_range": [["v7.6.0", "v7.6.0"]],
3463 },
3464 },
3465 "v_range": [["v7.6.0", "v7.6.0"]],
3466 },
3467 },
3468 }
3469
3470
3471 def main():
3472 module_spec = schema_to_module_spec(versioned_schema)
3473 mkeyname = None
3474 fields = {
3475 "access_token": {"required": False, "type": "str", "no_log": True},
3476 "enable_log": {"required": False, "type": "bool", "default": False},
3477 "vdom": {"required": False, "type": "str", "default": "root"},
3478 "member_path": {"required": False, "type": "str"},
3479 "member_state": {
3480 "type": "str",
3481 "required": False,
3482 "choices": ["present", "absent"],
3483 },
3484 "system_sdwan": {
3485 "required": False,
3486 "type": "dict",
3487 "default": None,
3488 "options": {},
3489 },
3490 }
3491 for attribute_name in module_spec["options"]:
3492 fields["system_sdwan"]["options"][attribute_name] = module_spec["options"][
3493 attribute_name
3494 ]
3495 if mkeyname and mkeyname == attribute_name:
3496 fields["system_sdwan"]["options"][attribute_name]["required"] = True
3497
3498 module = AnsibleModule(argument_spec=fields, supports_check_mode=True)
3499 check_legacy_fortiosapi(module)
3500
3501 is_error = False
3502 has_changed = False
3503 result = None
3504 diff = None
3505
3506 versions_check_result = None
3507 if module._socket_path:
3508 connection = Connection(module._socket_path)
3509 if "access_token" in module.params:
3510 connection.set_custom_option("access_token", module.params["access_token"])
3511
3512 if "enable_log" in module.params:
3513 connection.set_custom_option("enable_log", module.params["enable_log"])
3514 else:
3515 connection.set_custom_option("enable_log", False)
3516 fos = FortiOSHandler(connection, module, mkeyname, admin_passwd_header=False)
3517 versions_check_result = check_schema_versioning(
3518 fos, versioned_schema, "system_sdwan"
3519 )
3520
3521 is_error, has_changed, result, diff = fortios_system(
3522 module.params, fos, module.check_mode
3523 )
3524
3525 else:
3526 module.fail_json(**FAIL_SOCKET_MSG)
3527
3528 if versions_check_result and versions_check_result["matched"] is False:
3529 module.warn(
3530 "Ansible has detected version mismatch between FortOS system and your playbook, see more details by specifying option -vvv"
3531 )
3532
3533 if not is_error:
3534 if versions_check_result and versions_check_result["matched"] is False:
3535 module.exit_json(
3536 changed=has_changed,
3537 version_check_warning=versions_check_result,
3538 meta=result,
3539 diff=diff,
3540 )
3541 else:
3542 module.exit_json(changed=has_changed, meta=result, diff=diff)
3543 else:
3544 if versions_check_result and versions_check_result["matched"] is False:
3545 module.fail_json(
3546 msg="Error in repo",
3547 version_check_warning=versions_check_result,
3548 meta=result,
3549 )
3550 else:
3551 module.fail_json(msg="Error in repo", meta=result)
3552
3553
3554 if __name__ == "__main__":
3555 main()