Debian Codegraph @

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