Debian Codegraph @

ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_fmupdate_fdssetting_pushoverride.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_fmupdate_fdssetting_pushoverride
15 short_description: Enable/disable push updates, and override the default IP address and port used by FortiGuard to send antivirus and IPS push messages...
16 version_added: "2.0.0"
17 extends_documentation_fragment:
18 - fortinet.fortimanager.general
19 - fortinet.fortimanager.general.partial_crud
20 options:
21 fmupdate_fdssetting_pushoverride:
22 description: The top level parameters set.
23 required: false
24 type: dict
25 suboptions:
26 ip:
27 type: str
28 description: External or virtual IP address of the NAT device that will forward push messages to the FortiManager unit.
29 port:
30 type: int
31 description: Receiving port number on the NAT device
32 status:
33 type: str
34 description:
35 - Enable/disable push updates for clients
36 - disable - Disable setting.
37 - enable - Enable setting.
38 choices: ['disable', 'enable']
39 '''
40
41 EXAMPLES = '''
42 - name: Example playbook (generated based on argument schema)
43 hosts: fortimanagers
44 connection: httpapi
45 gather_facts: false
46 tasks:
47 - name: Enable/disable push updates, and override the default IP address and port used by FortiGuard to send antivirus and IPS push messages...
48 fortinet.fortimanager.fmgr_fmupdate_fdssetting_pushoverride:
49 # workspace_locking_adom: <global or your adom name>
50 fmupdate_fdssetting_pushoverride:
51 # ip: <string>
52 # port: <integer>
53 # status: <value in [disable, enable]>
54 '''
55
56 RETURN = '''
57 meta:
58 description: The result of the request.
59 type: dict
60 returned: always
61 contains:
62 request_url:
63 description: The full url requested.
64 returned: always
65 type: str
66 sample: /sys/login/user
67 response_code:
68 description: The status of api request.
69 returned: always
70 type: int
71 sample: 0
72 response_data:
73 description: The api response.
74 type: list
75 returned: always
76 response_message:
77 description: The descriptive message of the api response.
78 type: str
79 returned: always
80 sample: OK.
81 system_information:
82 description: The information of the target system.
83 type: dict
84 returned: always
85 rc:
86 description: The status the request.
87 type: int
88 returned: always
89 sample: 0
90 version_check_warning:
91 description: Warning if the parameters used in the playbook are not supported by the current FortiManager version.
92 type: list
93 returned: complex
94 '''
95 from ansible.module_utils.basic import AnsibleModule
96 from ansible.module_utils.connection import Connection
97 from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass
98 from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec
99
100
101 def main():
102 urls_list = [
103 '/cli/global/fmupdate/fds-setting/push-override'
104 ]
105 module_arg_spec = {
106 'fmupdate_fdssetting_pushoverride': {
107 'type': 'dict', 'v_range': [['6.0.0', '']],
108 'options': {'ip': {'type': 'str'}, 'port': {'type': 'int'}, 'status': {'choices': ['disable', 'enable'], 'type': 'str'}}
109 }
110 }
111
112 module_option_spec = get_module_arg_spec('partial crud')
113 module_arg_spec.update(module_option_spec)
114 check_galaxy_version(module_arg_spec)
115 module = AnsibleModule(argument_spec=check_parameter_bypass(module_arg_spec, 'fmupdate_fdssetting_pushoverride'),
116 supports_check_mode=True)
117 if not module._socket_path:
118 module.fail_json(msg='MUST RUN IN HTTPAPI MODE')
119 connection = Connection(module._socket_path)
120 fmgr = NAPIManager('partial crud', module_arg_spec, urls_list,
121 None, 'data', module, connection)
122 fmgr.process_partial_crud()
123 module.exit_json(meta=module.params)
124
125
126 if __name__ == '__main__':
127 main()