Debian Codegraph @

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