Debian Codegraph @

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