Debian Codegraph @

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

raw symbols SCIP
1 #!/usr/bin/python
2 from __future__ import absolute_import, division, print_function
3 # Copyright 2019-2024 Fortinet, Inc.
4 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
5
6 __metaclass__ = type
7
8 ANSIBLE_METADATA = {'status': ['preview'],
9 'supported_by': 'community',
10 'metadata_version': '1.1'}
11
12 DOCUMENTATION = '''
13 ---
14 module: fmgr_wanprof_system_virtualwanlink
15 short_description: Configure redundant internet connections using SD-WAN
16 version_added: "2.0.0"
17 extends_documentation_fragment:
18 - fortinet.fortimanager.general
19 - fortinet.fortimanager.general.partial_crud
20 options:
21 adom:
22 description: The parameter (adom) in requested url.
23 type: str
24 required: true
25 wanprof:
26 description: The parameter (wanprof) in requested url.
27 type: str
28 required: true
29 wanprof_system_virtualwanlink:
30 description: The top level parameters set.
31 required: false
32 type: dict
33 suboptions:
34 fail_detect:
35 aliases: ['fail-detect']
36 type: str
37 description: Enable/disable SD-WAN Internet connection status checking
38 choices: ['disable', 'enable']
39 health_check:
40 aliases: ['health-check']
41 type: list
42 elements: dict
43 description: Health check.
44 suboptions:
45 _dynamic_server:
46 aliases: ['_dynamic-server']
47 type: str
48 description: Dynamic server.
49 addr_mode:
50 aliases: ['addr-mode']
51 type: str
52 description: Address mode
53 choices: ['ipv4', 'ipv6']
54 failtime:
55 type: int
56 description: Number of failures before server is considered lost
57 http_agent:
58 aliases: ['http-agent']
59 type: str
60 description: String in the http-agent field in the HTTP header.
61 http_get:
62 aliases: ['http-get']
63 type: str
64 description: URL used to communicate with the server if the protocol if the protocol is HTTP.
65 http_match:
66 aliases: ['http-match']
67 type: str
68 description: Response string expected from the server if the protocol is HTTP.
69 interval:
70 type: int
71 description: Status check interval, or the time between attempting to connect to the server
72 members:
73 type: raw
74 description: (list or str) Member sequence number list.
75 name:
76 type: str
77 description: Status check or health check name.
78 packet_size:
79 aliases: ['packet-size']
80 type: int
81 description: Packet size of a twamp test session,
82 password:
83 type: raw
84 description: (list) Twamp controller password in authentication mode
85 port:
86 type: int
87 description: Port number used to communicate with the server over the selected protocol.
88 protocol:
89 type: str
90 description: Protocol used to determine if the FortiGate can communicate with the server.
91 choices: ['ping', 'tcp-echo', 'udp-echo', 'http', 'twamp', 'ping6', 'dns']
92 recoverytime:
93 type: int
94 description: Number of successful responses received before server is considered recovered
95 security_mode:
96 aliases: ['security-mode']
97 type: str
98 description: Twamp controller security mode.
99 choices: ['none', 'authentication']
100 server:
101 type: raw
102 description: (list) IP address or FQDN name of the server.
103 sla:
104 type: list
105 elements: dict
106 description: Sla.
107 suboptions:
108 id:
109 type: int
110 description: SLA ID.
111 jitter_threshold:
112 aliases: ['jitter-threshold']
113 type: int
114 description: Jitter for SLA to make decision in milliseconds.
115 latency_threshold:
116 aliases: ['latency-threshold']
117 type: int
118 description: Latency for SLA to make decision in milliseconds.
119 link_cost_factor:
120 aliases: ['link-cost-factor']
121 type: list
122 elements: str
123 description: Criteria on which to base link selection.
124 choices: ['latency', 'jitter', 'packet-loss']
125 packetloss_threshold:
126 aliases: ['packetloss-threshold']
127 type: int
128 description: Packet loss for SLA to make decision in percentage.
129 threshold_alert_jitter:
130 aliases: ['threshold-alert-jitter']
131 type: int
132 description: Alert threshold for jitter
133 threshold_alert_latency:
134 aliases: ['threshold-alert-latency']
135 type: int
136 description: Alert threshold for latency
137 threshold_alert_packetloss:
138 aliases: ['threshold-alert-packetloss']
139 type: int
140 description: Alert threshold for packet loss
141 threshold_warning_jitter:
142 aliases: ['threshold-warning-jitter']
143 type: int
144 description: Warning threshold for jitter
145 threshold_warning_latency:
146 aliases: ['threshold-warning-latency']
147 type: int
148 description: Warning threshold for latency
149 threshold_warning_packetloss:
150 aliases: ['threshold-warning-packetloss']
151 type: int
152 description: Warning threshold for packet loss
153 update_cascade_interface:
154 aliases: ['update-cascade-interface']
155 type: str
156 description: Enable/disable update cascade interface.
157 choices: ['disable', 'enable']
158 update_static_route:
159 aliases: ['update-static-route']
160 type: str
161 description: Enable/disable updating the static route.
162 choices: ['disable', 'enable']
163 internet_service_id:
164 aliases: ['internet-service-id']
165 type: str
166 description: Internet service ID.
167 probe_packets:
168 aliases: ['probe-packets']
169 type: str
170 description: Enable/disable transmission of probe packets.
171 choices: ['disable', 'enable']
172 sla_fail_log_period:
173 aliases: ['sla-fail-log-period']
174 type: int
175 description: Time interval in seconds that SLA fail log messages will be generated
176 sla_pass_log_period:
177 aliases: ['sla-pass-log-period']
178 type: int
179 description: Time interval in seconds that SLA pass log messages will be generated
180 timeout:
181 type: int
182 description: How long to wait before not receiving a reply from the server to consider the connetion attempt a failure
183 ha_priority:
184 aliases: ['ha-priority']
185 type: int
186 description: HA election priority
187 diffservcode:
188 type: str
189 description: Differentiated services code point
190 probe_timeout:
191 aliases: ['probe-timeout']
192 type: int
193 description: Time to wait before a probe packet is considered lost
194 dns_request_domain:
195 aliases: ['dns-request-domain']
196 type: str
197 description: Fully qualified domain name to resolve for the DNS probe.
198 probe_count:
199 aliases: ['probe-count']
200 type: int
201 description: Number of most recent probes that should be used to calculate latency and jitter
202 system_dns:
203 aliases: ['system-dns']
204 type: str
205 description: Enable/disable system DNS as the probe server.
206 choices: ['disable', 'enable']
207 load_balance_mode:
208 aliases: ['load-balance-mode']
209 type: str
210 description: Algorithm or mode to use for load balancing Internet traffic to SD-WAN members.
211 choices: ['source-ip-based', 'weight-based', 'usage-based',
212 'source-dest-ip-based', 'measured-volume-based']
213 members:
214 type: list
215 elements: dict
216 description: Members.
217 suboptions:
218 _dynamic_member:
219 aliases: ['_dynamic-member']
220 type: str
221 description: Dynamic member.
222 comment:
223 type: str
224 description: Comments.
225 gateway:
226 type: str
227 description: The default gateway for this interface.
228 gateway6:
229 type: str
230 description: IPv6 gateway.
231 ingress_spillover_threshold:
232 aliases: ['ingress-spillover-threshold']
233 type: int
234 description: Ingress spillover threshold for this interface
235 interface:
236 type: str
237 description: Interface name.
238 priority:
239 type: int
240 description: Priority of the interface
241 seq_num:
242 aliases: ['seq-num']
243 type: int
244 description: Sequence number
245 source:
246 type: str
247 description: Source IP address used in the health-check packet to the server.
248 source6:
249 type: str
250 description: Source IPv6 address used in the health-check packet to the server.
251 spillover_threshold:
252 aliases: ['spillover-threshold']
253 type: int
254 description: Egress spillover threshold for this interface
255 status:
256 type: str
257 description: Enable/disable this interface in the SD-WAN.
258 choices: ['disable', 'enable']
259 volume_ratio:
260 aliases: ['volume-ratio']
261 type: int
262 description: Measured volume ratio
263 weight:
264 type: int
265 description: Weight of this interface for weighted load balancing.
266 cost:
267 type: int
268 description: Cost of this interface for services in SLA mode
269 service:
270 type: list
271 elements: dict
272 description: Service.
273 suboptions:
274 addr_mode:
275 aliases: ['addr-mode']
276 type: str
277 description: Address mode
278 choices: ['ipv4', 'ipv6']
279 bandwidth_weight:
280 aliases: ['bandwidth-weight']
281 type: int
282 description: Coefficient of reciprocal of available bidirectional bandwidth in the formula of custom-profile-1.
283 default:
284 type: str
285 description: Enable/disable use of SD-WAN as default service.
286 choices: ['disable', 'enable']
287 dscp_forward:
288 aliases: ['dscp-forward']
289 type: str
290 description: Enable/disable forward traffic DSCP tag.
291 choices: ['disable', 'enable']
292 dscp_forward_tag:
293 aliases: ['dscp-forward-tag']
294 type: str
295 description: Forward traffic DSCP tag.
296 dscp_reverse:
297 aliases: ['dscp-reverse']
298 type: str
299 description: Enable/disable reverse traffic DSCP tag.
300 choices: ['disable', 'enable']
301 dscp_reverse_tag:
302 aliases: ['dscp-reverse-tag']
303 type: str
304 description: Reverse traffic DSCP tag.
305 dst:
306 type: raw
307 description: (list or str) Destination address name.
308 dst_negate:
309 aliases: ['dst-negate']
310 type: str
311 description: Enable/disable negation of destination address match.
312 choices: ['disable', 'enable']
313 dst6:
314 type: raw
315 description: (list or str) Destination address6 name.
316 end_port:
317 aliases: ['end-port']
318 type: int
319 description: End destination port number.
320 gateway:
321 type: str
322 description: Enable/disable SD-WAN service gateway.
323 choices: ['disable', 'enable']
324 groups:
325 type: raw
326 description: (list or str) User groups.
327 health_check:
328 aliases: ['health-check']
329 type: str
330 description: Health check.
331 hold_down_time:
332 aliases: ['hold-down-time']
333 type: int
334 description: Waiting period in seconds when switching from the back-up member to the primary member
335 id:
336 type: int
337 description: Priority rule ID
338 internet_service:
339 aliases: ['internet-service']
340 type: str
341 description: Enable/disable use of Internet service for application-based load balancing.
342 choices: ['disable', 'enable']
343 internet_service_ctrl:
344 aliases: ['internet-service-ctrl']
345 type: raw
346 description: (list) Control-based Internet Service ID list.
347 internet_service_ctrl_group:
348 aliases: ['internet-service-ctrl-group']
349 type: raw
350 description: (list or str) Control-based Internet Service group list.
351 internet_service_custom:
352 aliases: ['internet-service-custom']
353 type: raw
354 description: (list or str) Custom Internet service name list.
355 internet_service_custom_group:
356 aliases: ['internet-service-custom-group']
357 type: raw
358 description: (list or str) Custom Internet Service group list.
359 internet_service_group:
360 aliases: ['internet-service-group']
361 type: raw
362 description: (list or str) Internet Service group list.
363 internet_service_id:
364 aliases: ['internet-service-id']
365 type: raw
366 description: (list or str) Internet service ID list.
367 jitter_weight:
368 aliases: ['jitter-weight']
369 type: int
370 description: Coefficient of jitter in the formula of custom-profile-1.
371 latency_weight:
372 aliases: ['latency-weight']
373 type: int
374 description: Coefficient of latency in the formula of custom-profile-1.
375 link_cost_factor:
376 aliases: ['link-cost-factor']
377 type: str
378 description: Link cost factor.
379 choices: ['latency', 'jitter', 'packet-loss', 'inbandwidth',
380 'outbandwidth', 'bibandwidth', 'custom-profile-1']
381 link_cost_threshold:
382 aliases: ['link-cost-threshold']
383 type: int
384 description: Percentage threshold change of link cost values that will result in policy route regeneration
385 member:
386 type: str
387 description: Member sequence number.
388 mode:
389 type: str
390 description: Control how the priority rule sets the priority of interfaces in the SD-WAN.
391 choices: ['auto', 'manual', 'priority', 'sla', 'load-balance']
392 name:
393 type: str
394 description: Priority rule name.
395 packet_loss_weight:
396 aliases: ['packet-loss-weight']
397 type: int
398 description: Coefficient of packet-loss in the formula of custom-profile-1.
399 priority_members:
400 aliases: ['priority-members']
401 type: raw
402 description: (list or str) Member sequence number list.
403 protocol:
404 type: int
405 description: Protocol number.
406 quality_link:
407 aliases: ['quality-link']
408 type: int
409 description: Quality grade.
410 route_tag:
411 aliases: ['route-tag']
412 type: int
413 description: IPv4 route map route-tag.
414 sla:
415 type: list
416 elements: dict
417 description: Sla.
418 suboptions:
419 health_check:
420 aliases: ['health-check']
421 type: str
422 description: Virtual WAN Link health-check.
423 id:
424 type: int
425 description: SLA ID.
426 src:
427 type: raw
428 description: (list or str) Source address name.
429 src_negate:
430 aliases: ['src-negate']
431 type: str
432 description: Enable/disable negation of source address match.
433 choices: ['disable', 'enable']
434 src6:
435 type: raw
436 description: (list or str) Source address6 name.
437 start_port:
438 aliases: ['start-port']
439 type: int
440 description: Start destination port number.
441 status:
442 type: str
443 description: Enable/disable SD-WAN service.
444 choices: ['disable', 'enable']
445 tos:
446 type: str
447 description: Type of service bit pattern.
448 tos_mask:
449 aliases: ['tos-mask']
450 type: str
451 description: Type of service evaluated bits.
452 users:
453 type: raw
454 description: (list or str) User name.
455 internet_service_app_ctrl:
456 aliases: ['internet-service-app-ctrl']
457 type: raw
458 description: (list) Application control based Internet Service ID list.
459 internet_service_app_ctrl_group:
460 aliases: ['internet-service-app-ctrl-group']
461 type: raw
462 description: (list or str) Application control based Internet Service group list.
463 role:
464 type: str
465 description: Service role to work with neighbor.
466 choices: ['primary', 'secondary', 'standalone']
467 sla_compare_method:
468 aliases: ['sla-compare-method']
469 type: str
470 description: Method to compare SLA value for sla and load balance mode.
471 choices: ['order', 'number']
472 standalone_action:
473 aliases: ['standalone-action']
474 type: str
475 description: Enable/disable service when selected neighbor role is standalone while service role is not standalone.
476 choices: ['disable', 'enable']
477 input_device:
478 aliases: ['input-device']
479 type: raw
480 description: (list or str) Source interface name.
481 internet_service_name:
482 aliases: ['internet-service-name']
483 type: str
484 description: Internet service name list.
485 input_device_negate:
486 aliases: ['input-device-negate']
487 type: str
488 description: Enable/disable negation of input device match.
489 choices: ['disable', 'enable']
490 status:
491 type: str
492 description: Enable/disable SD-WAN.
493 choices: ['disable', 'enable']
494 neighbor:
495 type: list
496 elements: dict
497 description: Neighbor.
498 suboptions:
499 health_check:
500 aliases: ['health-check']
501 type: str
502 description: SD-WAN health-check name.
503 ip:
504 type: str
505 description: IP address of neighbor.
506 member:
507 type: str
508 description: Member sequence number.
509 role:
510 type: str
511 description: Role of neighbor.
512 choices: ['primary', 'secondary', 'standalone']
513 sla_id:
514 aliases: ['sla-id']
515 type: int
516 description: SLA ID.
517 neighbor_hold_boot_time:
518 aliases: ['neighbor-hold-boot-time']
519 type: int
520 description: Waiting period in seconds when switching from the primary neighbor to the secondary neighbor from the neighbor start.
521 neighbor_hold_down:
522 aliases: ['neighbor-hold-down']
523 type: str
524 description: Enable/disable hold switching from the secondary neighbor to the primary neighbor.
525 choices: ['disable', 'enable']
526 neighbor_hold_down_time:
527 aliases: ['neighbor-hold-down-time']
528 type: int
529 description: Waiting period in seconds when switching from the secondary neighbor to the primary neighbor when hold-down is disabled.
530 fail_alert_interfaces:
531 aliases: ['fail-alert-interfaces']
532 type: raw
533 description: (list) Physical interfaces that will be alerted.
534 '''
535
536 EXAMPLES = '''
537 - name: Example playbook (generated based on argument schema)
538 hosts: fortimanagers
539 connection: httpapi
540 gather_facts: false
541 tasks:
542 - name: Configure redundant internet connections using SD-WAN
543 fortinet.fortimanager.fmgr_wanprof_system_virtualwanlink:
544 # workspace_locking_adom: <global or your adom name>
545 adom: <your own value>
546 wanprof: <your own value>
547 wanprof_system_virtualwanlink:
548 # fail_detect: <value in [disable, enable]>
549 # health_check:
550 # - _dynamic_server: <string>
551 # addr_mode: <value in [ipv4, ipv6]>
552 # failtime: <integer>
553 # http_agent: <string>
554 # http_get: <string>
555 # http_match: <string>
556 # interval: <integer>
557 # members: <list or string>
558 # name: <string>
559 # packet_size: <integer>
560 # password: <list or string>
561 # port: <integer>
562 # protocol: <value in [ping, tcp-echo, udp-echo, ...]>
563 # recoverytime: <integer>
564 # security_mode: <value in [none, authentication]>
565 # server: <list or string>
566 # sla:
567 # - id: <integer>
568 # jitter_threshold: <integer>
569 # latency_threshold: <integer>
570 # link_cost_factor: ["latency", "jitter", "packet-loss"]
571 # packetloss_threshold: <integer>
572 # threshold_alert_jitter: <integer>
573 # threshold_alert_latency: <integer>
574 # threshold_alert_packetloss: <integer>
575 # threshold_warning_jitter: <integer>
576 # threshold_warning_latency: <integer>
577 # threshold_warning_packetloss: <integer>
578 # update_cascade_interface: <value in [disable, enable]>
579 # update_static_route: <value in [disable, enable]>
580 # internet_service_id: <string>
581 # probe_packets: <value in [disable, enable]>
582 # sla_fail_log_period: <integer>
583 # sla_pass_log_period: <integer>
584 # timeout: <integer>
585 # ha_priority: <integer>
586 # diffservcode: <string>
587 # probe_timeout: <integer>
588 # dns_request_domain: <string>
589 # probe_count: <integer>
590 # system_dns: <value in [disable, enable]>
591 # load_balance_mode: <value in [source-ip-based, weight-based, usage-based, ...]>
592 # members:
593 # - _dynamic_member: <string>
594 # comment: <string>
595 # gateway: <string>
596 # gateway6: <string>
597 # ingress_spillover_threshold: <integer>
598 # interface: <string>
599 # priority: <integer>
600 # seq_num: <integer>
601 # source: <string>
602 # source6: <string>
603 # spillover_threshold: <integer>
604 # status: <value in [disable, enable]>
605 # volume_ratio: <integer>
606 # weight: <integer>
607 # cost: <integer>
608 # service:
609 # - addr_mode: <value in [ipv4, ipv6]>
610 # bandwidth_weight: <integer>
611 # default: <value in [disable, enable]>
612 # dscp_forward: <value in [disable, enable]>
613 # dscp_forward_tag: <string>
614 # dscp_reverse: <value in [disable, enable]>
615 # dscp_reverse_tag: <string>
616 # dst: <list or string>
617 # dst_negate: <value in [disable, enable]>
618 # dst6: <list or string>
619 # end_port: <integer>
620 # gateway: <value in [disable, enable]>
621 # groups: <list or string>
622 # health_check: <string>
623 # hold_down_time: <integer>
624 # id: <integer>
625 # internet_service: <value in [disable, enable]>
626 # internet_service_ctrl: <list or integer>
627 # internet_service_ctrl_group: <list or string>
628 # internet_service_custom: <list or string>
629 # internet_service_custom_group: <list or string>
630 # internet_service_group: <list or string>
631 # internet_service_id: <list or string>
632 # jitter_weight: <integer>
633 # latency_weight: <integer>
634 # link_cost_factor: <value in [latency, jitter, packet-loss, ...]>
635 # link_cost_threshold: <integer>
636 # member: <string>
637 # mode: <value in [auto, manual, priority, ...]>
638 # name: <string>
639 # packet_loss_weight: <integer>
640 # priority_members: <list or string>
641 # protocol: <integer>
642 # quality_link: <integer>
643 # route_tag: <integer>
644 # sla:
645 # - health_check: <string>
646 # id: <integer>
647 # src: <list or string>
648 # src_negate: <value in [disable, enable]>
649 # src6: <list or string>
650 # start_port: <integer>
651 # status: <value in [disable, enable]>
652 # tos: <string>
653 # tos_mask: <string>
654 # users: <list or string>
655 # internet_service_app_ctrl: <list or integer>
656 # internet_service_app_ctrl_group: <list or string>
657 # role: <value in [primary, secondary, standalone]>
658 # sla_compare_method: <value in [order, number]>
659 # standalone_action: <value in [disable, enable]>
660 # input_device: <list or string>
661 # internet_service_name: <string>
662 # input_device_negate: <value in [disable, enable]>
663 # status: <value in [disable, enable]>
664 # neighbor:
665 # - health_check: <string>
666 # ip: <string>
667 # member: <string>
668 # role: <value in [primary, secondary, standalone]>
669 # sla_id: <integer>
670 # neighbor_hold_boot_time: <integer>
671 # neighbor_hold_down: <value in [disable, enable]>
672 # neighbor_hold_down_time: <integer>
673 # fail_alert_interfaces: <list or string>
674 '''
675
676 RETURN = '''
677 meta:
678 description: The result of the request.
679 type: dict
680 returned: always
681 contains:
682 request_url:
683 description: The full url requested.
684 returned: always
685 type: str
686 sample: /sys/login/user
687 response_code:
688 description: The status of api request.
689 returned: always
690 type: int
691 sample: 0
692 response_data:
693 description: The api response.
694 type: list
695 returned: always
696 response_message:
697 description: The descriptive message of the api response.
698 type: str
699 returned: always
700 sample: OK.
701 system_information:
702 description: The information of the target system.
703 type: dict
704 returned: always
705 rc:
706 description: The status the request.
707 type: int
708 returned: always
709 sample: 0
710 version_check_warning:
711 description: Warning if the parameters used in the playbook are not supported by the current FortiManager version.
712 type: list
713 returned: complex
714 '''
715 from ansible.module_utils.basic import AnsibleModule
716 from ansible.module_utils.connection import Connection
717 from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass
718 from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec
719
720
721 def main():
722 urls_list = [
723 '/pm/config/adom/{adom}/wanprof/{wanprof}/system/virtual-wan-link'
724 ]
725 module_arg_spec = {
726 'adom': {'required': True, 'type': 'str'},
727 'wanprof': {'required': True, 'type': 'str'},
728 'wanprof_system_virtualwanlink': {
729 'type': 'dict', 'v_range': [['6.0.0', '7.6.2']],
730 'options': {
731 'fail-detect': {'v_range': [['6.0.0', '7.6.2']], 'choices': ['disable', 'enable'], 'type': 'str'},
732 'health-check': {
733 'v_range': [['6.0.0', '7.6.2']],
734 'type': 'list',
735 'options': {
736 '_dynamic-server': {'v_range': [['6.0.0', '6.4.15']], 'type': 'str'},
737 'addr-mode': {'v_range': [['6.0.0', '7.6.2']], 'choices': ['ipv4', 'ipv6'], 'type': 'str'},
738 'failtime': {'v_range': [['6.0.0', '7.6.2']], 'type': 'int'},
739 'http-agent': {'v_range': [['6.0.0', '7.6.2']], 'type': 'str'},
740 'http-get': {'v_range': [['6.0.0', '7.6.2']], 'type': 'str'},
741 'http-match': {'v_range': [['6.0.0', '7.6.2']], 'type': 'str'},
742 'interval': {'v_range': [['6.0.0', '7.6.2']], 'type': 'int'},
743 'members': {'v_range': [['6.0.0', '7.6.2']], 'type': 'raw'},
744 'name': {'v_range': [['6.0.0', '7.6.2']], 'type': 'str'},
745 'packet-size': {'v_range': [['6.0.0', '7.6.2']], 'type': 'int'},
746 'password': {'v_range': [['6.0.0', '7.6.2']], 'no_log': True, 'type': 'raw'},
747 'port': {'v_range': [['6.0.0', '7.6.2']], 'type': 'int'},
748 'protocol': {
749 'v_range': [['6.0.0', '7.6.2']],
750 'choices': ['ping', 'tcp-echo', 'udp-echo', 'http', 'twamp', 'ping6', 'dns'],
751 'type': 'str'
752 },
753 'recoverytime': {'v_range': [['6.0.0', '7.6.2']], 'type': 'int'},
754 'security-mode': {'v_range': [['6.0.0', '7.6.2']], 'choices': ['none', 'authentication'], 'type': 'str'},
755 'server': {'v_range': [['6.0.0', '7.6.2']], 'type': 'raw'},
756 'sla': {
757 'v_range': [['6.0.0', '7.6.2']],
758 'type': 'list',
759 'options': {
760 'id': {'v_range': [['6.0.0', '7.6.2']], 'type': 'int'},
761 'jitter-threshold': {'v_range': [['6.0.0', '7.6.2']], 'type': 'int'},
762 'latency-threshold': {'v_range': [['6.0.0', '7.6.2']], 'type': 'int'},
763 'link-cost-factor': {
764 'v_range': [['6.0.0', '7.6.2']],
765 'type': 'list',
766 'choices': ['latency', 'jitter', 'packet-loss'],
767 'elements': 'str'
768 },
769 'packetloss-threshold': {'v_range': [['6.0.0', '7.6.2']], 'type': 'int'}
770 },
771 'elements': 'dict'
772 },
773 'threshold-alert-jitter': {'v_range': [['6.0.0', '7.6.2']], 'type': 'int'},
774 'threshold-alert-latency': {'v_range': [['6.0.0', '7.6.2']], 'type': 'int'},
775 'threshold-alert-packetloss': {'v_range': [['6.0.0', '7.6.2']], 'type': 'int'},
776 'threshold-warning-jitter': {'v_range': [['6.0.0', '7.6.2']], 'type': 'int'},
777 'threshold-warning-latency': {'v_range': [['6.0.0', '7.6.2']], 'type': 'int'},
778 'threshold-warning-packetloss': {'v_range': [['6.0.0', '7.6.2']], 'type': 'int'},
779 'update-cascade-interface': {'v_range': [['6.0.0', '7.6.2']], 'choices': ['disable', 'enable'], 'type': 'str'},
780 'update-static-route': {'v_range': [['6.0.0', '7.6.2']], 'choices': ['disable', 'enable'], 'type': 'str'},
781 'internet-service-id': {'v_range': [['6.2.0', '7.2.0']], 'type': 'str'},
782 'probe-packets': {'v_range': [['6.2.0', '7.6.2']], 'choices': ['disable', 'enable'], 'type': 'str'},
783 'sla-fail-log-period': {'v_range': [['6.2.0', '7.6.2']], 'type': 'int'},
784 'sla-pass-log-period': {'v_range': [['6.2.0', '7.6.2']], 'no_log': True, 'type': 'int'},
785 'timeout': {'v_range': [['6.2.0', '6.4.15']], 'type': 'int'},
786 'ha-priority': {'v_range': [['6.2.2', '7.6.2']], 'type': 'int'},
787 'diffservcode': {'v_range': [['6.2.5', '7.6.2']], 'type': 'str'},
788 'probe-timeout': {'v_range': [['6.2.5', '7.6.2']], 'type': 'int'},
789 'dns-request-domain': {'v_range': [['6.4.0', '6.4.0']], 'type': 'str'},
790 'probe-count': {'v_range': [['6.4.0', '6.4.0']], 'type': 'int'},
791 'system-dns': {'v_range': [['6.4.0', '6.4.0']], 'choices': ['disable', 'enable'], 'type': 'str'}
792 },
793 'elements': 'dict'
794 },
795 'load-balance-mode': {
796 'v_range': [['6.0.0', '7.6.2']],
797 'choices': ['source-ip-based', 'weight-based', 'usage-based', 'source-dest-ip-based', 'measured-volume-based'],
798 'type': 'str'
799 },
800 'members': {
801 'v_range': [['6.0.0', '7.6.2']],
802 'type': 'list',
803 'options': {
804 '_dynamic-member': {'v_range': [['6.0.0', '6.4.15']], 'type': 'str'},
805 'comment': {'v_range': [['6.0.0', '7.6.2']], 'type': 'str'},
806 'gateway': {'v_range': [['6.0.0', '7.6.2']], 'type': 'str'},
807 'gateway6': {'v_range': [['6.0.0', '7.6.2']], 'type': 'str'},
808 'ingress-spillover-threshold': {'v_range': [['6.0.0', '7.6.2']], 'type': 'int'},
809 'interface': {'v_range': [['6.0.0', '7.6.2']], 'type': 'str'},
810 'priority': {'v_range': [['6.0.0', '7.6.2']], 'type': 'int'},
811 'seq-num': {'v_range': [['6.0.0', '7.6.2']], 'type': 'int'},
812 'source': {'v_range': [['6.0.0', '7.6.2']], 'type': 'str'},
813 'source6': {'v_range': [['6.0.0', '7.6.2']], 'type': 'str'},
814 'spillover-threshold': {'v_range': [['6.0.0', '7.6.2']], 'type': 'int'},
815 'status': {'v_range': [['6.0.0', '7.6.2']], 'choices': ['disable', 'enable'], 'type': 'str'},
816 'volume-ratio': {'v_range': [['6.0.0', '7.6.2']], 'type': 'int'},
817 'weight': {'v_range': [['6.0.0', '7.6.2']], 'type': 'int'},
818 'cost': {'v_range': [['6.2.0', '7.6.2']], 'type': 'int'}
819 },
820 'elements': 'dict'
821 },
822 'service': {
823 'v_range': [['6.0.0', '7.6.2']],
824 'type': 'list',
825 'options': {
826 'addr-mode': {'v_range': [['6.0.0', '7.6.2']], 'choices': ['ipv4', 'ipv6'], 'type': 'str'},
827 'bandwidth-weight': {'v_range': [['6.0.0', '7.6.2']], 'type': 'int'},
828 'default': {'v_range': [['6.0.0', '7.6.2']], 'choices': ['disable', 'enable'], 'type': 'str'},
829 'dscp-forward': {'v_range': [['6.0.0', '7.6.2']], 'choices': ['disable', 'enable'], 'type': 'str'},
830 'dscp-forward-tag': {'v_range': [['6.0.0', '7.6.2']], 'type': 'str'},
831 'dscp-reverse': {'v_range': [['6.0.0', '7.6.2']], 'choices': ['disable', 'enable'], 'type': 'str'},
832 'dscp-reverse-tag': {'v_range': [['6.0.0', '7.6.2']], 'type': 'str'},
833 'dst': {'v_range': [['6.0.0', '7.6.2']], 'type': 'raw'},
834 'dst-negate': {'v_range': [['6.0.0', '7.6.2']], 'choices': ['disable', 'enable'], 'type': 'str'},
835 'dst6': {'v_range': [['6.0.0', '7.6.2']], 'type': 'raw'},
836 'end-port': {'v_range': [['6.0.0', '7.6.2']], 'type': 'int'},
837 'gateway': {'v_range': [['6.0.0', '7.6.2']], 'choices': ['disable', 'enable'], 'type': 'str'},
838 'groups': {'v_range': [['6.0.0', '7.6.2']], 'type': 'raw'},
839 'health-check': {'v_range': [['6.0.0', '7.6.2']], 'type': 'str'},
840 'hold-down-time': {'v_range': [['6.0.0', '7.6.2']], 'type': 'int'},
841 'id': {'v_range': [['6.0.0', '7.6.2']], 'type': 'int'},
842 'internet-service': {'v_range': [['6.0.0', '7.6.2']], 'choices': ['disable', 'enable'], 'type': 'str'},
843 'internet-service-ctrl': {'v_range': [['6.0.0', '7.2.1']], 'type': 'raw'},
844 'internet-service-ctrl-group': {'v_range': [['6.0.0', '7.2.1']], 'type': 'raw'},
845 'internet-service-custom': {'v_range': [['6.0.0', '7.6.2']], 'type': 'raw'},
846 'internet-service-custom-group': {'v_range': [['6.0.0', '7.6.2']], 'type': 'raw'},
847 'internet-service-group': {'v_range': [['6.0.0', '7.6.2']], 'type': 'raw'},
848 'internet-service-id': {'v_range': [['6.0.0', '7.6.2']], 'type': 'raw'},
849 'jitter-weight': {'v_range': [['6.0.0', '7.6.2']], 'type': 'int'},
850 'latency-weight': {'v_range': [['6.0.0', '7.6.2']], 'type': 'int'},
851 'link-cost-factor': {
852 'v_range': [['6.0.0', '7.6.2']],
853 'choices': ['latency', 'jitter', 'packet-loss', 'inbandwidth', 'outbandwidth', 'bibandwidth', 'custom-profile-1'],
854 'type': 'str'
855 },
856 'link-cost-threshold': {'v_range': [['6.0.0', '7.6.2']], 'type': 'int'},
857 'member': {'v_range': [['6.0.0', '7.2.1']], 'type': 'str'},
858 'mode': {'v_range': [['6.0.0', '7.6.2']], 'choices': ['auto', 'manual', 'priority', 'sla', 'load-balance'], 'type': 'str'},
859 'name': {'v_range': [['6.0.0', '7.6.2']], 'type': 'str'},
860 'packet-loss-weight': {'v_range': [['6.0.0', '7.6.2']], 'type': 'int'},
861 'priority-members': {'v_range': [['6.0.0', '7.6.2']], 'type': 'raw'},
862 'protocol': {'v_range': [['6.0.0', '7.6.2']], 'type': 'int'},
863 'quality-link': {'v_range': [['6.0.0', '7.6.2']], 'type': 'int'},
864 'route-tag': {'v_range': [['6.0.0', '7.6.2']], 'type': 'int'},
865 'sla': {
866 'v_range': [['6.0.0', '7.6.2']],
867 'type': 'list',
868 'options': {
869 'health-check': {'v_range': [['6.0.0', '7.6.2']], 'type': 'str'},
870 'id': {'v_range': [['6.0.0', '7.6.2']], 'type': 'int'}
871 },
872 'elements': 'dict'
873 },
874 'src': {'v_range': [['6.0.0', '7.6.2']], 'type': 'raw'},
875 'src-negate': {'v_range': [['6.0.0', '7.6.2']], 'choices': ['disable', 'enable'], 'type': 'str'},
876 'src6': {'v_range': [['6.0.0', '7.6.2']], 'type': 'raw'},
877 'start-port': {'v_range': [['6.0.0', '7.6.2']], 'type': 'int'},
878 'status': {'v_range': [['6.0.0', '7.6.2']], 'choices': ['disable', 'enable'], 'type': 'str'},
879 'tos': {'v_range': [['6.0.0', '7.6.2']], 'type': 'str'},
880 'tos-mask': {'v_range': [['6.0.0', '7.6.2']], 'type': 'str'},
881 'users': {'v_range': [['6.0.0', '7.6.2']], 'type': 'raw'},
882 'internet-service-app-ctrl': {'v_range': [['6.2.0', '7.6.2']], 'type': 'raw'},
883 'internet-service-app-ctrl-group': {'v_range': [['6.2.0', '7.6.2']], 'type': 'raw'},
884 'role': {'v_range': [['6.2.1', '7.6.2']], 'choices': ['primary', 'secondary', 'standalone'], 'type': 'str'},
885 'sla-compare-method': {'v_range': [['6.2.1', '7.6.2']], 'choices': ['order', 'number'], 'type': 'str'},
886 'standalone-action': {'v_range': [['6.2.1', '7.6.2']], 'choices': ['disable', 'enable'], 'type': 'str'},
887 'input-device': {'v_range': [['6.2.2', '7.6.2']], 'type': 'raw'},
888 'internet-service-name': {'v_range': [['6.4.0', '6.4.0']], 'type': 'str'},
889 'input-device-negate': {'v_range': [['6.4.1', '7.6.2']], 'choices': ['disable', 'enable'], 'type': 'str'}
890 },
891 'elements': 'dict'
892 },
893 'status': {'v_range': [['6.0.0', '7.6.2']], 'choices': ['disable', 'enable'], 'type': 'str'},
894 'neighbor': {
895 'v_range': [['6.2.1', '7.6.2']],
896 'type': 'list',
897 'options': {
898 'health-check': {'v_range': [['6.2.1', '7.6.2']], 'type': 'str'},
899 'ip': {'v_range': [['6.2.1', '7.6.2']], 'type': 'str'},
900 'member': {'v_range': [['6.2.1', '7.6.2']], 'type': 'str'},
901 'role': {'v_range': [['6.2.1', '7.6.2']], 'choices': ['primary', 'secondary', 'standalone'], 'type': 'str'},
902 'sla-id': {'v_range': [['6.2.1', '7.6.2']], 'type': 'int'}
903 },
904 'elements': 'dict'
905 },
906 'neighbor-hold-boot-time': {'v_range': [['6.2.1', '7.6.2']], 'type': 'int'},
907 'neighbor-hold-down': {'v_range': [['6.2.1', '7.6.2']], 'choices': ['disable', 'enable'], 'type': 'str'},
908 'neighbor-hold-down-time': {'v_range': [['6.2.1', '7.6.2']], 'type': 'int'},
909 'fail-alert-interfaces': {'v_range': [['7.2.3', '7.6.2']], 'type': 'raw'}
910 }
911 }
912 }
913
914 module_option_spec = get_module_arg_spec('partial crud')
915 module_arg_spec.update(module_option_spec)
916 check_galaxy_version(module_arg_spec)
917 module = AnsibleModule(argument_spec=check_parameter_bypass(module_arg_spec, 'wanprof_system_virtualwanlink'),
918 supports_check_mode=True)
919 if not module._socket_path:
920 module.fail_json(msg='MUST RUN IN HTTPAPI MODE')
921 connection = Connection(module._socket_path)
922 fmgr = NAPIManager('partial crud', module_arg_spec, urls_list,
923 None, 'data', module, connection)
924 fmgr.process_partial_crud()
925 module.exit_json(meta=module.params)
926
927
928 if __name__ == '__main__':
929 main()