Debian Codegraph @

ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_system_autodelete_dlpfilesautodeletion.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_autodelete_dlpfilesautodeletion
15 short_description: Automatic deletion policy for DLP archives.
16 version_added: "2.0.0"
17 extends_documentation_fragment:
18 - fortinet.fortimanager.general
19 - fortinet.fortimanager.general.partial_crud
20 options:
21 system_autodelete_dlpfilesautodeletion:
22 description: The top level parameters set.
23 required: false
24 type: dict
25 suboptions:
26 retention:
27 type: str
28 description:
29 - Automatic deletion in days, weeks, or months.
30 - days - Auto-delete data older than
31 - weeks - Auto-delete data older than
32 - months - Auto-delete data older than
33 choices: ['days', 'weeks', 'months']
34 runat:
35 type: int
36 description: Automatic deletion run at
37 status:
38 type: str
39 description:
40 - Enable/disable automatic deletion.
41 - disable - Disable automatic deletion.
42 - enable - Enable automatic deletion.
43 choices: ['disable', 'enable']
44 value:
45 type: int
46 description: Automatic deletion in x days, weeks, or months.
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: Automatic deletion policy for DLP archives.
56 fortinet.fortimanager.fmgr_system_autodelete_dlpfilesautodeletion:
57 # workspace_locking_adom: <global or your adom name>
58 system_autodelete_dlpfilesautodeletion:
59 # retention: <value in [days, weeks, months]>
60 # runat: <integer>
61 # status: <value in [disable, enable]>
62 # value: <integer>
63 '''
64
65 RETURN = '''
66 meta:
67 description: The result of the request.
68 type: dict
69 returned: always
70 contains:
71 request_url:
72 description: The full url requested.
73 returned: always
74 type: str
75 sample: /sys/login/user
76 response_code:
77 description: The status of api request.
78 returned: always
79 type: int
80 sample: 0
81 response_data:
82 description: The api response.
83 type: list
84 returned: always
85 response_message:
86 description: The descriptive message of the api response.
87 type: str
88 returned: always
89 sample: OK.
90 system_information:
91 description: The information of the target system.
92 type: dict
93 returned: always
94 rc:
95 description: The status the request.
96 type: int
97 returned: always
98 sample: 0
99 version_check_warning:
100 description: Warning if the parameters used in the playbook are not supported by the current FortiManager version.
101 type: list
102 returned: complex
103 '''
104 from ansible.module_utils.basic import AnsibleModule
105 from ansible.module_utils.connection import Connection
106 from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass
107 from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec
108
109
110 def main():
111 urls_list = [
112 '/cli/global/system/auto-delete/dlp-files-auto-deletion'
113 ]
114 module_arg_spec = {
115 'system_autodelete_dlpfilesautodeletion': {
116 'type': 'dict', 'v_range': [['6.0.0', '']],
117 'options': {
118 'retention': {'choices': ['days', 'weeks', 'months'], 'type': 'str'},
119 'runat': {'type': 'int'},
120 'status': {'choices': ['disable', 'enable'], 'type': 'str'},
121 'value': {'type': 'int'}
122 }
123 }
124 }
125
126 module_option_spec = get_module_arg_spec('partial crud')
127 module_arg_spec.update(module_option_spec)
128 check_galaxy_version(module_arg_spec)
129 module = AnsibleModule(argument_spec=check_parameter_bypass(module_arg_spec, 'system_autodelete_dlpfilesautodeletion'),
130 supports_check_mode=True)
131 if not module._socket_path:
132 module.fail_json(msg='MUST RUN IN HTTPAPI MODE')
133 connection = Connection(module._socket_path)
134 fmgr = NAPIManager('partial crud', module_arg_spec, urls_list,
135 None, 'data', module, connection)
136 fmgr.process_partial_crud()
137 module.exit_json(meta=module.params)
138
139
140 if __name__ == '__main__':
141 main()