Debian Codegraph @

ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_system_logfetch_serversettings.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_system_logfetch_serversettings
15 short_description: Log-fetch server settings.
16 version_added: "2.0.0"
17 extends_documentation_fragment:
18 - fortinet.fortimanager.general
19 - fortinet.fortimanager.general.partial_crud
20 options:
21 system_logfetch_serversettings:
22 description: The top level parameters set.
23 required: false
24 type: dict
25 suboptions:
26 max_conn_per_session:
27 aliases: ['max-conn-per-session']
28 type: int
29 description: Max concurrent file download connections per session.
30 max_sessions:
31 aliases: ['max-sessions']
32 type: int
33 description: Max concurrent fetch sessions.
34 session_timeout:
35 aliases: ['session-timeout']
36 type: int
37 description: Fetch session timeout in minute.
38 '''
39
40 EXAMPLES = '''
41 - name: Example playbook (generated based on argument schema)
42 hosts: fortimanagers
43 connection: httpapi
44 gather_facts: false
45 tasks:
46 - name: Log-fetch server settings.
47 fortinet.fortimanager.fmgr_system_logfetch_serversettings:
48 # workspace_locking_adom: <global or your adom name>
49 system_logfetch_serversettings:
50 # max_conn_per_session: <integer>
51 # max_sessions: <integer>
52 # session_timeout: <integer>
53 '''
54
55 RETURN = '''
56 meta:
57 description: The result of the request.
58 type: dict
59 returned: always
60 contains:
61 request_url:
62 description: The full url requested.
63 returned: always
64 type: str
65 sample: /sys/login/user
66 response_code:
67 description: The status of api request.
68 returned: always
69 type: int
70 sample: 0
71 response_data:
72 description: The api response.
73 type: list
74 returned: always
75 response_message:
76 description: The descriptive message of the api response.
77 type: str
78 returned: always
79 sample: OK.
80 system_information:
81 description: The information of the target system.
82 type: dict
83 returned: always
84 rc:
85 description: The status the request.
86 type: int
87 returned: always
88 sample: 0
89 version_check_warning:
90 description: Warning if the parameters used in the playbook are not supported by the current FortiManager version.
91 type: list
92 returned: complex
93 '''
94 from ansible.module_utils.basic import AnsibleModule
95 from ansible.module_utils.connection import Connection
96 from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass
97 from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec
98
99
100 def main():
101 urls_list = [
102 '/cli/global/system/log-fetch/server-settings'
103 ]
104 module_arg_spec = {
105 'system_logfetch_serversettings': {
106 'type': 'dict', 'v_range': [['6.0.0', '7.2.1']],
107 'options': {
108 'max-conn-per-session': {'v_range': [['6.0.0', '7.2.1']], 'type': 'int'},
109 'max-sessions': {'v_range': [['6.0.0', '7.2.1']], 'type': 'int'},
110 'session-timeout': {'v_range': [['6.0.0', '7.2.1']], 'type': 'int'}
111 }
112 }
113 }
114
115 module_option_spec = get_module_arg_spec('partial crud')
116 module_arg_spec.update(module_option_spec)
117 check_galaxy_version(module_arg_spec)
118 module = AnsibleModule(argument_spec=check_parameter_bypass(module_arg_spec, 'system_logfetch_serversettings'),
119 supports_check_mode=True)
120 if not module._socket_path:
121 module.fail_json(msg='MUST RUN IN HTTPAPI MODE')
122 connection = Connection(module._socket_path)
123 fmgr = NAPIManager('partial crud', module_arg_spec, urls_list,
124 None, 'data', module, connection)
125 fmgr.process_partial_crud()
126 module.exit_json(meta=module.params)
127
128
129 if __name__ == '__main__':
130 main()