Debian Codegraph @

ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_hotspot20_hsprofile.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_hotspot20_hsprofile
15 short_description: Configure hotspot profile.
16 version_added: "2.0.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 hotspot20_hsprofile:
29 description: The top level parameters set.
30 required: false
31 type: dict
32 suboptions:
33 3gpp_plmn:
34 aliases: ['3gpp-plmn']
35 type: str
36 description: 3GPP PLMN name.
37 access_network_asra:
38 aliases: ['access-network-asra']
39 type: str
40 description: Enable/disable additional step required for access
41 choices: ['disable', 'enable']
42 access_network_esr:
43 aliases: ['access-network-esr']
44 type: str
45 description: Enable/disable emergency services reachable
46 choices: ['disable', 'enable']
47 access_network_internet:
48 aliases: ['access-network-internet']
49 type: str
50 description: Enable/disable connectivity to the Internet.
51 choices: ['disable', 'enable']
52 access_network_type:
53 aliases: ['access-network-type']
54 type: str
55 description: Access network type.
56 choices: ['private-network', 'private-network-with-guest-access',
57 'chargeable-public-network', 'free-public-network',
58 'personal-device-network', 'emergency-services-only-network',
59 'test-or-experimental', 'wildcard']
60 access_network_uesa:
61 aliases: ['access-network-uesa']
62 type: str
63 description: Enable/disable unauthenticated emergency service accessible
64 choices: ['disable', 'enable']
65 anqp_domain_id:
66 aliases: ['anqp-domain-id']
67 type: int
68 description: ANQP Domain ID
69 bss_transition:
70 aliases: ['bss-transition']
71 type: str
72 description: Enable/disable basic service set
73 choices: ['disable', 'enable']
74 conn_cap:
75 aliases: ['conn-cap']
76 type: str
77 description: Connection capability name.
78 deauth_request_timeout:
79 aliases: ['deauth-request-timeout']
80 type: int
81 description: Deauthentication request timeout
82 dgaf:
83 type: str
84 description: Enable/disable downstream group-addressed forwarding
85 choices: ['disable', 'enable']
86 domain_name:
87 aliases: ['domain-name']
88 type: str
89 description: Domain name.
90 gas_comeback_delay:
91 aliases: ['gas-comeback-delay']
92 type: int
93 description: GAS comeback delay
94 gas_fragmentation_limit:
95 aliases: ['gas-fragmentation-limit']
96 type: int
97 description: GAS fragmentation limit
98 hessid:
99 type: str
100 description: Homogeneous extended service set identifier
101 ip_addr_type:
102 aliases: ['ip-addr-type']
103 type: str
104 description: IP address type name.
105 l2tif:
106 type: str
107 description: Enable/disable Layer 2 traffic inspection and filtering.
108 choices: ['disable', 'enable']
109 nai_realm:
110 aliases: ['nai-realm']
111 type: str
112 description: NAI realm list name.
113 name:
114 type: str
115 description: Hotspot profile name.
116 required: true
117 network_auth:
118 aliases: ['network-auth']
119 type: str
120 description: Network authentication name.
121 oper_friendly_name:
122 aliases: ['oper-friendly-name']
123 type: str
124 description: Operator friendly name.
125 osu_provider:
126 aliases: ['osu-provider']
127 type: raw
128 description: (list or str) Manually selected list of OSU provider
129 osu_ssid:
130 aliases: ['osu-ssid']
131 type: str
132 description: Online sign up
133 pame_bi:
134 aliases: ['pame-bi']
135 type: str
136 description: Enable/disable Pre-Association Message Exchange BSSID Independent
137 choices: ['disable', 'enable']
138 proxy_arp:
139 aliases: ['proxy-arp']
140 type: str
141 description: Enable/disable Proxy ARP.
142 choices: ['disable', 'enable']
143 qos_map:
144 aliases: ['qos-map']
145 type: str
146 description: QoS MAP set ID.
147 roaming_consortium:
148 aliases: ['roaming-consortium']
149 type: str
150 description: Roaming consortium list name.
151 venue_group:
152 aliases: ['venue-group']
153 type: str
154 description: Venue group.
155 choices: ['unspecified', 'assembly', 'business', 'educational', 'factory',
156 'institutional', 'mercantile', 'residential', 'storage', 'utility',
157 'vehicular', 'outdoor']
158 venue_name:
159 aliases: ['venue-name']
160 type: str
161 description: Venue name.
162 venue_type:
163 aliases: ['venue-type']
164 type: str
165 description: Venue type.
166 choices: ['unspecified', 'arena', 'stadium', 'passenger-terminal', 'amphitheater',
167 'amusement-park', 'place-of-worship', 'convention-center', 'library',
168 'museum', 'restaurant', 'theater', 'bar', 'coffee-shop',
169 'zoo-or-aquarium', 'emergency-center', 'doctor-office', 'bank',
170 'fire-station', 'police-station', 'post-office', 'professional-office',
171 'research-facility', 'attorney-office', 'primary-school',
172 'secondary-school', 'university-or-college', 'factory', 'hospital',
173 'long-term-care-facility', 'rehab-center', 'group-home',
174 'prison-or-jail', 'retail-store', 'grocery-market',
175 'auto-service-station', 'shopping-mall', 'gas-station', 'private',
176 'hotel-or-motel', 'dormitory', 'boarding-house', 'automobile',
177 'airplane', 'bus', 'ferry', 'ship-or-boat', 'train', 'motor-bike',
178 'muni-mesh-network', 'city-park', 'rest-area', 'traffic-control',
179 'bus-stop', 'kiosk']
180 wan_metrics:
181 aliases: ['wan-metrics']
182 type: str
183 description: WAN metric name.
184 wnm_sleep_mode:
185 aliases: ['wnm-sleep-mode']
186 type: str
187 description: Enable/disable wireless network management
188 choices: ['disable', 'enable']
189 advice_of_charge:
190 aliases: ['advice-of-charge']
191 type: str
192 description: Advice of charge.
193 oper_icon:
194 aliases: ['oper-icon']
195 type: str
196 description: Operator icon.
197 osu_provider_nai:
198 aliases: ['osu-provider-nai']
199 type: str
200 description: OSU Provider NAI.
201 release:
202 type: int
203 description: Hotspot 2.
204 terms_and_conditions:
205 aliases: ['terms-and-conditions']
206 type: str
207 description: Terms and conditions.
208 venue_url:
209 aliases: ['venue-url']
210 type: str
211 description: Venue name.
212 wba_charging_currency:
213 aliases: ['wba-charging-currency']
214 type: str
215 description: Three letter currency code.
216 wba_charging_rate:
217 aliases: ['wba-charging-rate']
218 type: int
219 description: Number of currency units per kilobyte.
220 wba_data_clearing_provider:
221 aliases: ['wba-data-clearing-provider']
222 type: str
223 description: WBA ID of data clearing provider.
224 wba_financial_clearing_provider:
225 aliases: ['wba-financial-clearing-provider']
226 type: str
227 description: WBA ID of financial clearing provider.
228 wba_open_roaming:
229 aliases: ['wba-open-roaming']
230 type: str
231 description: Enable/disable WBA open roaming support.
232 choices: ['disable', 'enable']
233 '''
234
235 EXAMPLES = '''
236 - name: Example playbook (generated based on argument schema)
237 hosts: fortimanagers
238 connection: httpapi
239 gather_facts: false
240 tasks:
241 - name: Configure hotspot profile.
242 fortinet.fortimanager.fmgr_hotspot20_hsprofile:
243 # workspace_locking_adom: <global or your adom name>
244 adom: <your own value>
245 state: present # <value in [present, absent]>
246 hotspot20_hsprofile:
247 name: "your value" # Required variable, string
248 # 3gpp_plmn: <string>
249 # access_network_asra: <value in [disable, enable]>
250 # access_network_esr: <value in [disable, enable]>
251 # access_network_internet: <value in [disable, enable]>
252 # access_network_type: <value in [private-network, private-network-with-guest-access, chargeable-public-network, ...]>
253 # access_network_uesa: <value in [disable, enable]>
254 # anqp_domain_id: <integer>
255 # bss_transition: <value in [disable, enable]>
256 # conn_cap: <string>
257 # deauth_request_timeout: <integer>
258 # dgaf: <value in [disable, enable]>
259 # domain_name: <string>
260 # gas_comeback_delay: <integer>
261 # gas_fragmentation_limit: <integer>
262 # hessid: <string>
263 # ip_addr_type: <string>
264 # l2tif: <value in [disable, enable]>
265 # nai_realm: <string>
266 # network_auth: <string>
267 # oper_friendly_name: <string>
268 # osu_provider: <list or string>
269 # osu_ssid: <string>
270 # pame_bi: <value in [disable, enable]>
271 # proxy_arp: <value in [disable, enable]>
272 # qos_map: <string>
273 # roaming_consortium: <string>
274 # venue_group: <value in [unspecified, assembly, business, ...]>
275 # venue_name: <string>
276 # venue_type: <value in [unspecified, arena, stadium, ...]>
277 # wan_metrics: <string>
278 # wnm_sleep_mode: <value in [disable, enable]>
279 # advice_of_charge: <string>
280 # oper_icon: <string>
281 # osu_provider_nai: <string>
282 # release: <integer>
283 # terms_and_conditions: <string>
284 # venue_url: <string>
285 # wba_charging_currency: <string>
286 # wba_charging_rate: <integer>
287 # wba_data_clearing_provider: <string>
288 # wba_financial_clearing_provider: <string>
289 # wba_open_roaming: <value in [disable, enable]>
290 '''
291
292 RETURN = '''
293 meta:
294 description: The result of the request.
295 type: dict
296 returned: always
297 contains:
298 request_url:
299 description: The full url requested.
300 returned: always
301 type: str
302 sample: /sys/login/user
303 response_code:
304 description: The status of api request.
305 returned: always
306 type: int
307 sample: 0
308 response_data:
309 description: The api response.
310 type: list
311 returned: always
312 response_message:
313 description: The descriptive message of the api response.
314 type: str
315 returned: always
316 sample: OK.
317 system_information:
318 description: The information of the target system.
319 type: dict
320 returned: always
321 rc:
322 description: The status the request.
323 type: int
324 returned: always
325 sample: 0
326 version_check_warning:
327 description: Warning if the parameters used in the playbook are not supported by the current FortiManager version.
328 type: list
329 returned: complex
330 '''
331 from ansible.module_utils.basic import AnsibleModule
332 from ansible.module_utils.connection import Connection
333 from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass
334 from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec
335
336
337 def main():
338 urls_list = [
339 '/pm/config/adom/{adom}/obj/wireless-controller/hotspot20/hs-profile',
340 '/pm/config/global/obj/wireless-controller/hotspot20/hs-profile'
341 ]
342 module_arg_spec = {
343 'adom': {'required': True, 'type': 'str'},
344 'revision_note': {'type': 'str'},
345 'hotspot20_hsprofile': {
346 'type': 'dict', 'v_range': [['6.0.0', '']],
347 'options': {
348 '3gpp-plmn': {'type': 'str'},
349 'access-network-asra': {'choices': ['disable', 'enable'], 'type': 'str'},
350 'access-network-esr': {'choices': ['disable', 'enable'], 'type': 'str'},
351 'access-network-internet': {'choices': ['disable', 'enable'], 'type': 'str'},
352 'access-network-type': {
353 'choices': [
354 'private-network', 'private-network-with-guest-access', 'chargeable-public-network', 'free-public-network',
355 'personal-device-network', 'emergency-services-only-network', 'test-or-experimental', 'wildcard'
356 ],
357 'type': 'str'
358 },
359 'access-network-uesa': {'choices': ['disable', 'enable'], 'type': 'str'},
360 'anqp-domain-id': {'type': 'int'},
361 'bss-transition': {'choices': ['disable', 'enable'], 'type': 'str'},
362 'conn-cap': {'type': 'str'},
363 'deauth-request-timeout': {'type': 'int'},
364 'dgaf': {'choices': ['disable', 'enable'], 'type': 'str'},
365 'domain-name': {'type': 'str'},
366 'gas-comeback-delay': {'type': 'int'},
367 'gas-fragmentation-limit': {'type': 'int'},
368 'hessid': {'type': 'str'},
369 'ip-addr-type': {'type': 'str'},
370 'l2tif': {'choices': ['disable', 'enable'], 'type': 'str'},
371 'nai-realm': {'type': 'str'},
372 'name': {'required': True, 'type': 'str'},
373 'network-auth': {'type': 'str'},
374 'oper-friendly-name': {'type': 'str'},
375 'osu-provider': {'type': 'raw'},
376 'osu-ssid': {'type': 'str'},
377 'pame-bi': {'choices': ['disable', 'enable'], 'type': 'str'},
378 'proxy-arp': {'choices': ['disable', 'enable'], 'type': 'str'},
379 'qos-map': {'type': 'str'},
380 'roaming-consortium': {'type': 'str'},
381 'venue-group': {
382 'choices': [
383 'unspecified', 'assembly', 'business', 'educational', 'factory', 'institutional', 'mercantile', 'residential', 'storage',
384 'utility', 'vehicular', 'outdoor'
385 ],
386 'type': 'str'
387 },
388 'venue-name': {'type': 'str'},
389 'venue-type': {
390 'choices': [
391 'unspecified', 'arena', 'stadium', 'passenger-terminal', 'amphitheater', 'amusement-park', 'place-of-worship',
392 'convention-center', 'library', 'museum', 'restaurant', 'theater', 'bar', 'coffee-shop', 'zoo-or-aquarium', 'emergency-center',
393 'doctor-office', 'bank', 'fire-station', 'police-station', 'post-office', 'professional-office', 'research-facility',
394 'attorney-office', 'primary-school', 'secondary-school', 'university-or-college', 'factory', 'hospital',
395 'long-term-care-facility', 'rehab-center', 'group-home', 'prison-or-jail', 'retail-store', 'grocery-market',
396 'auto-service-station', 'shopping-mall', 'gas-station', 'private', 'hotel-or-motel', 'dormitory', 'boarding-house', 'automobile',
397 'airplane', 'bus', 'ferry', 'ship-or-boat', 'train', 'motor-bike', 'muni-mesh-network', 'city-park', 'rest-area',
398 'traffic-control', 'bus-stop', 'kiosk'
399 ],
400 'type': 'str'
401 },
402 'wan-metrics': {'type': 'str'},
403 'wnm-sleep-mode': {'choices': ['disable', 'enable'], 'type': 'str'},
404 'advice-of-charge': {'v_range': [['7.0.2', '']], 'type': 'str'},
405 'oper-icon': {'v_range': [['7.0.2', '']], 'type': 'str'},
406 'osu-provider-nai': {'v_range': [['7.0.2', '']], 'type': 'str'},
407 'release': {'v_range': [['7.0.2', '']], 'type': 'int'},
408 'terms-and-conditions': {'v_range': [['7.0.2', '']], 'type': 'str'},
409 'venue-url': {'v_range': [['7.0.2', '']], 'type': 'str'},
410 'wba-charging-currency': {'v_range': [['7.6.0', '']], 'type': 'str'},
411 'wba-charging-rate': {'v_range': [['7.6.0', '']], 'type': 'int'},
412 'wba-data-clearing-provider': {'v_range': [['7.6.0', '']], 'type': 'str'},
413 'wba-financial-clearing-provider': {'v_range': [['7.6.0', '']], 'type': 'str'},
414 'wba-open-roaming': {'v_range': [['7.6.0', '']], 'choices': ['disable', 'enable'], 'type': 'str'}
415 }
416 }
417 }
418
419 module_option_spec = get_module_arg_spec('full crud')
420 module_arg_spec.update(module_option_spec)
421 check_galaxy_version(module_arg_spec)
422 module = AnsibleModule(argument_spec=check_parameter_bypass(module_arg_spec, 'hotspot20_hsprofile'),
423 supports_check_mode=True)
424 if not module._socket_path:
425 module.fail_json(msg='MUST RUN IN HTTPAPI MODE')
426 connection = Connection(module._socket_path)
427 fmgr = NAPIManager('full crud', module_arg_spec, urls_list,
428 'name', 'data', module, connection)
429 fmgr.process_crud()
430 module.exit_json(meta=module.params)
431
432
433 if __name__ == '__main__':
434 main()