Debian Codegraph @

ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_firewall_vip_quic.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_firewall_vip_quic
15 short_description: QUIC setting.
16 version_added: "2.3.0"
17 extends_documentation_fragment:
18 - fortinet.fortimanager.general
19 - fortinet.fortimanager.general.partial_crud
20 options:
21 revision_note:
22 description: The change note that can be specified when an object is created or updated.
23 type: str
24 adom:
25 description: The parameter (adom) in requested url.
26 type: str
27 required: true
28 vip:
29 description: The parameter (vip) in requested url.
30 type: str
31 required: true
32 firewall_vip_quic:
33 description: The top level parameters set.
34 required: false
35 type: dict
36 suboptions:
37 ack_delay_exponent:
38 aliases: ['ack-delay-exponent']
39 type: int
40 description: ACK delay exponent
41 active_connection_id_limit:
42 aliases: ['active-connection-id-limit']
43 type: int
44 description: Active connection ID limit
45 active_migration:
46 aliases: ['active-migration']
47 type: str
48 description: Enable/disable active migration
49 choices: ['disable', 'enable']
50 grease_quic_bit:
51 aliases: ['grease-quic-bit']
52 type: str
53 description: Enable/disable grease QUIC bit
54 choices: ['disable', 'enable']
55 max_ack_delay:
56 aliases: ['max-ack-delay']
57 type: int
58 description: Maximum ACK delay in milliseconds
59 max_datagram_frame_size:
60 aliases: ['max-datagram-frame-size']
61 type: int
62 description: Maximum datagram frame size in bytes
63 max_idle_timeout:
64 aliases: ['max-idle-timeout']
65 type: int
66 description: Maximum idle timeout milliseconds
67 max_udp_payload_size:
68 aliases: ['max-udp-payload-size']
69 type: int
70 description: Maximum UDP payload size in bytes
71 '''
72
73 EXAMPLES = '''
74 - name: Example playbook (generated based on argument schema)
75 hosts: fortimanagers
76 connection: httpapi
77 gather_facts: false
78 tasks:
79 - name: QUIC setting.
80 fortinet.fortimanager.fmgr_firewall_vip_quic:
81 # workspace_locking_adom: <global or your adom name>
82 adom: <your own value>
83 vip: <your own value>
84 firewall_vip_quic:
85 # ack_delay_exponent: <integer>
86 # active_connection_id_limit: <integer>
87 # active_migration: <value in [disable, enable]>
88 # grease_quic_bit: <value in [disable, enable]>
89 # max_ack_delay: <integer>
90 # max_datagram_frame_size: <integer>
91 # max_idle_timeout: <integer>
92 # max_udp_payload_size: <integer>
93 '''
94
95 RETURN = '''
96 meta:
97 description: The result of the request.
98 type: dict
99 returned: always
100 contains:
101 request_url:
102 description: The full url requested.
103 returned: always
104 type: str
105 sample: /sys/login/user
106 response_code:
107 description: The status of api request.
108 returned: always
109 type: int
110 sample: 0
111 response_data:
112 description: The api response.
113 type: list
114 returned: always
115 response_message:
116 description: The descriptive message of the api response.
117 type: str
118 returned: always
119 sample: OK.
120 system_information:
121 description: The information of the target system.
122 type: dict
123 returned: always
124 rc:
125 description: The status the request.
126 type: int
127 returned: always
128 sample: 0
129 version_check_warning:
130 description: Warning if the parameters used in the playbook are not supported by the current FortiManager version.
131 type: list
132 returned: complex
133 '''
134 from ansible.module_utils.basic import AnsibleModule
135 from ansible.module_utils.connection import Connection
136 from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass
137 from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec
138
139
140 def main():
141 urls_list = [
142 '/pm/config/adom/{adom}/obj/firewall/vip/{vip}/quic',
143 '/pm/config/global/obj/firewall/vip/{vip}/quic'
144 ]
145 module_arg_spec = {
146 'adom': {'required': True, 'type': 'str'},
147 'vip': {'required': True, 'type': 'str'},
148 'revision_note': {'type': 'str'},
149 'firewall_vip_quic': {
150 'type': 'dict', 'v_range': [['7.4.1', '']],
151 'options': {
152 'ack-delay-exponent': {'v_range': [['7.4.1', '']], 'type': 'int'},
153 'active-connection-id-limit': {'v_range': [['7.4.1', '']], 'type': 'int'},
154 'active-migration': {'v_range': [['7.4.1', '']], 'choices': ['disable', 'enable'], 'type': 'str'},
155 'grease-quic-bit': {'v_range': [['7.4.1', '']], 'choices': ['disable', 'enable'], 'type': 'str'},
156 'max-ack-delay': {'v_range': [['7.4.1', '']], 'type': 'int'},
157 'max-datagram-frame-size': {'v_range': [['7.4.1', '']], 'type': 'int'},
158 'max-idle-timeout': {'v_range': [['7.4.1', '']], 'type': 'int'},
159 'max-udp-payload-size': {'v_range': [['7.4.1', '']], 'type': 'int'}
160 }
161 }
162 }
163
164 module_option_spec = get_module_arg_spec('partial crud')
165 module_arg_spec.update(module_option_spec)
166 check_galaxy_version(module_arg_spec)
167 module = AnsibleModule(argument_spec=check_parameter_bypass(module_arg_spec, 'firewall_vip_quic'),
168 supports_check_mode=True)
169 if not module._socket_path:
170 module.fail_json(msg='MUST RUN IN HTTPAPI MODE')
171 connection = Connection(module._socket_path)
172 fmgr = NAPIManager('partial crud', module_arg_spec, urls_list,
173 None, 'data', module, connection)
174 fmgr.process_partial_crud()
175 module.exit_json(meta=module.params)
176
177
178 if __name__ == '__main__':
179 main()