Debian Codegraph @

ansible_collections/check_point/mgmt/plugins/modules/cp_mgmt_central_license_facts.py

raw
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3 #
4 # Ansible module to manage CheckPoint Firewall (c) 2019
5 #
6 # Ansible is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # Ansible is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with Ansible. If not, see <http://www.gnu.org/licenses/>.
18 #
19
20 from __future__ import (absolute_import, division, print_function)
21
22 __metaclass__ = type
23
24 ANSIBLE_METADATA = {'metadata_version': '1.1',
25 'status': ['preview'],
26 'supported_by': 'community'}
27
28 DOCUMENTATION = """
29 ---
30 module: cp_mgmt_central_license_facts
31 short_description: Get central-license objects facts on Checkpoint over Web Services API
32 description:
33 - Get central-license objects facts on Checkpoint devices.
34 - All operations are performed over Web Services API.
35 - This module handles both operations, get a specific object and get several objects,
36 For getting a specific object use the parameter 'signature'.
37 - Available from R81.20 JHF management version.
38 version_added: "5.2.0"
39 author: "Eden Brillant (@chkp-edenbr)"
40 options:
41 signature:
42 description:
43 - The license's signature. This parameter is relevant only for getting a specific object.
44 type: str
45 extends_documentation_fragment: checkpoint_facts
46 """
47
48 EXAMPLES = """
49 - name: show-central-license
50 cp_mgmt_central_license_facts:
51 signature: dLLLLL-WWWWWW-ZZZZZZ-QQQQQQ
52
53 - name: show-central-licenses
54 cp_mgmt_show_central_licenses:
55 """
56
57 RETURN = """
58 ansible_facts:
59 description: The checkpoint object facts.
60 returned: always.
61 type: dict
62 """
63
64 from ansible.module_utils.basic import AnsibleModule
65 from ansible_collections.check_point.mgmt.plugins.module_utils.checkpoint import (
66 checkpoint_argument_spec_for_facts,
67 api_call_facts,
68 )
69
70
71 def main():
72 argument_spec = dict(
73 signature=dict(type='str')
74 )
75 argument_spec.update(checkpoint_argument_spec_for_facts)
76
77 module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=True)
78
79 api_call_object = "central-license"
80 api_call_object_plural_version = "central-licenses"
81
82 result = api_call_facts(module, api_call_object, api_call_object_plural_version)
83 module.exit_json(ansible_facts=result)
84
85
86 if __name__ == '__main__':
87 main()