Debian Codegraph @

ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_system_npu_ipreassembly.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_npu_ipreassembly
15 short_description: IP reassebmly engine configuration.
16 version_added: "2.2.0"
17 extends_documentation_fragment:
18 - fortinet.fortimanager.general
19 - fortinet.fortimanager.general.partial_crud
20 options:
21 revision_note:
22 description: The change note that can be specified when an object is created or updated.
23 type: str
24 adom:
25 description: The parameter (adom) in requested url.
26 type: str
27 required: true
28 system_npu_ipreassembly:
29 description: The top level parameters set.
30 required: false
31 type: dict
32 suboptions:
33 max_timeout:
34 aliases: ['max-timeout']
35 type: int
36 description: Maximum timeout value for IP reassembly
37 min_timeout:
38 aliases: ['min-timeout']
39 type: int
40 description: Minimum timeout value for IP reassembly
41 status:
42 type: str
43 description: Set IP reassembly processing status.
44 choices: ['disable', 'enable']
45 '''
46
47 EXAMPLES = '''
48 - name: Example playbook (generated based on argument schema)
49 hosts: fortimanagers
50 connection: httpapi
51 gather_facts: false
52 tasks:
53 - name: IP reassebmly engine configuration.
54 fortinet.fortimanager.fmgr_system_npu_ipreassembly:
55 # workspace_locking_adom: <global or your adom name>
56 adom: <your own value>
57 system_npu_ipreassembly:
58 # max_timeout: <integer>
59 # min_timeout: <integer>
60 # status: <value in [disable, enable]>
61 '''
62
63 RETURN = '''
64 meta:
65 description: The result of the request.
66 type: dict
67 returned: always
68 contains:
69 request_url:
70 description: The full url requested.
71 returned: always
72 type: str
73 sample: /sys/login/user
74 response_code:
75 description: The status of api request.
76 returned: always
77 type: int
78 sample: 0
79 response_data:
80 description: The api response.
81 type: list
82 returned: always
83 response_message:
84 description: The descriptive message of the api response.
85 type: str
86 returned: always
87 sample: OK.
88 system_information:
89 description: The information of the target system.
90 type: dict
91 returned: always
92 rc:
93 description: The status the request.
94 type: int
95 returned: always
96 sample: 0
97 version_check_warning:
98 description: Warning if the parameters used in the playbook are not supported by the current FortiManager version.
99 type: list
100 returned: complex
101 '''
102 from ansible.module_utils.basic import AnsibleModule
103 from ansible.module_utils.connection import Connection
104 from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass
105 from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec
106
107
108 def main():
109 urls_list = [
110 '/pm/config/adom/{adom}/obj/system/npu/ip-reassembly',
111 '/pm/config/global/obj/system/npu/ip-reassembly'
112 ]
113 module_arg_spec = {
114 'adom': {'required': True, 'type': 'str'},
115 'revision_note': {'type': 'str'},
116 'system_npu_ipreassembly': {
117 'type': 'dict', 'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']],
118 'options': {
119 'max-timeout': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'type': 'int'},
120 'min-timeout': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'type': 'int'},
121 'status': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'choices': ['disable', 'enable'], 'type': 'str'}
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_npu_ipreassembly'),
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()