Debian Codegraph @

ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_vap_portalmessageoverrides.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_vap_portalmessageoverrides
15 short_description: Individual message overrides.
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 vap:
29 description: The parameter (vap) in requested url.
30 type: str
31 required: true
32 vap_portalmessageoverrides:
33 description: The top level parameters set.
34 required: false
35 type: dict
36 suboptions:
37 auth_disclaimer_page:
38 aliases: ['auth-disclaimer-page']
39 type: str
40 description: Override auth-disclaimer-page message with message from portal-message-overrides group.
41 auth_login_failed_page:
42 aliases: ['auth-login-failed-page']
43 type: str
44 description: Override auth-login-failed-page message with message from portal-message-overrides group.
45 auth_login_page:
46 aliases: ['auth-login-page']
47 type: str
48 description: Override auth-login-page message with message from portal-message-overrides group.
49 auth_reject_page:
50 aliases: ['auth-reject-page']
51 type: str
52 description: Override auth-reject-page message with message from portal-message-overrides group.
53 '''
54
55 EXAMPLES = '''
56 - name: Example playbook (generated based on argument schema)
57 hosts: fortimanagers
58 connection: httpapi
59 gather_facts: false
60 tasks:
61 - name: Individual message overrides.
62 fortinet.fortimanager.fmgr_vap_portalmessageoverrides:
63 # workspace_locking_adom: <global or your adom name>
64 adom: <your own value>
65 vap: <your own value>
66 vap_portalmessageoverrides:
67 # auth_disclaimer_page: <string>
68 # auth_login_failed_page: <string>
69 # auth_login_page: <string>
70 # auth_reject_page: <string>
71 '''
72
73 RETURN = '''
74 meta:
75 description: The result of the request.
76 type: dict
77 returned: always
78 contains:
79 request_url:
80 description: The full url requested.
81 returned: always
82 type: str
83 sample: /sys/login/user
84 response_code:
85 description: The status of api request.
86 returned: always
87 type: int
88 sample: 0
89 response_data:
90 description: The api response.
91 type: list
92 returned: always
93 response_message:
94 description: The descriptive message of the api response.
95 type: str
96 returned: always
97 sample: OK.
98 system_information:
99 description: The information of the target system.
100 type: dict
101 returned: always
102 rc:
103 description: The status the request.
104 type: int
105 returned: always
106 sample: 0
107 version_check_warning:
108 description: Warning if the parameters used in the playbook are not supported by the current FortiManager version.
109 type: list
110 returned: complex
111 '''
112 from ansible.module_utils.basic import AnsibleModule
113 from ansible.module_utils.connection import Connection
114 from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass
115 from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec
116
117
118 def main():
119 urls_list = [
120 '/pm/config/adom/{adom}/obj/wireless-controller/vap/{vap}/portal-message-overrides',
121 '/pm/config/global/obj/wireless-controller/vap/{vap}/portal-message-overrides'
122 ]
123 module_arg_spec = {
124 'adom': {'required': True, 'type': 'str'},
125 'vap': {'required': True, 'type': 'str'},
126 'revision_note': {'type': 'str'},
127 'vap_portalmessageoverrides': {
128 'type': 'dict', 'v_range': [['6.0.0', '']],
129 'options': {
130 'auth-disclaimer-page': {'type': 'str'},
131 'auth-login-failed-page': {'type': 'str'},
132 'auth-login-page': {'type': 'str'},
133 'auth-reject-page': {'type': 'str'}
134 }
135 }
136 }
137
138 module_option_spec = get_module_arg_spec('partial crud')
139 module_arg_spec.update(module_option_spec)
140 check_galaxy_version(module_arg_spec)
141 module = AnsibleModule(argument_spec=check_parameter_bypass(module_arg_spec, 'vap_portalmessageoverrides'),
142 supports_check_mode=True)
143 if not module._socket_path:
144 module.fail_json(msg='MUST RUN IN HTTPAPI MODE')
145 connection = Connection(module._socket_path)
146 fmgr = NAPIManager('partial crud', module_arg_spec, urls_list,
147 None, 'data', module, connection)
148 fmgr.process_partial_crud()
149 module.exit_json(meta=module.params)
150
151
152 if __name__ == '__main__':
153 main()