Debian Codegraph @

ansible_collections/check_point/mgmt/plugins/modules/cp_mgmt_set_cloud_services.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_set_cloud_services
31 short_description: Set the connection settings between the Management Server and Check Point's Infinity Portal.
32 description:
33 - Set the connection settings between the Management Server and Check Point's Infinity Portal.
34 - All operations are performed over Web Services API.
35 - Available from R81.20 management version.
36 version_added: "5.0.0"
37 author: "Eden Brillant (@chkp-edenbr)"
38 options:
39 gateways_onboarding_settings:
40 description:
41 - Gateways on-boarding to Infinity Portal settings.
42 type: dict
43 suboptions:
44 connection_method:
45 description:
46 - Indicate whether Gateways will be connected to Infinity Portal automatically or only after policy installation.
47 type: str
48 choices: ['automatically', 'after install policy']
49 participant_gateways:
50 description:
51 - Which Gateways will be connected to Infinity Portal.
52 type: str
53 choices: ['all', 'specific']
54 specific_gateways:
55 description:
56 - Selection of targets identified by the name or UID which will be on-boarded to the cloud. Configuration will be applied only when
57 "participant-gateways" field is set to "specific".
58 type: list
59 elements: str
60 details_level:
61 description:
62 - 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
63 representation of the object.
64 type: str
65 choices: ['uid', 'standard', 'full']
66 status:
67 description:
68 - Connection status.
69 type: str
70 choices: ['connected', 'disabled']
71 extends_documentation_fragment: check_point.mgmt.checkpoint_commands
72 """
73
74 EXAMPLES = """
75 - name: set-cloud-services
76 cp_mgmt_set_cloud_services:
77 gateways_onboarding_settings:
78 connection_method: after install policy
79 participant_gateways: specific
80 specific_gateways: gw1
81 """
82
83 RETURN = """
84 cp_mgmt_set_cloud_services:
85 description: The checkpoint set-cloud-services output.
86 returned: always.
87 type: dict
88 """
89
90 from ansible.module_utils.basic import AnsibleModule
91 from ansible_collections.check_point.mgmt.plugins.module_utils.checkpoint import checkpoint_argument_spec_for_commands, api_command
92
93
94 def main():
95 argument_spec = dict(
96 gateways_onboarding_settings=dict(type='dict', options=dict(
97 connection_method=dict(type='str', choices=['automatically', 'after install policy']),
98 participant_gateways=dict(type='str', choices=['all', 'specific']),
99 specific_gateways=dict(type='list', elements='str'),
100 details_level=dict(type='str', choices=['uid', 'standard', 'full'])
101 )),
102 status=dict(type='str', choices=['connected', 'disabled'])
103 )
104 argument_spec.update(checkpoint_argument_spec_for_commands)
105
106 module = AnsibleModule(argument_spec=argument_spec)
107
108 command = "set-cloud-services"
109
110 result = api_command(module, command)
111 module.exit_json(**result)
112
113
114 if __name__ == '__main__':
115 main()