Debian Codegraph @

ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_hotspot20_icon.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_icon
15 short_description: Configure OSU provider icon.
16 version_added: "2.1.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_icon:
29 description: The top level parameters set.
30 required: false
31 type: dict
32 suboptions:
33 icon_list:
34 aliases: ['icon-list']
35 type: list
36 elements: dict
37 description: Icon list.
38 suboptions:
39 file:
40 type: str
41 description: Icon file.
42 height:
43 type: int
44 description: Icon height.
45 lang:
46 type: str
47 description: Language code.
48 name:
49 type: str
50 description: Icon name.
51 type:
52 type: str
53 description: Icon type.
54 choices: ['bmp', 'gif', 'jpeg', 'png', 'tiff']
55 width:
56 type: int
57 description: Icon width.
58 name:
59 type: str
60 description: Icon list ID.
61 required: true
62 '''
63
64 EXAMPLES = '''
65 - name: Example playbook (generated based on argument schema)
66 hosts: fortimanagers
67 connection: httpapi
68 gather_facts: false
69 tasks:
70 - name: Configure OSU provider icon.
71 fortinet.fortimanager.fmgr_hotspot20_icon:
72 # workspace_locking_adom: <global or your adom name>
73 adom: <your own value>
74 state: present # <value in [present, absent]>
75 hotspot20_icon:
76 name: "your value" # Required variable, string
77 # icon_list:
78 # - file: <string>
79 # height: <integer>
80 # lang: <string>
81 # name: <string>
82 # type: <value in [bmp, gif, jpeg, ...]>
83 # width: <integer>
84 '''
85
86 RETURN = '''
87 meta:
88 description: The result of the request.
89 type: dict
90 returned: always
91 contains:
92 request_url:
93 description: The full url requested.
94 returned: always
95 type: str
96 sample: /sys/login/user
97 response_code:
98 description: The status of api request.
99 returned: always
100 type: int
101 sample: 0
102 response_data:
103 description: The api response.
104 type: list
105 returned: always
106 response_message:
107 description: The descriptive message of the api response.
108 type: str
109 returned: always
110 sample: OK.
111 system_information:
112 description: The information of the target system.
113 type: dict
114 returned: always
115 rc:
116 description: The status the request.
117 type: int
118 returned: always
119 sample: 0
120 version_check_warning:
121 description: Warning if the parameters used in the playbook are not supported by the current FortiManager version.
122 type: list
123 returned: complex
124 '''
125 from ansible.module_utils.basic import AnsibleModule
126 from ansible.module_utils.connection import Connection
127 from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass
128 from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec
129
130
131 def main():
132 urls_list = [
133 '/pm/config/adom/{adom}/obj/wireless-controller/hotspot20/icon',
134 '/pm/config/global/obj/wireless-controller/hotspot20/icon'
135 ]
136 module_arg_spec = {
137 'adom': {'required': True, 'type': 'str'},
138 'revision_note': {'type': 'str'},
139 'hotspot20_icon': {
140 'type': 'dict', 'v_range': [['7.0.3', '']],
141 'options': {
142 'icon-list': {
143 'v_range': [['7.0.3', '']],
144 'type': 'list',
145 'options': {
146 'file': {'v_range': [['7.0.3', '']], 'type': 'str'},
147 'height': {'v_range': [['7.0.3', '']], 'type': 'int'},
148 'lang': {'v_range': [['7.0.3', '']], 'type': 'str'},
149 'name': {'v_range': [['7.0.3', '']], 'type': 'str'},
150 'type': {'v_range': [['7.0.3', '']], 'choices': ['bmp', 'gif', 'jpeg', 'png', 'tiff'], 'type': 'str'},
151 'width': {'v_range': [['7.0.3', '']], 'type': 'int'}
152 },
153 'elements': 'dict'
154 },
155 'name': {'v_range': [['7.0.3', '']], 'required': True, 'type': 'str'}
156 }
157 }
158 }
159
160 module_option_spec = get_module_arg_spec('full crud')
161 module_arg_spec.update(module_option_spec)
162 check_galaxy_version(module_arg_spec)
163 module = AnsibleModule(argument_spec=check_parameter_bypass(module_arg_spec, 'hotspot20_icon'),
164 supports_check_mode=True)
165 if not module._socket_path:
166 module.fail_json(msg='MUST RUN IN HTTPAPI MODE')
167 connection = Connection(module._socket_path)
168 fmgr = NAPIManager('full crud', module_arg_spec, urls_list,
169 'name', 'data', module, connection)
170 fmgr.process_crud()
171 module.exit_json(meta=module.params)
172
173
174 if __name__ == '__main__':
175 main()