Debian Codegraph @

ansible_collections/cisco/meraki/plugins/modules/networks_appliance_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 ---
9 module: networks_appliance_static_routes
10 short_description: Resource module for networks _appliance _static _routes
11 description:
12 - Manage operations create, update and delete of the resource networks _appliance _static _routes.
13 - Add a static route for an MX or teleworker network.
14 - Delete a static route from an MX or teleworker network.
15 - Update a static route for an MX or teleworker network.
16 version_added: '1.0.0'
17 extends_documentation_fragment:
18 - cisco.meraki.module
19 author: Francisco Munoz (@fmunoz)
20 options:
21 enabled:
22 description: Whether the route should be enabled or not.
23 type: bool
24 fixedIpAssignments:
25 description: Fixed DHCP IP assignments on the route.
26 type: dict
27 gatewayIp:
28 description: Gateway IP address (next hop).
29 type: str
30 gatewayVlanId:
31 description: Gateway VLAN ID.
32 type: str
33 name:
34 description: Name of the route.
35 type: str
36 networkId:
37 description: NetworkId path parameter. Network ID.
38 type: str
39 reservedIpRanges:
40 description: DHCP reserved IP ranges.
41 elements: dict
42 suboptions:
43 comment:
44 description: Description of the range.
45 type: str
46 end:
47 description: Last address in the reserved range.
48 type: str
49 start:
50 description: First address in the reserved range.
51 type: str
52 type: list
53 staticRouteId:
54 description: StaticRouteId path parameter. Static route ID.
55 type: str
56 subnet:
57 description: Subnet of the route.
58 type: str
59 requirements:
60 - meraki >= 2.4.9
61 - python >= 3.5
62 seealso:
63 - name: Cisco Meraki documentation for appliance createNetworkApplianceStaticRoute
64 description: Complete reference of the createNetworkApplianceStaticRoute API.
65 link: https://developer.cisco.com/meraki/api-v1/#!create-network-appliance-static-route
66 - name: Cisco Meraki documentation for appliance deleteNetworkApplianceStaticRoute
67 description: Complete reference of the deleteNetworkApplianceStaticRoute API.
68 link: https://developer.cisco.com/meraki/api-v1/#!delete-network-appliance-static-route
69 - name: Cisco Meraki documentation for appliance updateNetworkApplianceStaticRoute
70 description: Complete reference of the updateNetworkApplianceStaticRoute API.
71 link: https://developer.cisco.com/meraki/api-v1/#!update-network-appliance-static-route
72 notes:
73 - SDK Method used are
74 appliance.Appliance.create_network_appliance_static_route,
75 appliance.Appliance.delete_network_appliance_static_route,
76 appliance.Appliance.update_network_appliance_static_route,
77
78 - Paths used are
79 post /networks/{networkId}/appliance/staticRoutes,
80 delete /networks/{networkId}/appliance/staticRoutes/{staticRouteId},
81 put /networks/{networkId}/appliance/staticRoutes/{staticRouteId},
82 """
83
84 EXAMPLES = r"""
85 - name: Create
86 cisco.meraki.networks_appliance_static_routes:
87 meraki_api_key: "{{ meraki_api_key }}"
88 meraki_base_url: "{{ meraki_base_url }}"
89 meraki_single_request_timeout: "{{ meraki_single_request_timeout }}"
90 meraki_certificate_path: "{{ meraki_certificate_path }}"
91 meraki_requests_proxy: "{{ meraki_requests_proxy }}"
92 meraki_wait_on_rate_limit: "{{ meraki_wait_on_rate_limit }}"
93 meraki_nginx_429_retry_wait_time: "{{ meraki_nginx_429_retry_wait_time }}"
94 meraki_action_batch_retry_wait_time: "{{ meraki_action_batch_retry_wait_time }}"
95 meraki_retry_4xx_error: "{{ meraki_retry_4xx_error }}"
96 meraki_retry_4xx_error_wait_time: "{{ meraki_retry_4xx_error_wait_time }}"
97 meraki_maximum_retries: "{{ meraki_maximum_retries }}"
98 meraki_output_log: "{{ meraki_output_log }}"
99 meraki_log_file_prefix: "{{ meraki_log_file_prefix }}"
100 meraki_log_path: "{{ meraki_log_path }}"
101 meraki_print_console: "{{ meraki_print_console }}"
102 meraki_suppress_logging: "{{ meraki_suppress_logging }}"
103 meraki_simulate: "{{ meraki_simulate }}"
104 meraki_be_geo_id: "{{ meraki_be_geo_id }}"
105 meraki_caller: "{{ meraki_caller }}"
106 meraki_use_iterator_for_get_pages: "{{ meraki_use_iterator_for_get_pages }}"
107 meraki_inherit_logging_config: "{{ meraki_inherit_logging_config }}"
108 state: present
109 AQUI ['gatewayIp: 1.2.3.5', "gatewayVlanId: '100'", 'name: My route', 'networkId: string', 'subnet: 192.168.1.0/24']
110 gatewayIp: 1.2.3.5
111 gatewayVlanId: '100'
112 name: My route
113 networkId: string
114 subnet: 192.168.1.0/24
115
116 - name: Update by id
117 cisco.meraki.networks_appliance_static_routes:
118 meraki_api_key: "{{ meraki_api_key }}"
119 meraki_base_url: "{{ meraki_base_url }}"
120 meraki_single_request_timeout: "{{ meraki_single_request_timeout }}"
121 meraki_certificate_path: "{{ meraki_certificate_path }}"
122 meraki_requests_proxy: "{{ meraki_requests_proxy }}"
123 meraki_wait_on_rate_limit: "{{ meraki_wait_on_rate_limit }}"
124 meraki_nginx_429_retry_wait_time: "{{ meraki_nginx_429_retry_wait_time }}"
125 meraki_action_batch_retry_wait_time: "{{ meraki_action_batch_retry_wait_time }}"
126 meraki_retry_4xx_error: "{{ meraki_retry_4xx_error }}"
127 meraki_retry_4xx_error_wait_time: "{{ meraki_retry_4xx_error_wait_time }}"
128 meraki_maximum_retries: "{{ meraki_maximum_retries }}"
129 meraki_output_log: "{{ meraki_output_log }}"
130 meraki_log_file_prefix: "{{ meraki_log_file_prefix }}"
131 meraki_log_path: "{{ meraki_log_path }}"
132 meraki_print_console: "{{ meraki_print_console }}"
133 meraki_suppress_logging: "{{ meraki_suppress_logging }}"
134 meraki_simulate: "{{ meraki_simulate }}"
135 meraki_be_geo_id: "{{ meraki_be_geo_id }}"
136 meraki_caller: "{{ meraki_caller }}"
137 meraki_use_iterator_for_get_pages: "{{ meraki_use_iterator_for_get_pages }}"
138 meraki_inherit_logging_config: "{{ meraki_inherit_logging_config }}"
139 state: present
140 AQUI ['enabled: true', 'fixedIpAssignments:', ' 22:33:44:55:66:77:', ' ip: 1.2.3.4', ' name: Some client name', 'gatewayIp: 1.2.3.5', "gatewayVlanId: '100'", 'name: My route', 'networkId: string', 'reservedIpRanges:', '- comment: A reserved IP range', ' end: 192.168.1.1', ' start: 192.168.1.0', 'staticRouteId: string', 'subnet: 192.168.1.0/24']
141 enabled: true
142 fixedIpAssignments:
143 22:33:44:55:66:77:
144 ip: 1.2.3.4
145 name: Some client name
146 gatewayIp: 1.2.3.5
147 gatewayVlanId: '100'
148 name: My route
149 networkId: string
150 reservedIpRanges:
151 - comment: A reserved IP range
152 end: 192.168.1.1
153 start: 192.168.1.0
154 staticRouteId: string
155 subnet: 192.168.1.0/24
156
157 - name: Delete by id
158 cisco.meraki.networks_appliance_static_routes:
159 meraki_api_key: "{{ meraki_api_key }}"
160 meraki_base_url: "{{ meraki_base_url }}"
161 meraki_single_request_timeout: "{{ meraki_single_request_timeout }}"
162 meraki_certificate_path: "{{ meraki_certificate_path }}"
163 meraki_requests_proxy: "{{ meraki_requests_proxy }}"
164 meraki_wait_on_rate_limit: "{{ meraki_wait_on_rate_limit }}"
165 meraki_nginx_429_retry_wait_time: "{{ meraki_nginx_429_retry_wait_time }}"
166 meraki_action_batch_retry_wait_time: "{{ meraki_action_batch_retry_wait_time }}"
167 meraki_retry_4xx_error: "{{ meraki_retry_4xx_error }}"
168 meraki_retry_4xx_error_wait_time: "{{ meraki_retry_4xx_error_wait_time }}"
169 meraki_maximum_retries: "{{ meraki_maximum_retries }}"
170 meraki_output_log: "{{ meraki_output_log }}"
171 meraki_log_file_prefix: "{{ meraki_log_file_prefix }}"
172 meraki_log_path: "{{ meraki_log_path }}"
173 meraki_print_console: "{{ meraki_print_console }}"
174 meraki_suppress_logging: "{{ meraki_suppress_logging }}"
175 meraki_simulate: "{{ meraki_simulate }}"
176 meraki_be_geo_id: "{{ meraki_be_geo_id }}"
177 meraki_caller: "{{ meraki_caller }}"
178 meraki_use_iterator_for_get_pages: "{{ meraki_use_iterator_for_get_pages }}"
179 meraki_inherit_logging_config: "{{ meraki_inherit_logging_config }}"
180 state: absent
181 AQUI ['networkId: string', 'staticRouteId: string']
182 networkId: string
183 staticRouteId: string
184
185 """
186 RETURN = r"""
187 meraki_response:
188 description: A dictionary or list with the response returned by the Cisco Meraki Python SDK
189 returned: always
190 type: dict
191 sample: >
192 {
193 "id": "string",
194 "ipVersion": 0,
195 "networkId": "string",
196 "enabled": true,
197 "name": "string",
198 "subnet": "string",
199 "gatewayIp": "string",
200 "fixedIpAssignments": {},
201 "reservedIpRanges": [
202 {
203 "start": "string",
204 "end": "string",
205 "comment": "string"
206 }
207 ],
208 "gatewayVlanId": 0
209 }
210 """