| 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: networks_switch_settings |
| 9 |
short_description: Resource module for networks _switch _settings |
| 10 |
description: |
| 11 |
- Manage operation update of the resource networks _switch _settings. |
| 12 |
- Update switch network settings. |
| 13 |
version_added: '1.0.0' |
| 14 |
extends_documentation_fragment: |
| 15 |
- cisco.meraki.module |
| 16 |
author: Francisco Munoz (@fmunoz) |
| 17 |
options: |
| 18 |
macBlocklist: |
| 19 |
description: MAC blocklist. |
| 20 |
suboptions: |
| 21 |
enabled: |
| 22 |
description: Enable MAC blocklist. |
| 23 |
type: bool |
| 24 |
type: dict |
| 25 |
networkId: |
| 26 |
description: NetworkId path parameter. Network ID. |
| 27 |
type: str |
| 28 |
powerExceptions: |
| 29 |
description: Exceptions on a per switch basis to "useCombinedPower". |
| 30 |
elements: dict |
| 31 |
suboptions: |
| 32 |
powerType: |
| 33 |
description: Per switch exception (combined, redundant, useNetworkSetting). |
| 34 |
type: str |
| 35 |
serial: |
| 36 |
description: Serial number of the switch. |
| 37 |
type: str |
| 38 |
type: list |
| 39 |
uplinkClientSampling: |
| 40 |
description: Uplink client sampling. |
| 41 |
suboptions: |
| 42 |
enabled: |
| 43 |
description: Enable uplink client sampling. |
| 44 |
type: bool |
| 45 |
type: dict |
| 46 |
uplinkSelection: |
| 47 |
description: Settings related to uplink selection on IOS-XE switches. |
| 48 |
suboptions: |
| 49 |
candidates: |
| 50 |
description: '''all'' lets devices try any potential interface. ''designated'' |
| 51 |
restricts to specified candidates (configured via the Routing & DHCP page).' |
| 52 |
type: str |
| 53 |
failback: |
| 54 |
description: If a preferred uplink ever goes offline, we will periodically |
| 55 |
reattempt it. |
| 56 |
suboptions: |
| 57 |
enabled: |
| 58 |
description: Enable preferred uplink failback. |
| 59 |
type: bool |
| 60 |
type: dict |
| 61 |
type: dict |
| 62 |
useCombinedPower: |
| 63 |
description: The use Combined Power as the default behavior of secondary power |
| 64 |
supplies on supported devices. |
| 65 |
type: bool |
| 66 |
vlan: |
| 67 |
description: Management VLAN. |
| 68 |
type: int |
| 69 |
requirements: |
| 70 |
- meraki >= 2.4.9 |
| 71 |
- python >= 3.5 |
| 72 |
seealso: |
| 73 |
- name: Cisco Meraki documentation for switch updateNetworkSwitchSettings |
| 74 |
description: Complete reference of the updateNetworkSwitchSettings API. |
| 75 |
link: https://developer.cisco.com/meraki/api-v1/#!update-network-switch-settings |
| 76 |
notes: |
| 77 |
- SDK Method used are |
| 78 |
switch.Switch.update_network_switch_settings, |
| 79 |
- Paths used are |
| 80 |
put /networks/{networkId}/switch/settings, |
| 81 |
""" |
| 82 |
|
| 83 |
EXAMPLES = r""" |
| 84 |
- name: Update all |
| 85 |
cisco.meraki.networks_switch_settings: |
| 86 |
meraki_api_key: "{{ meraki_api_key }}" |
| 87 |
meraki_base_url: "{{ meraki_base_url }}" |
| 88 |
meraki_single_request_timeout: "{{ meraki_single_request_timeout }}" |
| 89 |
meraki_certificate_path: "{{ meraki_certificate_path }}" |
| 90 |
meraki_requests_proxy: "{{ meraki_requests_proxy }}" |
| 91 |
meraki_wait_on_rate_limit: "{{ meraki_wait_on_rate_limit }}" |
| 92 |
meraki_nginx_429_retry_wait_time: "{{ meraki_nginx_429_retry_wait_time }}" |
| 93 |
meraki_action_batch_retry_wait_time: "{{ meraki_action_batch_retry_wait_time }}" |
| 94 |
meraki_retry_4xx_error: "{{ meraki_retry_4xx_error }}" |
| 95 |
meraki_retry_4xx_error_wait_time: "{{ meraki_retry_4xx_error_wait_time }}" |
| 96 |
meraki_maximum_retries: "{{ meraki_maximum_retries }}" |
| 97 |
meraki_output_log: "{{ meraki_output_log }}" |
| 98 |
meraki_log_file_prefix: "{{ meraki_log_file_prefix }}" |
| 99 |
meraki_log_path: "{{ meraki_log_path }}" |
| 100 |
meraki_print_console: "{{ meraki_print_console }}" |
| 101 |
meraki_suppress_logging: "{{ meraki_suppress_logging }}" |
| 102 |
meraki_simulate: "{{ meraki_simulate }}" |
| 103 |
meraki_be_geo_id: "{{ meraki_be_geo_id }}" |
| 104 |
meraki_caller: "{{ meraki_caller }}" |
| 105 |
meraki_use_iterator_for_get_pages: "{{ meraki_use_iterator_for_get_pages }}" |
| 106 |
meraki_inherit_logging_config: "{{ meraki_inherit_logging_config }}" |
| 107 |
state: present |
| 108 |
macBlocklist: |
| 109 |
enabled: true |
| 110 |
networkId: string |
| 111 |
powerExceptions: |
| 112 |
- powerType: string |
| 113 |
serial: string |
| 114 |
uplinkClientSampling: |
| 115 |
enabled: true |
| 116 |
uplinkSelection: |
| 117 |
candidates: string |
| 118 |
failback: |
| 119 |
enabled: true |
| 120 |
useCombinedPower: true |
| 121 |
vlan: 0 |
| 122 |
""" |
| 123 |
RETURN = r""" |
| 124 |
meraki_response: |
| 125 |
description: A dictionary or list with the response returned by the Cisco Meraki Python SDK |
| 126 |
returned: always |
| 127 |
type: dict |
| 128 |
sample: > |
| 129 |
{ |
| 130 |
"vlan": 0, |
| 131 |
"useCombinedPower": true, |
| 132 |
"powerExceptions": [ |
| 133 |
{ |
| 134 |
"serial": "string", |
| 135 |
"powerType": "string" |
| 136 |
} |
| 137 |
], |
| 138 |
"uplinkClientSampling": { |
| 139 |
"enabled": true |
| 140 |
}, |
| 141 |
"macBlocklist": { |
| 142 |
"enabled": true |
| 143 |
}, |
| 144 |
"uplinkSelection": { |
| 145 |
"failback": { |
| 146 |
"enabled": true |
| 147 |
}, |
| 148 |
"candidates": "string" |
| 149 |
} |
| 150 |
} |
| 151 |
""" |