Debian Codegraph @

ansible_collections/check_point/mgmt/plugins/modules/cp_mgmt_gsn_handover_group.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_gsn_handover_group
31 short_description: Manages gsn-handover-group objects on Checkpoint over Web Services API
32 description:
33 - Manages gsn-handover-group objects on Checkpoint devices including creating, updating and removing objects.
34 - All operations are performed over Web Services API.
35 - Available from R80.40 JHF management version.
36 version_added: "5.0.0"
37 author: "Eden Brillant (@chkp-edenbr)"
38 options:
39 name:
40 description:
41 - Object name.
42 type: str
43 required: True
44 enforce_gtp:
45 description:
46 - Enable enforce GTP signal packet rate limit from this group.
47 - Available from R81 management version.
48 type: bool
49 gtp_rate:
50 description:
51 - Limit of the GTP rate in PDU/sec.
52 - Available from R81 management version.
53 type: int
54 members:
55 description:
56 - Collection of GSN handover group members identified by the name or UID.
57 type: list
58 elements: str
59 tags:
60 description:
61 - Collection of tag identifiers.
62 type: list
63 elements: str
64 color:
65 description:
66 - Color of the object. Should be one of existing colors.
67 type: str
68 choices: ['aquamarine', 'black', 'blue', 'crete blue', 'burlywood', 'cyan', 'dark green', 'khaki', 'orchid', 'dark orange', 'dark sea green',
69 'pink', 'turquoise', 'dark blue', 'firebrick', 'brown', 'forest green', 'gold', 'dark gold', 'gray', 'dark gray', 'light green', 'lemon chiffon',
70 'coral', 'sea green', 'sky blue', 'magenta', 'purple', 'slate blue', 'violet red', 'navy blue', 'olive', 'orange', 'red', 'sienna', 'yellow']
71 comments:
72 description:
73 - Comments string.
74 type: str
75 details_level:
76 description:
77 - 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
78 representation of the object.
79 type: str
80 choices: ['uid', 'standard', 'full']
81 groups:
82 description:
83 - Collection of group identifiers.
84 type: list
85 elements: str
86 ignore_warnings:
87 description:
88 - Apply changes ignoring warnings.
89 type: bool
90 ignore_errors:
91 description:
92 - Apply changes ignoring errors. You won't be able to publish such a changes. If ignore-warnings flag was omitted - warnings will also be ignored.
93 type: bool
94 extends_documentation_fragment: check_point.mgmt.checkpoint_objects
95 """
96
97 EXAMPLES = """
98 - name: add-gsn-handover-group
99 cp_mgmt_gsn_handover_group:
100 enforce_gtp: true
101 gtp_rate: 2048
102 members:
103 - All_Internet
104 name: gsnhandovergroup
105 state: present
106
107 - name: set-gsn-handover-group
108 cp_mgmt_gsn_handover_group:
109 enforce_gtp: false
110 name: gsnhandovergroup
111 state: present
112
113 - name: delete-gsn-handover-group
114 cp_mgmt_gsn_handover_group:
115 name: gsnhandovergroup
116 state: absent
117 """
118
119 RETURN = """
120 cp_mgmt_gsn_handover_group:
121 description: The checkpoint object created or updated.
122 returned: always, except when deleting the object.
123 type: dict
124 """
125
126 from ansible.module_utils.basic import AnsibleModule
127 from ansible_collections.check_point.mgmt.plugins.module_utils.checkpoint import checkpoint_argument_spec_for_objects, api_call
128
129
130 def main():
131 argument_spec = dict(
132 name=dict(type='str', required=True),
133 enforce_gtp=dict(type='bool'),
134 gtp_rate=dict(type='int'),
135 members=dict(type='list', elements='str'),
136 tags=dict(type='list', elements='str'),
137 color=dict(type='str', choices=['aquamarine', 'black', 'blue', 'crete blue', 'burlywood', 'cyan', 'dark green',
138 'khaki', 'orchid', 'dark orange', 'dark sea green', 'pink', 'turquoise', 'dark blue', 'firebrick', 'brown',
139 'forest green', 'gold', 'dark gold', 'gray', 'dark gray', 'light green', 'lemon chiffon', 'coral', 'sea green',
140 'sky blue', 'magenta', 'purple', 'slate blue', 'violet red', 'navy blue', 'olive', 'orange', 'red', 'sienna',
141 'yellow']),
142 comments=dict(type='str'),
143 details_level=dict(type='str', choices=['uid', 'standard', 'full']),
144 groups=dict(type='list', elements='str'),
145 ignore_warnings=dict(type='bool'),
146 ignore_errors=dict(type='bool')
147 )
148 argument_spec.update(checkpoint_argument_spec_for_objects)
149
150 module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=True)
151 api_call_object = 'gsn-handover-group'
152
153 result = api_call(module, api_call_object)
154 module.exit_json(**result)
155
156
157 if __name__ == '__main__':
158 main()