Debian Codegraph @

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