Debian Codegraph @

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