Debian Codegraph @

ansible_collections/check_point/mgmt/plugins/modules/cp_mgmt_verify_policy.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 = {
25 "metadata_version": "1.1",
26 "status": ["preview"],
27 "supported_by": "community",
28 }
29
30 DOCUMENTATION = """
31 ---
32 module: cp_mgmt_verify_policy
33 short_description: Verifies the policy of the selected package.
34 description:
35 - Verifies the policy of the selected package.
36 - All operations are performed over Web Services API.
37 - Available from R80.10 management version.
38 version_added: "1.0.0"
39 author: "Or Soffer (@chkp-orso)"
40 options:
41 policy_package:
42 description:
43 - Policy package identified by the name or UID.
44 type: str
45 extends_documentation_fragment: check_point.mgmt.checkpoint_commands
46 """
47
48 EXAMPLES = """
49 - name: verify-policy
50 cp_mgmt_verify_policy:
51 policy_package: standard
52 """
53
54 RETURN = """
55 cp_mgmt_verify_policy:
56 description: The checkpoint verify-policy output.
57 returned: always.
58 type: dict
59 """
60
61 from ansible.module_utils.basic import AnsibleModule
62 from ansible_collections.check_point.mgmt.plugins.module_utils.checkpoint import (
63 checkpoint_argument_spec_for_commands,
64 api_command,
65 )
66
67
68 def main():
69 argument_spec = dict(policy_package=dict(type="str"))
70 argument_spec.update(checkpoint_argument_spec_for_commands)
71
72 module = AnsibleModule(argument_spec=argument_spec)
73
74 command = "verify-policy"
75
76 result = api_command(module, command)
77 module.exit_json(**result)
78
79
80 if __name__ == "__main__":
81 main()