Debian Codegraph @

ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_securityconsole_cliprof_check.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_securityconsole_cliprof_check
15 short_description: Securityconsole cliprof check
16 version_added: "2.1.0"
17 extends_documentation_fragment:
18 - fortinet.fortimanager.general
19 options:
20 securityconsole_cliprof_check:
21 description: The top level parameters set.
22 required: false
23 type: dict
24 suboptions:
25 adom:
26 type: str
27 description: Source ADOM name.
28 cliprof:
29 type: str
30 description: Cliprof.
31 scope:
32 type: list
33 elements: dict
34 description: Scope.
35 suboptions:
36 name:
37 type: str
38 description: Name.
39 vdom:
40 type: str
41 description: Vdom.
42 '''
43
44 EXAMPLES = '''
45 - name: Example playbook (generated based on argument schema)
46 hosts: fortimanagers
47 connection: httpapi
48 gather_facts: false
49 tasks:
50 - name: Securityconsole cliprof check
51 fortinet.fortimanager.fmgr_securityconsole_cliprof_check:
52 # workspace_locking_adom: <global or your adom name>
53 securityconsole_cliprof_check:
54 # adom: <string>
55 # cliprof: <string>
56 # scope:
57 # - name: <string>
58 # vdom: <string>
59 '''
60
61 RETURN = '''
62 meta:
63 description: The result of the request.
64 type: dict
65 returned: always
66 contains:
67 request_url:
68 description: The full url requested.
69 returned: always
70 type: str
71 sample: /sys/login/user
72 response_code:
73 description: The status of api request.
74 returned: always
75 type: int
76 sample: 0
77 response_data:
78 description: The api response.
79 type: list
80 returned: always
81 response_message:
82 description: The descriptive message of the api response.
83 type: str
84 returned: always
85 sample: OK.
86 system_information:
87 description: The information of the target system.
88 type: dict
89 returned: always
90 rc:
91 description: The status the request.
92 type: int
93 returned: always
94 sample: 0
95 version_check_warning:
96 description: Warning if the parameters used in the playbook are not supported by the current FortiManager version.
97 type: list
98 returned: complex
99 '''
100 from ansible.module_utils.basic import AnsibleModule
101 from ansible.module_utils.connection import Connection
102 from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass
103 from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec
104
105
106 def main():
107 urls_list = [
108 '/securityconsole/cliprof/check'
109 ]
110 module_arg_spec = {
111 'securityconsole_cliprof_check': {
112 'type': 'dict', 'v_range': [['7.0.1', '']],
113 'options': {
114 'adom': {'v_range': [['7.0.1', '']], 'type': 'str'},
115 'cliprof': {'v_range': [['7.0.1', '']], 'type': 'str'},
116 'scope': {
117 'v_range': [['7.2.1', '']],
118 'type': 'list',
119 'options': {'name': {'v_range': [['7.2.1', '']], 'type': 'str'}, 'vdom': {'v_range': [['7.2.1', '']], 'type': 'str'}},
120 'elements': 'dict'
121 }
122 }
123 }
124 }
125
126 module_option_spec = get_module_arg_spec('exec')
127 module_arg_spec.update(module_option_spec)
128 check_galaxy_version(module_arg_spec)
129 module = AnsibleModule(argument_spec=check_parameter_bypass(module_arg_spec, 'securityconsole_cliprof_check'),
130 supports_check_mode=True)
131 if not module._socket_path:
132 module.fail_json(msg='MUST RUN IN HTTPAPI MODE')
133 connection = Connection(module._socket_path)
134 fmgr = NAPIManager('exec', module_arg_spec, urls_list,
135 None, 'data', module, connection)
136 fmgr.process_exec()
137 module.exit_json(meta=module.params)
138
139
140 if __name__ == '__main__':
141 main()