Debian Codegraph @

ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_gtp_rattimeoutprofile.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_gtp_rattimeoutprofile
15 short_description: RAT timeout profile
16 version_added: "2.10.0"
17 extends_documentation_fragment:
18 - fortinet.fortimanager.general
19 - fortinet.fortimanager.general.full_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 gtp_rattimeoutprofile:
29 description: The top level parameters set.
30 required: false
31 type: dict
32 suboptions:
33 eutran_timeout:
34 aliases: ['eutran-timeout']
35 type: int
36 description: Established eutran timeout in seconds
37 gan_timeout:
38 aliases: ['gan-timeout']
39 type: int
40 description: Established gan timeout in seconds
41 geran_timeout:
42 aliases: ['geran-timeout']
43 type: int
44 description: Established geran timeout in seconds
45 hspa_timeout:
46 aliases: ['hspa-timeout']
47 type: int
48 description: Established hspa timeout in seconds
49 ltem_timeout:
50 aliases: ['ltem-timeout']
51 type: int
52 description: Established ltem timeout in seconds
53 name:
54 type: str
55 description: RAT timeout profile name.
56 required: true
57 nbiot_timeout:
58 aliases: ['nbiot-timeout']
59 type: int
60 description: Established nbiot timeout in seconds
61 nr_timeout:
62 aliases: ['nr-timeout']
63 type: int
64 description: Established nr timeout in seconds
65 utran_timeout:
66 aliases: ['utran-timeout']
67 type: int
68 description: Established utran timeout in seconds
69 virtual_timeout:
70 aliases: ['virtual-timeout']
71 type: int
72 description: Established virtual timeout in seconds
73 wlan_timeout:
74 aliases: ['wlan-timeout']
75 type: int
76 description: Established wlan timeout in seconds
77 '''
78
79 EXAMPLES = '''
80 - name: Example playbook (generated based on argument schema)
81 hosts: fortimanagers
82 connection: httpapi
83 gather_facts: false
84 tasks:
85 - name: RAT timeout profile
86 fortinet.fortimanager.fmgr_gtp_rattimeoutprofile:
87 # workspace_locking_adom: <global or your adom name>
88 adom: <your own value>
89 state: present # <value in [present, absent]>
90 gtp_rattimeoutprofile:
91 name: "your value" # Required variable, string
92 # eutran_timeout: <integer>
93 # gan_timeout: <integer>
94 # geran_timeout: <integer>
95 # hspa_timeout: <integer>
96 # ltem_timeout: <integer>
97 # nbiot_timeout: <integer>
98 # nr_timeout: <integer>
99 # utran_timeout: <integer>
100 # virtual_timeout: <integer>
101 # wlan_timeout: <integer>
102 '''
103
104 RETURN = '''
105 meta:
106 description: The result of the request.
107 type: dict
108 returned: always
109 contains:
110 request_url:
111 description: The full url requested.
112 returned: always
113 type: str
114 sample: /sys/login/user
115 response_code:
116 description: The status of api request.
117 returned: always
118 type: int
119 sample: 0
120 response_data:
121 description: The api response.
122 type: list
123 returned: always
124 response_message:
125 description: The descriptive message of the api response.
126 type: str
127 returned: always
128 sample: OK.
129 system_information:
130 description: The information of the target system.
131 type: dict
132 returned: always
133 rc:
134 description: The status the request.
135 type: int
136 returned: always
137 sample: 0
138 version_check_warning:
139 description: Warning if the parameters used in the playbook are not supported by the current FortiManager version.
140 type: list
141 returned: complex
142 '''
143 from ansible.module_utils.basic import AnsibleModule
144 from ansible.module_utils.connection import Connection
145 from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass
146 from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec
147
148
149 def main():
150 urls_list = [
151 '/pm/config/adom/{adom}/obj/gtp/rat-timeout-profile',
152 '/pm/config/global/obj/gtp/rat-timeout-profile'
153 ]
154 module_arg_spec = {
155 'adom': {'required': True, 'type': 'str'},
156 'revision_note': {'type': 'str'},
157 'gtp_rattimeoutprofile': {
158 'type': 'dict', 'v_range': [['7.4.7', '7.4.10'], ['7.6.4', '']],
159 'options': {
160 'eutran-timeout': {'v_range': [['7.4.7', '7.4.10'], ['7.6.4', '']], 'type': 'int'},
161 'gan-timeout': {'v_range': [['7.4.7', '7.4.10'], ['7.6.4', '']], 'type': 'int'},
162 'geran-timeout': {'v_range': [['7.4.7', '7.4.10'], ['7.6.4', '']], 'type': 'int'},
163 'hspa-timeout': {'v_range': [['7.4.7', '7.4.10'], ['7.6.4', '']], 'type': 'int'},
164 'ltem-timeout': {'v_range': [['7.4.7', '7.4.10'], ['7.6.4', '']], 'type': 'int'},
165 'name': {'v_range': [['7.4.7', '7.4.10'], ['7.6.4', '']], 'required': True, 'type': 'str'},
166 'nbiot-timeout': {'v_range': [['7.4.7', '7.4.10'], ['7.6.4', '']], 'type': 'int'},
167 'nr-timeout': {'v_range': [['7.4.7', '7.4.10'], ['7.6.4', '']], 'type': 'int'},
168 'utran-timeout': {'v_range': [['7.4.7', '7.4.10'], ['7.6.4', '']], 'type': 'int'},
169 'virtual-timeout': {'v_range': [['7.4.7', '7.4.10'], ['7.6.4', '']], 'type': 'int'},
170 'wlan-timeout': {'v_range': [['7.4.7', '7.4.10'], ['7.6.4', '']], 'type': 'int'}
171 }
172 }
173 }
174
175 module_option_spec = get_module_arg_spec('full crud')
176 module_arg_spec.update(module_option_spec)
177 check_galaxy_version(module_arg_spec)
178 module = AnsibleModule(argument_spec=check_parameter_bypass(module_arg_spec, 'gtp_rattimeoutprofile'),
179 supports_check_mode=True)
180 if not module._socket_path:
181 module.fail_json(msg='MUST RUN IN HTTPAPI MODE')
182 connection = Connection(module._socket_path)
183 fmgr = NAPIManager('full crud', module_arg_spec, urls_list,
184 'name', 'data', module, connection)
185 fmgr.process_crud()
186 module.exit_json(meta=module.params)
187
188
189 if __name__ == '__main__':
190 main()