Debian Codegraph @

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