Debian Codegraph @

ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_firewall_profileprotocoloptions_pop3.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_profileprotocoloptions_pop3
15 short_description: Configure POP3 protocol options.
16 version_added: "2.0.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 profile-protocol-options:
29 description: Deprecated, please use "profile_protocol_options"
30 type: str
31 profile_protocol_options:
32 description: The parameter (profile-protocol-options) in requested url.
33 type: str
34 firewall_profileprotocoloptions_pop3:
35 description: The top level parameters set.
36 required: false
37 type: dict
38 suboptions:
39 inspect_all:
40 aliases: ['inspect-all']
41 type: str
42 description: Enable/disable the inspection of all ports for the protocol.
43 choices: ['disable', 'enable']
44 options:
45 type: list
46 elements: str
47 description: One or more options that can be applied to the session.
48 choices: ['oversize', 'fragmail', 'no-content-summary']
49 oversize_limit:
50 aliases: ['oversize-limit']
51 type: int
52 description: Maximum in-memory file size that can be scanned
53 ports:
54 type: raw
55 description: (list) Ports to scan for content
56 scan_bzip2:
57 aliases: ['scan-bzip2']
58 type: str
59 description: Enable/disable scanning of BZip2 compressed files.
60 choices: ['disable', 'enable']
61 status:
62 type: str
63 description: Enable/disable the active status of scanning for this protocol.
64 choices: ['disable', 'enable']
65 uncompressed_nest_limit:
66 aliases: ['uncompressed-nest-limit']
67 type: int
68 description: Maximum nested levels of compression that can be uncompressed and scanned
69 uncompressed_oversize_limit:
70 aliases: ['uncompressed-oversize-limit']
71 type: int
72 description: Maximum in-memory uncompressed file size that can be scanned
73 ssl_offloaded:
74 aliases: ['ssl-offloaded']
75 type: str
76 description: SSL decryption and encryption performed by an external device.
77 choices: ['no', 'yes']
78 proxy_after_tcp_handshake:
79 aliases: ['proxy-after-tcp-handshake']
80 type: str
81 description: Proxy traffic after the TCP 3-way handshake has been established
82 choices: ['disable', 'enable']
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: Configure POP3 protocol options.
92 fortinet.fortimanager.fmgr_firewall_profileprotocoloptions_pop3:
93 # workspace_locking_adom: <global or your adom name>
94 adom: <your own value>
95 profile_protocol_options: <your own value>
96 firewall_profileprotocoloptions_pop3:
97 # inspect_all: <value in [disable, enable]>
98 # options: ["oversize", "fragmail", "no-content-summary"]
99 # oversize_limit: <integer>
100 # ports: <list or integer>
101 # scan_bzip2: <value in [disable, enable]>
102 # status: <value in [disable, enable]>
103 # uncompressed_nest_limit: <integer>
104 # uncompressed_oversize_limit: <integer>
105 # ssl_offloaded: <value in [no, yes]>
106 # proxy_after_tcp_handshake: <value in [disable, enable]>
107 '''
108
109 RETURN = '''
110 meta:
111 description: The result of the request.
112 type: dict
113 returned: always
114 contains:
115 request_url:
116 description: The full url requested.
117 returned: always
118 type: str
119 sample: /sys/login/user
120 response_code:
121 description: The status of api request.
122 returned: always
123 type: int
124 sample: 0
125 response_data:
126 description: The api response.
127 type: list
128 returned: always
129 response_message:
130 description: The descriptive message of the api response.
131 type: str
132 returned: always
133 sample: OK.
134 system_information:
135 description: The information of the target system.
136 type: dict
137 returned: always
138 rc:
139 description: The status the request.
140 type: int
141 returned: always
142 sample: 0
143 version_check_warning:
144 description: Warning if the parameters used in the playbook are not supported by the current FortiManager version.
145 type: list
146 returned: complex
147 '''
148 from ansible.module_utils.basic import AnsibleModule
149 from ansible.module_utils.connection import Connection
150 from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass
151 from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec
152
153
154 def main():
155 urls_list = [
156 '/pm/config/adom/{adom}/obj/firewall/profile-protocol-options/{profile-protocol-options}/pop3',
157 '/pm/config/global/obj/firewall/profile-protocol-options/{profile-protocol-options}/pop3'
158 ]
159 module_arg_spec = {
160 'adom': {'required': True, 'type': 'str'},
161 'profile-protocol-options': {'type': 'str', 'api_name': 'profile_protocol_options'},
162 'profile_protocol_options': {'type': 'str'},
163 'revision_note': {'type': 'str'},
164 'firewall_profileprotocoloptions_pop3': {
165 'type': 'dict', 'v_range': [['6.0.0', '']],
166 'options': {
167 'inspect-all': {'choices': ['disable', 'enable'], 'type': 'str'},
168 'options': {'type': 'list', 'choices': ['oversize', 'fragmail', 'no-content-summary'], 'elements': 'str'},
169 'oversize-limit': {'type': 'int'},
170 'ports': {'type': 'raw'},
171 'scan-bzip2': {'choices': ['disable', 'enable'], 'type': 'str'},
172 'status': {'choices': ['disable', 'enable'], 'type': 'str'},
173 'uncompressed-nest-limit': {'type': 'int'},
174 'uncompressed-oversize-limit': {'type': 'int'},
175 'ssl-offloaded': {'v_range': [['6.2.2', '']], 'choices': ['no', 'yes'], 'type': 'str'},
176 'proxy-after-tcp-handshake': {'v_range': [['6.4.0', '']], 'choices': ['disable', 'enable'], 'type': 'str'}
177 }
178 }
179 }
180
181 module_option_spec = get_module_arg_spec('partial crud')
182 module_arg_spec.update(module_option_spec)
183 check_galaxy_version(module_arg_spec)
184 module = AnsibleModule(argument_spec=check_parameter_bypass(module_arg_spec, 'firewall_profileprotocoloptions_pop3'),
185 supports_check_mode=True)
186 if not module._socket_path:
187 module.fail_json(msg='MUST RUN IN HTTPAPI MODE')
188 connection = Connection(module._socket_path)
189 fmgr = NAPIManager('partial crud', module_arg_spec, urls_list,
190 None, 'data', module, connection)
191 fmgr.process_partial_crud()
192 module.exit_json(meta=module.params)
193
194
195 if __name__ == '__main__':
196 main()