Debian Codegraph @

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