Debian Codegraph @

ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_hotspot20_h2qposuprovider.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_h2qposuprovider
15 short_description: Configure online sign up
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_h2qposuprovider:
29 description: The top level parameters set.
30 required: false
31 type: dict
32 suboptions:
33 friendly_name:
34 aliases: ['friendly-name']
35 type: list
36 elements: dict
37 description: Friendly name.
38 suboptions:
39 friendly_name:
40 aliases: ['friendly-name']
41 type: str
42 description: OSU provider friendly name.
43 index:
44 type: int
45 description: OSU provider friendly name index.
46 lang:
47 type: str
48 description: Language code.
49 icon:
50 type: str
51 description: OSU provider icon.
52 name:
53 type: str
54 description: OSU provider ID.
55 required: true
56 osu_method:
57 aliases: ['osu-method']
58 type: list
59 elements: str
60 description: OSU method list.
61 choices: ['oma-dm', 'soap-xml-spp', 'reserved']
62 osu_nai:
63 aliases: ['osu-nai']
64 type: str
65 description: OSU NAI.
66 server_uri:
67 aliases: ['server-uri']
68 type: str
69 description: Server URI.
70 service_description:
71 aliases: ['service-description']
72 type: list
73 elements: dict
74 description: Service description.
75 suboptions:
76 lang:
77 type: str
78 description: Language code.
79 service_description:
80 aliases: ['service-description']
81 type: str
82 description: Service description.
83 service_id:
84 aliases: ['service-id']
85 type: int
86 description: OSU service ID.
87 '''
88
89 EXAMPLES = '''
90 - name: Example playbook (generated based on argument schema)
91 hosts: fortimanagers
92 connection: httpapi
93 gather_facts: false
94 tasks:
95 - name: Configure online sign up
96 fortinet.fortimanager.fmgr_hotspot20_h2qposuprovider:
97 # workspace_locking_adom: <global or your adom name>
98 adom: <your own value>
99 state: present # <value in [present, absent]>
100 hotspot20_h2qposuprovider:
101 name: "your value" # Required variable, string
102 # friendly_name:
103 # - friendly_name: <string>
104 # index: <integer>
105 # lang: <string>
106 # icon: <string>
107 # osu_method: ["oma-dm", "soap-xml-spp", "reserved"]
108 # osu_nai: <string>
109 # server_uri: <string>
110 # service_description:
111 # - lang: <string>
112 # service_description: <string>
113 # service_id: <integer>
114 '''
115
116 RETURN = '''
117 meta:
118 description: The result of the request.
119 type: dict
120 returned: always
121 contains:
122 request_url:
123 description: The full url requested.
124 returned: always
125 type: str
126 sample: /sys/login/user
127 response_code:
128 description: The status of api request.
129 returned: always
130 type: int
131 sample: 0
132 response_data:
133 description: The api response.
134 type: list
135 returned: always
136 response_message:
137 description: The descriptive message of the api response.
138 type: str
139 returned: always
140 sample: OK.
141 system_information:
142 description: The information of the target system.
143 type: dict
144 returned: always
145 rc:
146 description: The status the request.
147 type: int
148 returned: always
149 sample: 0
150 version_check_warning:
151 description: Warning if the parameters used in the playbook are not supported by the current FortiManager version.
152 type: list
153 returned: complex
154 '''
155 from ansible.module_utils.basic import AnsibleModule
156 from ansible.module_utils.connection import Connection
157 from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass
158 from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec
159
160
161 def main():
162 urls_list = [
163 '/pm/config/adom/{adom}/obj/wireless-controller/hotspot20/h2qp-osu-provider',
164 '/pm/config/global/obj/wireless-controller/hotspot20/h2qp-osu-provider'
165 ]
166 module_arg_spec = {
167 'adom': {'required': True, 'type': 'str'},
168 'revision_note': {'type': 'str'},
169 'hotspot20_h2qposuprovider': {
170 'type': 'dict', 'v_range': [['6.0.0', '']],
171 'options': {
172 'friendly-name': {
173 'type': 'list',
174 'options': {'friendly-name': {'type': 'str'}, 'index': {'type': 'int'}, 'lang': {'type': 'str'}},
175 'elements': 'dict'
176 },
177 'icon': {'type': 'str'},
178 'name': {'required': True, 'type': 'str'},
179 'osu-method': {'type': 'list', 'choices': ['oma-dm', 'soap-xml-spp', 'reserved'], 'elements': 'str'},
180 'osu-nai': {'type': 'str'},
181 'server-uri': {'type': 'str'},
182 'service-description': {
183 'type': 'list',
184 'options': {'lang': {'type': 'str'}, 'service-description': {'type': 'str'}, 'service-id': {'type': 'int'}},
185 'elements': 'dict'
186 }
187 }
188 }
189 }
190
191 module_option_spec = get_module_arg_spec('full crud')
192 module_arg_spec.update(module_option_spec)
193 check_galaxy_version(module_arg_spec)
194 module = AnsibleModule(argument_spec=check_parameter_bypass(module_arg_spec, 'hotspot20_h2qposuprovider'),
195 supports_check_mode=True)
196 if not module._socket_path:
197 module.fail_json(msg='MUST RUN IN HTTPAPI MODE')
198 connection = Connection(module._socket_path)
199 fmgr = NAPIManager('full crud', module_arg_spec, urls_list,
200 'name', 'data', module, connection)
201 fmgr.process_crud()
202 module.exit_json(meta=module.params)
203
204
205 if __name__ == '__main__':
206 main()