Debian Codegraph @

ansible_collections/check_point/mgmt/plugins/modules/cp_mgmt_delete_nat_rule.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": ["deprecated"],
27 "supported_by": "community",
28 }
29
30 DOCUMENTATION = """
31 ---
32 module: cp_mgmt_delete_nat_rule
33 short_description: Delete existing object using object name or uid.
34 description:
35 - Delete existing object using object name or uid.
36 - All operations are performed over Web Services API.
37 - Available from R80 management version.
38 version_added: "2.0.0"
39 author: "Or Soffer (@chkp-orso)"
40 deprecated:
41 alternative: cp_mgmt_nat_rule
42 why: Newer and updated module released with more functionality.
43 removed_at_date: '2024-11-01'
44 options:
45 rule_number:
46 description:
47 - Rule number.
48 type: str
49 package:
50 description:
51 - Name of the package.
52 type: str
53 details_level:
54 description:
55 - The level of detail for some of the fields in the response can vary from showing only the UID value of the object to a fully detailed
56 representation of the object.
57 type: str
58 choices: ['uid', 'standard', 'full']
59 extends_documentation_fragment: check_point.mgmt.checkpoint_commands
60 """
61
62 EXAMPLES = """
63 - name: delete-nat-rule
64 cp_mgmt_delete_nat_rule:
65 package: standard
66 """
67
68 RETURN = """
69 cp_mgmt_delete_nat_rule:
70 description: The checkpoint delete-nat-rule output.
71 returned: always.
72 type: dict
73 """
74
75 from ansible.module_utils.basic import AnsibleModule
76 from ansible_collections.check_point.mgmt.plugins.module_utils.checkpoint import (
77 checkpoint_argument_spec_for_commands,
78 api_command,
79 )
80
81
82 def main():
83 argument_spec = dict(
84 rule_number=dict(type="str"),
85 package=dict(type="str"),
86 details_level=dict(type="str", choices=["uid", "standard", "full"]),
87 )
88 argument_spec.update(checkpoint_argument_spec_for_commands)
89
90 module = AnsibleModule(argument_spec=argument_spec)
91
92 command = "delete-nat-rule"
93
94 result = api_command(module, command)
95 module.exit_json(**result)
96
97
98 if __name__ == "__main__":
99 main()