Debian Codegraph @

ansible_collections/cisco/meraki/plugins/modules/devices_switch_routing_static_routes.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_static_routes
9 short_description: Resource module for devices _switch _routing _staticroutes
10 description:
11 - Manage operations create, update and delete of the resource devices _switch _routing
12 _staticroutes.
13 - Create a layer 3 static route for a switch.
14 - Delete a layer 3 static route for a switch.
15 - Update a layer 3 static route 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 advertiseViaOspfEnabled:
22 description: Option to advertise static route via OSPF.
23 type: bool
24 managementNextHop:
25 description: Optional fallback IP address for management traffic.
26 type: str
27 name:
28 description: Name or description for layer 3 static route.
29 type: str
30 nextHopIp:
31 description: IP address of the next hop device to which the device sends its traffic
32 for the subnet.
33 type: str
34 preferOverOspfRoutesEnabled:
35 description: Option to prefer static route over OSPF routes.
36 type: bool
37 serial:
38 description: Serial path parameter.
39 type: str
40 staticRouteId:
41 description: StaticRouteId path parameter. Static route ID.
42 type: str
43 subnet:
44 description: The subnet which is routed via this static route and should be specified
45 in CIDR notation (ex. 1.2.3.0/24).
46 type: str
47 vrf:
48 description: The VRF settings of the interface. Requires IOS XE 17.18 or higher.
49 suboptions:
50 leakRouteToDefaultVrf:
51 description: Whether or not next-hop IP is reachable via default VRF.
52 type: bool
53 name:
54 description: The name of the VRF this static route belongs to.
55 type: str
56 type: dict
57 requirements:
58 - meraki >= 2.4.9
59 - python >= 3.5
60 seealso:
61 - name: Cisco Meraki documentation for switch createDeviceSwitchRoutingStaticRoute
62 description: Complete reference of the createDeviceSwitchRoutingStaticRoute API.
63 link: https://developer.cisco.com/meraki/api-v1/#!create-device-switch-routing-static-route
64 - name: Cisco Meraki documentation for switch deleteDeviceSwitchRoutingStaticRoute
65 description: Complete reference of the deleteDeviceSwitchRoutingStaticRoute API.
66 link: https://developer.cisco.com/meraki/api-v1/#!delete-device-switch-routing-static-route
67 - name: Cisco Meraki documentation for switch updateDeviceSwitchRoutingStaticRoute
68 description: Complete reference of the updateDeviceSwitchRoutingStaticRoute API.
69 link: https://developer.cisco.com/meraki/api-v1/#!update-device-switch-routing-static-route
70 notes:
71 - SDK Method used are
72 switch.Switch.create_device_switch_routing_static_route,
73 switch.Switch.delete_device_switch_routing_static_route,
74 switch.Switch.update_device_switch_routing_static_route,
75 - Paths used are
76 post /devices/{serial}/switch/routing/staticRoutes,
77 delete /devices/{serial}/switch/routing/staticRoutes/{staticRouteId},
78 put /devices/{serial}/switch/routing/staticRoutes/{staticRouteId},
79 """
80
81 EXAMPLES = r"""
82 - name: Create
83 cisco.meraki.devices_switch_routing_static_routes:
84 meraki_api_key: "{{ meraki_api_key }}"
85 meraki_base_url: "{{ meraki_base_url }}"
86 meraki_single_request_timeout: "{{ meraki_single_request_timeout }}"
87 meraki_certificate_path: "{{ meraki_certificate_path }}"
88 meraki_requests_proxy: "{{ meraki_requests_proxy }}"
89 meraki_wait_on_rate_limit: "{{ meraki_wait_on_rate_limit }}"
90 meraki_nginx_429_retry_wait_time: "{{ meraki_nginx_429_retry_wait_time }}"
91 meraki_action_batch_retry_wait_time: "{{ meraki_action_batch_retry_wait_time }}"
92 meraki_retry_4xx_error: "{{ meraki_retry_4xx_error }}"
93 meraki_retry_4xx_error_wait_time: "{{ meraki_retry_4xx_error_wait_time }}"
94 meraki_maximum_retries: "{{ meraki_maximum_retries }}"
95 meraki_output_log: "{{ meraki_output_log }}"
96 meraki_log_file_prefix: "{{ meraki_log_file_prefix }}"
97 meraki_log_path: "{{ meraki_log_path }}"
98 meraki_print_console: "{{ meraki_print_console }}"
99 meraki_suppress_logging: "{{ meraki_suppress_logging }}"
100 meraki_simulate: "{{ meraki_simulate }}"
101 meraki_be_geo_id: "{{ meraki_be_geo_id }}"
102 meraki_caller: "{{ meraki_caller }}"
103 meraki_use_iterator_for_get_pages: "{{ meraki_use_iterator_for_get_pages }}"
104 meraki_inherit_logging_config: "{{ meraki_inherit_logging_config }}"
105 state: present
106 advertiseViaOspfEnabled: false
107 name: My route
108 nextHopIp: 1.2.3.4
109 preferOverOspfRoutesEnabled: false
110 serial: string
111 subnet: 192.168.1.0/24
112 vrf:
113 leakRouteToDefaultVrf: false
114 name: Blue
115 - name: Update by id
116 cisco.meraki.devices_switch_routing_static_routes:
117 meraki_api_key: "{{ meraki_api_key }}"
118 meraki_base_url: "{{ meraki_base_url }}"
119 meraki_single_request_timeout: "{{ meraki_single_request_timeout }}"
120 meraki_certificate_path: "{{ meraki_certificate_path }}"
121 meraki_requests_proxy: "{{ meraki_requests_proxy }}"
122 meraki_wait_on_rate_limit: "{{ meraki_wait_on_rate_limit }}"
123 meraki_nginx_429_retry_wait_time: "{{ meraki_nginx_429_retry_wait_time }}"
124 meraki_action_batch_retry_wait_time: "{{ meraki_action_batch_retry_wait_time }}"
125 meraki_retry_4xx_error: "{{ meraki_retry_4xx_error }}"
126 meraki_retry_4xx_error_wait_time: "{{ meraki_retry_4xx_error_wait_time }}"
127 meraki_maximum_retries: "{{ meraki_maximum_retries }}"
128 meraki_output_log: "{{ meraki_output_log }}"
129 meraki_log_file_prefix: "{{ meraki_log_file_prefix }}"
130 meraki_log_path: "{{ meraki_log_path }}"
131 meraki_print_console: "{{ meraki_print_console }}"
132 meraki_suppress_logging: "{{ meraki_suppress_logging }}"
133 meraki_simulate: "{{ meraki_simulate }}"
134 meraki_be_geo_id: "{{ meraki_be_geo_id }}"
135 meraki_caller: "{{ meraki_caller }}"
136 meraki_use_iterator_for_get_pages: "{{ meraki_use_iterator_for_get_pages }}"
137 meraki_inherit_logging_config: "{{ meraki_inherit_logging_config }}"
138 state: present
139 advertiseViaOspfEnabled: false
140 managementNextHop: 1.2.3.5
141 name: My route
142 nextHopIp: 1.2.3.4
143 preferOverOspfRoutesEnabled: false
144 serial: string
145 staticRouteId: string
146 subnet: 192.168.1.0/24
147 vrf:
148 leakRouteToDefaultVrf: false
149 name: Blue
150 - name: Delete by id
151 cisco.meraki.devices_switch_routing_static_routes:
152 meraki_api_key: "{{ meraki_api_key }}"
153 meraki_base_url: "{{ meraki_base_url }}"
154 meraki_single_request_timeout: "{{ meraki_single_request_timeout }}"
155 meraki_certificate_path: "{{ meraki_certificate_path }}"
156 meraki_requests_proxy: "{{ meraki_requests_proxy }}"
157 meraki_wait_on_rate_limit: "{{ meraki_wait_on_rate_limit }}"
158 meraki_nginx_429_retry_wait_time: "{{ meraki_nginx_429_retry_wait_time }}"
159 meraki_action_batch_retry_wait_time: "{{ meraki_action_batch_retry_wait_time }}"
160 meraki_retry_4xx_error: "{{ meraki_retry_4xx_error }}"
161 meraki_retry_4xx_error_wait_time: "{{ meraki_retry_4xx_error_wait_time }}"
162 meraki_maximum_retries: "{{ meraki_maximum_retries }}"
163 meraki_output_log: "{{ meraki_output_log }}"
164 meraki_log_file_prefix: "{{ meraki_log_file_prefix }}"
165 meraki_log_path: "{{ meraki_log_path }}"
166 meraki_print_console: "{{ meraki_print_console }}"
167 meraki_suppress_logging: "{{ meraki_suppress_logging }}"
168 meraki_simulate: "{{ meraki_simulate }}"
169 meraki_be_geo_id: "{{ meraki_be_geo_id }}"
170 meraki_caller: "{{ meraki_caller }}"
171 meraki_use_iterator_for_get_pages: "{{ meraki_use_iterator_for_get_pages }}"
172 meraki_inherit_logging_config: "{{ meraki_inherit_logging_config }}"
173 state: absent
174 serial: string
175 staticRouteId: string
176 """
177 RETURN = r"""
178 meraki_response:
179 description: A dictionary or list with the response returned by the Cisco Meraki Python SDK
180 returned: always
181 type: dict
182 sample: >
183 {
184 "staticRouteId": "string",
185 "name": "string",
186 "subnet": "string",
187 "nextHopIp": "string",
188 "managementNextHop": {},
189 "vrf": {
190 "name": "string",
191 "leakRouteToDefaultVrf": true
192 },
193 "advertiseViaOspfEnabled": true,
194 "preferOverOspfRoutesEnabled": true
195 }
196 """