Debian Codegraph @

ansible_collections/cisco/meraki/plugins/modules/organizations_adaptive_policy_acls.py

raw
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3
4 # Copyright (c) 2021, Cisco Systems
5 # GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
6
7 DOCUMENTATION = r"""
8 module: organizations_adaptive_policy_acls
9 short_description: Resource module for organizations _adaptivepolicy _acls
10 description:
11 - Manage operations create, update and delete of the resource organizations _adaptivepolicy
12 _acls.
13 - Creates new adaptive policy ACL.
14 - Deletes the specified adaptive policy ACL. Note this adaptive policy ACL will
15 also be removed from policies using it.
16 - Updates an adaptive policy ACL.
17 version_added: '1.0.0'
18 extends_documentation_fragment:
19 - cisco.meraki.module
20 author: Francisco Munoz (@fmunoz)
21 options:
22 aclId:
23 description: AclId path parameter. Acl ID.
24 type: str
25 description:
26 description: Description of the adaptive policy ACL.
27 type: str
28 ipVersion:
29 description: IP version of adpative policy ACL. One of 'any', 'ipv4' or 'ipv6'.
30 type: str
31 name:
32 description: Name of the adaptive policy ACL.
33 type: str
34 organizationId:
35 description: OrganizationId path parameter. Organization ID.
36 type: str
37 rules:
38 description: An ordered array of the adaptive policy ACL rules.
39 elements: dict
40 suboptions:
41 dstPort:
42 description: Destination port. Must be in the format of single port '1', port
43 list '1,2' or port range '1-10', and in the range of 1-65535, or 'any'.
44 Default is 'any'.
45 type: str
46 log:
47 description: If enabled, when this rule is hit an entry will be logged to
48 the event log.
49 type: bool
50 policy:
51 description: '''allow'' or ''deny'' traffic specified by this rule.'
52 type: str
53 protocol:
54 description: The type of protocol (must be 'tcp', 'udp', 'icmp' or 'any').
55 type: str
56 srcPort:
57 description: Source port. Must be in the format of single port '1', port list
58 '1,2' or port range '1-10', and in the range of 1-65535, or 'any'. Default
59 is 'any'.
60 type: str
61 tcpEstablished:
62 description: If enabled, means TCP connection with this node must be established.
63 type: bool
64 type: list
65 requirements:
66 - meraki >= 2.4.9
67 - python >= 3.5
68 seealso:
69 - name: Cisco Meraki documentation for organizations createOrganizationAdaptivePolicyAcl
70 description: Complete reference of the createOrganizationAdaptivePolicyAcl API.
71 link: https://developer.cisco.com/meraki/api-v1/#!create-organization-adaptive-policy-acl
72 - name: Cisco Meraki documentation for organizations deleteOrganizationAdaptivePolicyAcl
73 description: Complete reference of the deleteOrganizationAdaptivePolicyAcl API.
74 link: https://developer.cisco.com/meraki/api-v1/#!delete-organization-adaptive-policy-acl
75 - name: Cisco Meraki documentation for organizations updateOrganizationAdaptivePolicyAcl
76 description: Complete reference of the updateOrganizationAdaptivePolicyAcl API.
77 link: https://developer.cisco.com/meraki/api-v1/#!update-organization-adaptive-policy-acl
78 notes:
79 - SDK Method used are
80 organizations.Organizations.create_organization_adaptive_policy_acl,
81 organizations.Organizations.delete_organization_adaptive_policy_acl,
82 organizations.Organizations.update_organization_adaptive_policy_acl,
83 - Paths used are
84 post /organizations/{organizationId}/adaptivePolicy/acls,
85 delete
86 /organizations/{organizationId}/adaptivePolicy/acls/{aclId},
87 put /organizations/{organizationId}/adaptivePolicy/acls/{aclId},
88 """
89
90 EXAMPLES = r"""
91 - name: Create
92 cisco.meraki.organizations_adaptive_policy_acls:
93 meraki_api_key: "{{ meraki_api_key }}"
94 meraki_base_url: "{{ meraki_base_url }}"
95 meraki_single_request_timeout: "{{ meraki_single_request_timeout }}"
96 meraki_certificate_path: "{{ meraki_certificate_path }}"
97 meraki_requests_proxy: "{{ meraki_requests_proxy }}"
98 meraki_wait_on_rate_limit: "{{ meraki_wait_on_rate_limit }}"
99 meraki_nginx_429_retry_wait_time: "{{ meraki_nginx_429_retry_wait_time }}"
100 meraki_action_batch_retry_wait_time: "{{ meraki_action_batch_retry_wait_time }}"
101 meraki_retry_4xx_error: "{{ meraki_retry_4xx_error }}"
102 meraki_retry_4xx_error_wait_time: "{{ meraki_retry_4xx_error_wait_time }}"
103 meraki_maximum_retries: "{{ meraki_maximum_retries }}"
104 meraki_output_log: "{{ meraki_output_log }}"
105 meraki_log_file_prefix: "{{ meraki_log_file_prefix }}"
106 meraki_log_path: "{{ meraki_log_path }}"
107 meraki_print_console: "{{ meraki_print_console }}"
108 meraki_suppress_logging: "{{ meraki_suppress_logging }}"
109 meraki_simulate: "{{ meraki_simulate }}"
110 meraki_be_geo_id: "{{ meraki_be_geo_id }}"
111 meraki_caller: "{{ meraki_caller }}"
112 meraki_use_iterator_for_get_pages: "{{ meraki_use_iterator_for_get_pages }}"
113 meraki_inherit_logging_config: "{{ meraki_inherit_logging_config }}"
114 state: present
115 description: Blocks sensitive web traffic
116 ipVersion: ipv6
117 name: Block sensitive web traffic
118 organizationId: string
119 rules:
120 - dstPort: 22-30
121 log: true
122 policy: deny
123 protocol: tcp
124 srcPort: 1,33
125 tcpEstablished: true
126 - name: Update by id
127 cisco.meraki.organizations_adaptive_policy_acls:
128 meraki_api_key: "{{ meraki_api_key }}"
129 meraki_base_url: "{{ meraki_base_url }}"
130 meraki_single_request_timeout: "{{ meraki_single_request_timeout }}"
131 meraki_certificate_path: "{{ meraki_certificate_path }}"
132 meraki_requests_proxy: "{{ meraki_requests_proxy }}"
133 meraki_wait_on_rate_limit: "{{ meraki_wait_on_rate_limit }}"
134 meraki_nginx_429_retry_wait_time: "{{ meraki_nginx_429_retry_wait_time }}"
135 meraki_action_batch_retry_wait_time: "{{ meraki_action_batch_retry_wait_time }}"
136 meraki_retry_4xx_error: "{{ meraki_retry_4xx_error }}"
137 meraki_retry_4xx_error_wait_time: "{{ meraki_retry_4xx_error_wait_time }}"
138 meraki_maximum_retries: "{{ meraki_maximum_retries }}"
139 meraki_output_log: "{{ meraki_output_log }}"
140 meraki_log_file_prefix: "{{ meraki_log_file_prefix }}"
141 meraki_log_path: "{{ meraki_log_path }}"
142 meraki_print_console: "{{ meraki_print_console }}"
143 meraki_suppress_logging: "{{ meraki_suppress_logging }}"
144 meraki_simulate: "{{ meraki_simulate }}"
145 meraki_be_geo_id: "{{ meraki_be_geo_id }}"
146 meraki_caller: "{{ meraki_caller }}"
147 meraki_use_iterator_for_get_pages: "{{ meraki_use_iterator_for_get_pages }}"
148 meraki_inherit_logging_config: "{{ meraki_inherit_logging_config }}"
149 state: present
150 aclId: string
151 description: Blocks sensitive web traffic
152 ipVersion: ipv6
153 name: Block sensitive web traffic
154 organizationId: string
155 rules:
156 - dstPort: 22-30
157 log: true
158 policy: deny
159 protocol: tcp
160 srcPort: 1,33
161 tcpEstablished: true
162 - name: Delete by id
163 cisco.meraki.organizations_adaptive_policy_acls:
164 meraki_api_key: "{{ meraki_api_key }}"
165 meraki_base_url: "{{ meraki_base_url }}"
166 meraki_single_request_timeout: "{{ meraki_single_request_timeout }}"
167 meraki_certificate_path: "{{ meraki_certificate_path }}"
168 meraki_requests_proxy: "{{ meraki_requests_proxy }}"
169 meraki_wait_on_rate_limit: "{{ meraki_wait_on_rate_limit }}"
170 meraki_nginx_429_retry_wait_time: "{{ meraki_nginx_429_retry_wait_time }}"
171 meraki_action_batch_retry_wait_time: "{{ meraki_action_batch_retry_wait_time }}"
172 meraki_retry_4xx_error: "{{ meraki_retry_4xx_error }}"
173 meraki_retry_4xx_error_wait_time: "{{ meraki_retry_4xx_error_wait_time }}"
174 meraki_maximum_retries: "{{ meraki_maximum_retries }}"
175 meraki_output_log: "{{ meraki_output_log }}"
176 meraki_log_file_prefix: "{{ meraki_log_file_prefix }}"
177 meraki_log_path: "{{ meraki_log_path }}"
178 meraki_print_console: "{{ meraki_print_console }}"
179 meraki_suppress_logging: "{{ meraki_suppress_logging }}"
180 meraki_simulate: "{{ meraki_simulate }}"
181 meraki_be_geo_id: "{{ meraki_be_geo_id }}"
182 meraki_caller: "{{ meraki_caller }}"
183 meraki_use_iterator_for_get_pages: "{{ meraki_use_iterator_for_get_pages }}"
184 meraki_inherit_logging_config: "{{ meraki_inherit_logging_config }}"
185 state: absent
186 aclId: string
187 organizationId: string
188 """
189 RETURN = r"""
190 meraki_response:
191 description: A dictionary or list with the response returned by the Cisco Meraki Python SDK
192 returned: always
193 type: dict
194 sample: >
195 {
196 "aclId": "string",
197 "name": "string",
198 "description": "string",
199 "ipVersion": "string",
200 "rules": [
201 {
202 "policy": "string",
203 "protocol": "string",
204 "srcPort": "string",
205 "dstPort": "string",
206 "log": true,
207 "tcpEstablished": true
208 }
209 ],
210 "createdAt": "string",
211 "updatedAt": "string"
212 }
213 """