Debian Codegraph @

ansible_collections/cisco/meraki/plugins/modules/devices_switch_routing_interfaces.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: devices_switch_routing_interfaces
9 short_description: Resource module for devices _switch _routing _interfaces
10 description:
11 - Manage operations create, update and delete of the resource devices _switch _routing
12 _interfaces.
13 - Create a layer 3 interface for a switch.
14 - Delete a layer 3 interface from the switch.
15 - Update a layer 3 interface for a switch.
16 version_added: '1.0.0'
17 extends_documentation_fragment:
18 - cisco.meraki.module
19 author: Francisco Munoz (@fmunoz)
20 options:
21 defaultGateway:
22 description: The next hop for any traffic that isn't going to a directly connected
23 subnet or over a static route. This IP address must exist in a subnet with a
24 L3 interface. Required if this is the first IPv4 interface.
25 type: str
26 interfaceId:
27 description: InterfaceId path parameter. Interface ID.
28 type: str
29 interfaceIp:
30 description: The IP address that will be used for Layer 3 routing on this VLAN
31 or subnet. This cannot be the same as the device management IP.
32 type: str
33 ipv6:
34 description: The IPv6 settings of the interface.
35 suboptions:
36 address:
37 description: The IPv6 address of the interface. Required if assignmentMode
38 is 'static'. Must not be included if assignmentMode is 'eui-64'.
39 type: str
40 assignmentMode:
41 description: The IPv6 assignment mode for the interface. Can be either 'eui-64'
42 or 'static'.
43 type: str
44 gateway:
45 description: The IPv6 default gateway of the interface. Required if prefix
46 is defined and this is the first interface with IPv6 configured.
47 type: str
48 prefix:
49 description: The IPv6 prefix of the interface. Required if IPv6 object is
50 included.
51 type: str
52 type: dict
53 loopback:
54 description: The loopback settings of the interface.
55 type: dict
56 mode:
57 description: L3 Interface mode, can be one of 'vlan', 'routed', 'loopback'. Default
58 is 'vlan'. CS 17.18 or higher is required for 'routed' mode.
59 type: str
60 multicastRouting:
61 description: Enable multicast support if, multicast routing between VLANs is required.
62 Options are 'disabled', 'enabled' or 'IGMP snooping querier'. Default is 'disabled'.
63 type: str
64 name:
65 description: A friendly name or description for the interface or VLAN (max length
66 128 characters).
67 type: str
68 ospfSettings:
69 description: The OSPF routing settings of the interface.
70 suboptions:
71 area:
72 description: The OSPF area to which this interface should belong. Can be either
73 'disabled' or the identifier of an existing OSPF area. Defaults to 'disabled'.
74 type: str
75 cost:
76 description: The path cost for this interface. Defaults to 1, but can be increased
77 up to 65535 to give lower priority.
78 type: int
79 isPassiveEnabled:
80 description: When enabled, OSPF will not run on the interface, but the subnet
81 will still be advertised.
82 type: bool
83 networkType:
84 description: OSPF network type.
85 type: str
86 type: dict
87 serial:
88 description: Serial path parameter.
89 type: str
90 subnet:
91 description: The network that this L3 interface is on, in CIDR notation (ex. 10.1.1.0/24).
92 type: str
93 switchPortId:
94 description: Switch Port ID when in Routed mode (CS 17.18 or higher required).
95 type: str
96 vlanId:
97 description: The VLAN this L3 interface is on. VLAN must be between 1 and 4094.
98 type: int
99 vrf:
100 description: The VRF settings of the interface. Requires IOS XE 17.18 or higher.
101 suboptions:
102 name:
103 description: The name of the VRF this interface belongs to.
104 type: str
105 type: dict
106 requirements:
107 - meraki >= 2.4.9
108 - python >= 3.5
109 seealso:
110 - name: Cisco Meraki documentation for switch createDeviceSwitchRoutingInterface
111 description: Complete reference of the createDeviceSwitchRoutingInterface API.
112 link: https://developer.cisco.com/meraki/api-v1/#!create-device-switch-routing-interface
113 - name: Cisco Meraki documentation for switch deleteDeviceSwitchRoutingInterface
114 description: Complete reference of the deleteDeviceSwitchRoutingInterface API.
115 link: https://developer.cisco.com/meraki/api-v1/#!delete-device-switch-routing-interface
116 - name: Cisco Meraki documentation for switch updateDeviceSwitchRoutingInterface
117 description: Complete reference of the updateDeviceSwitchRoutingInterface API.
118 link: https://developer.cisco.com/meraki/api-v1/#!update-device-switch-routing-interface
119 notes:
120 - SDK Method used are
121 switch.Switch.create_device_switch_routing_interface,
122 switch.Switch.delete_device_switch_routing_interface,
123 switch.Switch.update_device_switch_routing_interface,
124 - Paths used are
125 post /devices/{serial}/switch/routing/interfaces,
126 delete /devices/{serial}/switch/routing/interfaces/{interfaceId},
127 put /devices/{serial}/switch/routing/interfaces/{interfaceId},
128 """
129
130 EXAMPLES = r"""
131 - name: Create
132 cisco.meraki.devices_switch_routing_interfaces:
133 meraki_api_key: "{{ meraki_api_key }}"
134 meraki_base_url: "{{ meraki_base_url }}"
135 meraki_single_request_timeout: "{{ meraki_single_request_timeout }}"
136 meraki_certificate_path: "{{ meraki_certificate_path }}"
137 meraki_requests_proxy: "{{ meraki_requests_proxy }}"
138 meraki_wait_on_rate_limit: "{{ meraki_wait_on_rate_limit }}"
139 meraki_nginx_429_retry_wait_time: "{{ meraki_nginx_429_retry_wait_time }}"
140 meraki_action_batch_retry_wait_time: "{{ meraki_action_batch_retry_wait_time }}"
141 meraki_retry_4xx_error: "{{ meraki_retry_4xx_error }}"
142 meraki_retry_4xx_error_wait_time: "{{ meraki_retry_4xx_error_wait_time }}"
143 meraki_maximum_retries: "{{ meraki_maximum_retries }}"
144 meraki_output_log: "{{ meraki_output_log }}"
145 meraki_log_file_prefix: "{{ meraki_log_file_prefix }}"
146 meraki_log_path: "{{ meraki_log_path }}"
147 meraki_print_console: "{{ meraki_print_console }}"
148 meraki_suppress_logging: "{{ meraki_suppress_logging }}"
149 meraki_simulate: "{{ meraki_simulate }}"
150 meraki_be_geo_id: "{{ meraki_be_geo_id }}"
151 meraki_caller: "{{ meraki_caller }}"
152 meraki_use_iterator_for_get_pages: "{{ meraki_use_iterator_for_get_pages }}"
153 meraki_inherit_logging_config: "{{ meraki_inherit_logging_config }}"
154 state: present
155 defaultGateway: 192.168.1.1
156 interfaceIp: 192.168.1.2
157 ipv6:
158 address: 2001:db8::1
159 assignmentMode: static
160 gateway: 2001:db8::2
161 prefix: 2001:db8::/32
162 mode: vlan
163 multicastRouting: disabled
164 name: L3 interface
165 ospfSettings:
166 area: '0'
167 cost: 1
168 isPassiveEnabled: true
169 networkType: broadcast
170 serial: string
171 subnet: 192.168.1.0/24
172 switchPortId: '1'
173 vlanId: 100
174 vrf:
175 name: Blue
176 - name: Update by id
177 cisco.meraki.devices_switch_routing_interfaces:
178 meraki_api_key: "{{ meraki_api_key }}"
179 meraki_base_url: "{{ meraki_base_url }}"
180 meraki_single_request_timeout: "{{ meraki_single_request_timeout }}"
181 meraki_certificate_path: "{{ meraki_certificate_path }}"
182 meraki_requests_proxy: "{{ meraki_requests_proxy }}"
183 meraki_wait_on_rate_limit: "{{ meraki_wait_on_rate_limit }}"
184 meraki_nginx_429_retry_wait_time: "{{ meraki_nginx_429_retry_wait_time }}"
185 meraki_action_batch_retry_wait_time: "{{ meraki_action_batch_retry_wait_time }}"
186 meraki_retry_4xx_error: "{{ meraki_retry_4xx_error }}"
187 meraki_retry_4xx_error_wait_time: "{{ meraki_retry_4xx_error_wait_time }}"
188 meraki_maximum_retries: "{{ meraki_maximum_retries }}"
189 meraki_output_log: "{{ meraki_output_log }}"
190 meraki_log_file_prefix: "{{ meraki_log_file_prefix }}"
191 meraki_log_path: "{{ meraki_log_path }}"
192 meraki_print_console: "{{ meraki_print_console }}"
193 meraki_suppress_logging: "{{ meraki_suppress_logging }}"
194 meraki_simulate: "{{ meraki_simulate }}"
195 meraki_be_geo_id: "{{ meraki_be_geo_id }}"
196 meraki_caller: "{{ meraki_caller }}"
197 meraki_use_iterator_for_get_pages: "{{ meraki_use_iterator_for_get_pages }}"
198 meraki_inherit_logging_config: "{{ meraki_inherit_logging_config }}"
199 state: present
200 defaultGateway: 192.168.1.1
201 interfaceId: string
202 interfaceIp: 192.168.1.2
203 ipv6:
204 address: 2001:db8::1
205 assignmentMode: static
206 gateway: 2001:db8::2
207 prefix: 2001:db8::/32
208 multicastRouting: disabled
209 name: L3 interface
210 ospfSettings:
211 area: '0'
212 cost: 1
213 isPassiveEnabled: true
214 networkType: broadcast
215 serial: string
216 subnet: 192.168.1.0/24
217 switchPortId: '1'
218 vlanId: 100
219 vrf:
220 name: Blue
221 - name: Delete by id
222 cisco.meraki.devices_switch_routing_interfaces:
223 meraki_api_key: "{{ meraki_api_key }}"
224 meraki_base_url: "{{ meraki_base_url }}"
225 meraki_single_request_timeout: "{{ meraki_single_request_timeout }}"
226 meraki_certificate_path: "{{ meraki_certificate_path }}"
227 meraki_requests_proxy: "{{ meraki_requests_proxy }}"
228 meraki_wait_on_rate_limit: "{{ meraki_wait_on_rate_limit }}"
229 meraki_nginx_429_retry_wait_time: "{{ meraki_nginx_429_retry_wait_time }}"
230 meraki_action_batch_retry_wait_time: "{{ meraki_action_batch_retry_wait_time }}"
231 meraki_retry_4xx_error: "{{ meraki_retry_4xx_error }}"
232 meraki_retry_4xx_error_wait_time: "{{ meraki_retry_4xx_error_wait_time }}"
233 meraki_maximum_retries: "{{ meraki_maximum_retries }}"
234 meraki_output_log: "{{ meraki_output_log }}"
235 meraki_log_file_prefix: "{{ meraki_log_file_prefix }}"
236 meraki_log_path: "{{ meraki_log_path }}"
237 meraki_print_console: "{{ meraki_print_console }}"
238 meraki_suppress_logging: "{{ meraki_suppress_logging }}"
239 meraki_simulate: "{{ meraki_simulate }}"
240 meraki_be_geo_id: "{{ meraki_be_geo_id }}"
241 meraki_caller: "{{ meraki_caller }}"
242 meraki_use_iterator_for_get_pages: "{{ meraki_use_iterator_for_get_pages }}"
243 meraki_inherit_logging_config: "{{ meraki_inherit_logging_config }}"
244 state: absent
245 interfaceId: string
246 serial: string
247 """
248 RETURN = r"""
249 meraki_response:
250 description: A dictionary or list with the response returned by the Cisco Meraki Python SDK
251 returned: always
252 type: dict
253 sample: >
254 {
255 "interfaceId": "string",
256 "name": "string",
257 "mode": "string",
258 "subnet": "string",
259 "interfaceIp": "string",
260 "serial": "string",
261 "switchPortId": "string",
262 "multicastRouting": "string",
263 "vlanId": 0,
264 "uplinkV4": true,
265 "uplinkV6": true,
266 "ospfSettings": {
267 "area": "string",
268 "cost": 0,
269 "isPassiveEnabled": true,
270 "networkType": "string"
271 },
272 "ospfV3": {
273 "area": "string",
274 "cost": 0,
275 "isPassiveEnabled": true,
276 "networkType": "string"
277 },
278 "ipv6": {
279 "assignmentMode": "string",
280 "address": "string",
281 "prefix": "string",
282 "gateway": "string"
283 },
284 "vrf": {
285 "name": "string"
286 },
287 "loopback": {},
288 "defaultGateway": "string"
289 }
290 """