Debian Codegraph @

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