Debian Codegraph @

ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_wtpprofile_lbs.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_wtpprofile_lbs
15 short_description: Set various location based service
16 version_added: "2.0.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 wtp-profile:
29 description: Deprecated, please use "wtp_profile"
30 type: str
31 wtp_profile:
32 description: The parameter (wtp-profile) in requested url.
33 type: str
34 wtpprofile_lbs:
35 description: The top level parameters set.
36 required: false
37 type: dict
38 suboptions:
39 aeroscout:
40 type: str
41 description: Enable/disable AeroScout Real Time Location Service
42 choices: ['disable', 'enable']
43 aeroscout_ap_mac:
44 aliases: ['aeroscout-ap-mac']
45 type: str
46 description: Use BSSID or board MAC address as AP MAC address in the Aeroscout AP message.
47 choices: ['bssid', 'board-mac']
48 aeroscout_mmu_report:
49 aliases: ['aeroscout-mmu-report']
50 type: str
51 description: Enable/disable MU compounded report.
52 choices: ['disable', 'enable']
53 aeroscout_mu:
54 aliases: ['aeroscout-mu']
55 type: str
56 description: Enable/disable AeroScout support.
57 choices: ['disable', 'enable']
58 aeroscout_mu_factor:
59 aliases: ['aeroscout-mu-factor']
60 type: int
61 description: AeroScout Mobile Unit
62 aeroscout_mu_timeout:
63 aliases: ['aeroscout-mu-timeout']
64 type: int
65 description: AeroScout MU mode timeout
66 aeroscout_server_ip:
67 aliases: ['aeroscout-server-ip']
68 type: str
69 description: IP address of AeroScout server.
70 aeroscout_server_port:
71 aliases: ['aeroscout-server-port']
72 type: int
73 description: AeroScout server UDP listening port.
74 ekahau_blink_mode:
75 aliases: ['ekahau-blink-mode']
76 type: str
77 description: Enable/disable Ekahua blink mode
78 choices: ['disable', 'enable']
79 ekahau_tag:
80 aliases: ['ekahau-tag']
81 type: str
82 description: WiFi frame MAC address or WiFi Tag.
83 erc_server_ip:
84 aliases: ['erc-server-ip']
85 type: str
86 description: IP address of Ekahua RTLS Controller
87 erc_server_port:
88 aliases: ['erc-server-port']
89 type: int
90 description: Ekahua RTLS Controller
91 fortipresence:
92 type: str
93 description: Enable/disable FortiPresence to monitor the location and activity of WiFi clients even if they dont connect to this WiFi n...
94 choices: ['disable', 'enable', 'enable2', 'foreign', 'both']
95 fortipresence_frequency:
96 aliases: ['fortipresence-frequency']
97 type: int
98 description: FortiPresence report transmit frequency
99 fortipresence_port:
100 aliases: ['fortipresence-port']
101 type: int
102 description: FortiPresence server UDP listening port
103 fortipresence_project:
104 aliases: ['fortipresence-project']
105 type: str
106 description: FortiPresence project name
107 fortipresence_rogue:
108 aliases: ['fortipresence-rogue']
109 type: str
110 description: Enable/disable FortiPresence finding and reporting rogue APs.
111 choices: ['disable', 'enable']
112 fortipresence_secret:
113 aliases: ['fortipresence-secret']
114 type: raw
115 description: (list) FortiPresence secret password
116 fortipresence_server:
117 aliases: ['fortipresence-server']
118 type: str
119 description: FortiPresence server IP address.
120 fortipresence_unassoc:
121 aliases: ['fortipresence-unassoc']
122 type: str
123 description: Enable/disable FortiPresence finding and reporting unassociated stations.
124 choices: ['disable', 'enable']
125 station_locate:
126 aliases: ['station-locate']
127 type: str
128 description: Enable/disable client station locating services for all clients, whether associated or not
129 choices: ['disable', 'enable']
130 fortipresence_ble:
131 aliases: ['fortipresence-ble']
132 type: str
133 description: Enable/disable FortiPresence finding and reporting BLE devices.
134 choices: ['disable', 'enable']
135 fortipresence_server_addr_type:
136 aliases: ['fortipresence-server-addr-type']
137 type: str
138 description: FortiPresence server address type
139 choices: ['fqdn', 'ipv4']
140 fortipresence_server_fqdn:
141 aliases: ['fortipresence-server-fqdn']
142 type: str
143 description: FQDN of FortiPresence server.
144 polestar:
145 type: str
146 description: Enable/disable PoleStar BLE NAO Track Real Time Location Service
147 choices: ['disable', 'enable']
148 polestar_accumulation_interval:
149 aliases: ['polestar-accumulation-interval']
150 type: int
151 description: Time that measurements should be accumulated in seconds
152 polestar_asset_addrgrp_list:
153 aliases: ['polestar-asset-addrgrp-list']
154 type: str
155 description: Tags and asset addrgrp list to be reported.
156 polestar_asset_uuid_list1:
157 aliases: ['polestar-asset-uuid-list1']
158 type: str
159 description: Tags and asset UUID list 1 to be reported
160 polestar_asset_uuid_list2:
161 aliases: ['polestar-asset-uuid-list2']
162 type: str
163 description: Tags and asset UUID list 2 to be reported
164 polestar_asset_uuid_list3:
165 aliases: ['polestar-asset-uuid-list3']
166 type: str
167 description: Tags and asset UUID list 3 to be reported
168 polestar_asset_uuid_list4:
169 aliases: ['polestar-asset-uuid-list4']
170 type: str
171 description: Tags and asset UUID list 4 to be reported
172 polestar_protocol:
173 aliases: ['polestar-protocol']
174 type: str
175 description: Select the protocol to report Measurements, Advertising Data, or Location Data to NAO Cloud.
176 choices: ['WSS']
177 polestar_reporting_interval:
178 aliases: ['polestar-reporting-interval']
179 type: int
180 description: Time between reporting accumulated measurements in seconds
181 polestar_server_fqdn:
182 aliases: ['polestar-server-fqdn']
183 type: str
184 description: FQDN of PoleStar Nao Track Server
185 polestar_server_path:
186 aliases: ['polestar-server-path']
187 type: str
188 description: Path of PoleStar Nao Track Server
189 polestar_server_port:
190 aliases: ['polestar-server-port']
191 type: int
192 description: Port of PoleStar Nao Track Server
193 polestar_server_token:
194 aliases: ['polestar-server-token']
195 type: str
196 description: Access Token of PoleStar Nao Track Server.
197 ble_rtls:
198 aliases: ['ble-rtls']
199 type: str
200 description: Set BLE Real Time Location Service
201 choices: ['none', 'polestar', 'evresys']
202 ble_rtls_accumulation_interval:
203 aliases: ['ble-rtls-accumulation-interval']
204 type: int
205 description: Time that measurements should be accumulated in seconds
206 ble_rtls_asset_addrgrp_list:
207 aliases: ['ble-rtls-asset-addrgrp-list']
208 type: raw
209 description: (list) Tags and asset addrgrp list to be reported.
210 ble_rtls_asset_uuid_list1:
211 aliases: ['ble-rtls-asset-uuid-list1']
212 type: str
213 description: Tags and asset UUID list 1 to be reported
214 ble_rtls_asset_uuid_list2:
215 aliases: ['ble-rtls-asset-uuid-list2']
216 type: str
217 description: Tags and asset UUID list 2 to be reported
218 ble_rtls_asset_uuid_list3:
219 aliases: ['ble-rtls-asset-uuid-list3']
220 type: str
221 description: Tags and asset UUID list 3 to be reported
222 ble_rtls_asset_uuid_list4:
223 aliases: ['ble-rtls-asset-uuid-list4']
224 type: str
225 description: Tags and asset UUID list 4 to be reported
226 ble_rtls_protocol:
227 aliases: ['ble-rtls-protocol']
228 type: str
229 description: Select the protocol to report Measurements, Advertising Data, or Location Data to Cloud Server.
230 choices: ['WSS']
231 ble_rtls_reporting_interval:
232 aliases: ['ble-rtls-reporting-interval']
233 type: int
234 description: Time between reporting accumulated measurements in seconds
235 ble_rtls_server_fqdn:
236 aliases: ['ble-rtls-server-fqdn']
237 type: str
238 description: FQDN of BLE Real Time Location Service
239 ble_rtls_server_path:
240 aliases: ['ble-rtls-server-path']
241 type: str
242 description: Path of BLE Real Time Location Service
243 ble_rtls_server_port:
244 aliases: ['ble-rtls-server-port']
245 type: int
246 description: Port of BLE Real Time Location Service
247 ble_rtls_server_token:
248 aliases: ['ble-rtls-server-token']
249 type: str
250 description: Access Token of BLE Real Time Location Service
251 '''
252
253 EXAMPLES = '''
254 - name: Example playbook (generated based on argument schema)
255 hosts: fortimanagers
256 connection: httpapi
257 gather_facts: false
258 tasks:
259 - name: Set various location based service
260 fortinet.fortimanager.fmgr_wtpprofile_lbs:
261 # workspace_locking_adom: <global or your adom name>
262 adom: <your own value>
263 wtp_profile: <your own value>
264 wtpprofile_lbs:
265 # aeroscout: <value in [disable, enable]>
266 # aeroscout_ap_mac: <value in [bssid, board-mac]>
267 # aeroscout_mmu_report: <value in [disable, enable]>
268 # aeroscout_mu: <value in [disable, enable]>
269 # aeroscout_mu_factor: <integer>
270 # aeroscout_mu_timeout: <integer>
271 # aeroscout_server_ip: <string>
272 # aeroscout_server_port: <integer>
273 # ekahau_blink_mode: <value in [disable, enable]>
274 # ekahau_tag: <string>
275 # erc_server_ip: <string>
276 # erc_server_port: <integer>
277 # fortipresence: <value in [disable, enable, enable2, ...]>
278 # fortipresence_frequency: <integer>
279 # fortipresence_port: <integer>
280 # fortipresence_project: <string>
281 # fortipresence_rogue: <value in [disable, enable]>
282 # fortipresence_secret: <list or string>
283 # fortipresence_server: <string>
284 # fortipresence_unassoc: <value in [disable, enable]>
285 # station_locate: <value in [disable, enable]>
286 # fortipresence_ble: <value in [disable, enable]>
287 # fortipresence_server_addr_type: <value in [fqdn, ipv4]>
288 # fortipresence_server_fqdn: <string>
289 # polestar: <value in [disable, enable]>
290 # polestar_accumulation_interval: <integer>
291 # polestar_asset_addrgrp_list: <string>
292 # polestar_asset_uuid_list1: <string>
293 # polestar_asset_uuid_list2: <string>
294 # polestar_asset_uuid_list3: <string>
295 # polestar_asset_uuid_list4: <string>
296 # polestar_protocol: <value in [WSS]>
297 # polestar_reporting_interval: <integer>
298 # polestar_server_fqdn: <string>
299 # polestar_server_path: <string>
300 # polestar_server_port: <integer>
301 # polestar_server_token: <string>
302 # ble_rtls: <value in [none, polestar, evresys]>
303 # ble_rtls_accumulation_interval: <integer>
304 # ble_rtls_asset_addrgrp_list: <list or string>
305 # ble_rtls_asset_uuid_list1: <string>
306 # ble_rtls_asset_uuid_list2: <string>
307 # ble_rtls_asset_uuid_list3: <string>
308 # ble_rtls_asset_uuid_list4: <string>
309 # ble_rtls_protocol: <value in [WSS]>
310 # ble_rtls_reporting_interval: <integer>
311 # ble_rtls_server_fqdn: <string>
312 # ble_rtls_server_path: <string>
313 # ble_rtls_server_port: <integer>
314 # ble_rtls_server_token: <string>
315 '''
316
317 RETURN = '''
318 meta:
319 description: The result of the request.
320 type: dict
321 returned: always
322 contains:
323 request_url:
324 description: The full url requested.
325 returned: always
326 type: str
327 sample: /sys/login/user
328 response_code:
329 description: The status of api request.
330 returned: always
331 type: int
332 sample: 0
333 response_data:
334 description: The api response.
335 type: list
336 returned: always
337 response_message:
338 description: The descriptive message of the api response.
339 type: str
340 returned: always
341 sample: OK.
342 system_information:
343 description: The information of the target system.
344 type: dict
345 returned: always
346 rc:
347 description: The status the request.
348 type: int
349 returned: always
350 sample: 0
351 version_check_warning:
352 description: Warning if the parameters used in the playbook are not supported by the current FortiManager version.
353 type: list
354 returned: complex
355 '''
356 from ansible.module_utils.basic import AnsibleModule
357 from ansible.module_utils.connection import Connection
358 from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass
359 from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec
360
361
362 def main():
363 urls_list = [
364 '/pm/config/adom/{adom}/obj/wireless-controller/wtp-profile/{wtp-profile}/lbs',
365 '/pm/config/global/obj/wireless-controller/wtp-profile/{wtp-profile}/lbs'
366 ]
367 module_arg_spec = {
368 'adom': {'required': True, 'type': 'str'},
369 'wtp-profile': {'type': 'str', 'api_name': 'wtp_profile'},
370 'wtp_profile': {'type': 'str'},
371 'revision_note': {'type': 'str'},
372 'wtpprofile_lbs': {
373 'type': 'dict', 'v_range': [['6.0.0', '']],
374 'options': {
375 'aeroscout': {'choices': ['disable', 'enable'], 'type': 'str'},
376 'aeroscout-ap-mac': {'choices': ['bssid', 'board-mac'], 'type': 'str'},
377 'aeroscout-mmu-report': {'choices': ['disable', 'enable'], 'type': 'str'},
378 'aeroscout-mu': {'choices': ['disable', 'enable'], 'type': 'str'},
379 'aeroscout-mu-factor': {'type': 'int'},
380 'aeroscout-mu-timeout': {'type': 'int'},
381 'aeroscout-server-ip': {'type': 'str'},
382 'aeroscout-server-port': {'type': 'int'},
383 'ekahau-blink-mode': {'choices': ['disable', 'enable'], 'type': 'str'},
384 'ekahau-tag': {'type': 'str'},
385 'erc-server-ip': {'type': 'str'},
386 'erc-server-port': {'type': 'int'},
387 'fortipresence': {'choices': ['disable', 'enable', 'enable2', 'foreign', 'both'], 'type': 'str'},
388 'fortipresence-frequency': {'type': 'int'},
389 'fortipresence-port': {'type': 'int'},
390 'fortipresence-project': {'type': 'str'},
391 'fortipresence-rogue': {'choices': ['disable', 'enable'], 'type': 'str'},
392 'fortipresence-secret': {'no_log': True, 'type': 'raw'},
393 'fortipresence-server': {'type': 'str'},
394 'fortipresence-unassoc': {'choices': ['disable', 'enable'], 'type': 'str'},
395 'station-locate': {'choices': ['disable', 'enable'], 'type': 'str'},
396 'fortipresence-ble': {'v_range': [['6.2.0', '']], 'choices': ['disable', 'enable'], 'type': 'str'},
397 'fortipresence-server-addr-type': {'v_range': [['7.0.2', '']], 'choices': ['fqdn', 'ipv4'], 'type': 'str'},
398 'fortipresence-server-fqdn': {'v_range': [['7.0.2', '']], 'type': 'str'},
399 'polestar': {'v_range': [['7.4.1', '']], 'choices': ['disable', 'enable'], 'type': 'str'},
400 'polestar-accumulation-interval': {'v_range': [['7.4.1', '']], 'type': 'int'},
401 'polestar-asset-addrgrp-list': {'v_range': [['7.4.1', '']], 'type': 'str'},
402 'polestar-asset-uuid-list1': {'v_range': [['7.4.1', '']], 'type': 'str'},
403 'polestar-asset-uuid-list2': {'v_range': [['7.4.1', '']], 'type': 'str'},
404 'polestar-asset-uuid-list3': {'v_range': [['7.4.1', '']], 'type': 'str'},
405 'polestar-asset-uuid-list4': {'v_range': [['7.4.1', '']], 'type': 'str'},
406 'polestar-protocol': {'v_range': [['7.4.1', '']], 'choices': ['WSS'], 'type': 'str'},
407 'polestar-reporting-interval': {'v_range': [['7.4.1', '']], 'type': 'int'},
408 'polestar-server-fqdn': {'v_range': [['7.4.1', '']], 'type': 'str'},
409 'polestar-server-path': {'v_range': [['7.4.1', '']], 'type': 'str'},
410 'polestar-server-port': {'v_range': [['7.4.1', '']], 'type': 'int'},
411 'polestar-server-token': {'v_range': [['7.4.1', '']], 'no_log': True, 'type': 'str'},
412 'ble-rtls': {'v_range': [['7.4.4', '7.4.10'], ['7.6.2', '']], 'choices': ['none', 'polestar', 'evresys'], 'type': 'str'},
413 'ble-rtls-accumulation-interval': {'v_range': [['7.4.4', '7.4.10'], ['7.6.2', '']], 'type': 'int'},
414 'ble-rtls-asset-addrgrp-list': {'v_range': [['7.4.4', '7.4.10'], ['7.6.2', '']], 'type': 'raw'},
415 'ble-rtls-asset-uuid-list1': {'v_range': [['7.4.4', '7.4.10'], ['7.6.2', '']], 'type': 'str'},
416 'ble-rtls-asset-uuid-list2': {'v_range': [['7.4.4', '7.4.10'], ['7.6.2', '']], 'type': 'str'},
417 'ble-rtls-asset-uuid-list3': {'v_range': [['7.4.4', '7.4.10'], ['7.6.2', '']], 'type': 'str'},
418 'ble-rtls-asset-uuid-list4': {'v_range': [['7.4.4', '7.4.10'], ['7.6.2', '']], 'type': 'str'},
419 'ble-rtls-protocol': {'v_range': [['7.4.4', '7.4.10'], ['7.6.2', '']], 'choices': ['WSS'], 'type': 'str'},
420 'ble-rtls-reporting-interval': {'v_range': [['7.4.4', '7.4.10'], ['7.6.2', '']], 'type': 'int'},
421 'ble-rtls-server-fqdn': {'v_range': [['7.4.4', '7.4.10'], ['7.6.2', '']], 'type': 'str'},
422 'ble-rtls-server-path': {'v_range': [['7.4.4', '7.4.10'], ['7.6.2', '']], 'type': 'str'},
423 'ble-rtls-server-port': {'v_range': [['7.4.4', '7.4.10'], ['7.6.2', '']], 'type': 'int'},
424 'ble-rtls-server-token': {'v_range': [['7.4.4', '7.4.10'], ['7.6.2', '']], 'no_log': True, 'type': 'str'}
425 }
426 }
427 }
428
429 module_option_spec = get_module_arg_spec('partial crud')
430 module_arg_spec.update(module_option_spec)
431 check_galaxy_version(module_arg_spec)
432 module = AnsibleModule(argument_spec=check_parameter_bypass(module_arg_spec, 'wtpprofile_lbs'),
433 supports_check_mode=True)
434 if not module._socket_path:
435 module.fail_json(msg='MUST RUN IN HTTPAPI MODE')
436 connection = Connection(module._socket_path)
437 fmgr = NAPIManager('partial crud', module_arg_spec, urls_list,
438 None, 'data', module, connection)
439 fmgr.process_partial_crud()
440 module.exit_json(meta=module.params)
441
442
443 if __name__ == '__main__':
444 main()