| 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_cellular_sims |
| 9 |
short_description: Resource module for devices _cellular _sims |
| 10 |
description: |
| 11 |
- Manage operation update of the resource devices _cellular _sims. |
| 12 |
- Updates the SIM and APN configurations for a cellular device. |
| 13 |
version_added: '1.0.0' |
| 14 |
extends_documentation_fragment: |
| 15 |
- cisco.meraki.module |
| 16 |
author: Francisco Munoz (@fmunoz) |
| 17 |
options: |
| 18 |
serial: |
| 19 |
description: Serial path parameter. |
| 20 |
type: str |
| 21 |
simFailover: |
| 22 |
description: SIM Failover settings. |
| 23 |
suboptions: |
| 24 |
enabled: |
| 25 |
description: Failover to secondary SIM (optional). |
| 26 |
type: bool |
| 27 |
timeout: |
| 28 |
description: Failover timeout in seconds (optional). |
| 29 |
type: int |
| 30 |
type: dict |
| 31 |
simOrdering: |
| 32 |
description: Specifies the ordering of all SIMs for an MG primary, secondary, |
| 33 |
and not-in-use (when applicable). It's required for devices with 3 or more SIMs |
| 34 |
and can be used in place of 'isPrimary' for dual-SIM devices. To indicate eSIM, |
| 35 |
use 'sim3'. Sim failover will occur only between primary and secondary sim slots. |
| 36 |
elements: str |
| 37 |
type: list |
| 38 |
sims: |
| 39 |
description: List of SIMs. If a SIM was previously configured and not specified |
| 40 |
in this request, it will remain unchanged. |
| 41 |
elements: dict |
| 42 |
suboptions: |
| 43 |
apns: |
| 44 |
description: APN configurations. If empty, the default APN will be used. |
| 45 |
elements: dict |
| 46 |
suboptions: |
| 47 |
allowedIpTypes: |
| 48 |
description: IP versions to support (permitted values include 'ipv4', |
| 49 |
'ipv6'). |
| 50 |
elements: str |
| 51 |
type: list |
| 52 |
authentication: |
| 53 |
description: APN authentication configurations. |
| 54 |
suboptions: |
| 55 |
password: |
| 56 |
description: APN password, if type is set (if APN password is not |
| 57 |
supplied, the password is left unchanged). |
| 58 |
type: str |
| 59 |
type: |
| 60 |
description: APN auth type. |
| 61 |
type: str |
| 62 |
username: |
| 63 |
description: APN username, if type is set. |
| 64 |
type: str |
| 65 |
type: dict |
| 66 |
name: |
| 67 |
description: APN name. |
| 68 |
type: str |
| 69 |
type: list |
| 70 |
isPrimary: |
| 71 |
description: If true, this SIM is activated on platform bootup. It must be |
| 72 |
true on single-SIM devices and is a required field for dual-SIM MGs unless |
| 73 |
it is being configured using 'simOrdering'. |
| 74 |
type: bool |
| 75 |
simOrder: |
| 76 |
description: Priority of SIM slot being configured. Use a value between 1 |
| 77 |
and total number of SIMs available. The value must be unique for each SIM. |
| 78 |
type: int |
| 79 |
slot: |
| 80 |
description: SIM slot being configured. Must be 'sim1' on single-sim devices. |
| 81 |
Use 'sim3' for eSIM. |
| 82 |
type: str |
| 83 |
type: list |
| 84 |
requirements: |
| 85 |
- meraki >= 2.4.9 |
| 86 |
- python >= 3.5 |
| 87 |
seealso: |
| 88 |
- name: Cisco Meraki documentation for devices updateDeviceCellularSims |
| 89 |
description: Complete reference of the updateDeviceCellularSims API. |
| 90 |
link: https://developer.cisco.com/meraki/api-v1/#!update-device-cellular-sims |
| 91 |
notes: |
| 92 |
- SDK Method used are |
| 93 |
devices.Devices.update_device_cellular_sims, |
| 94 |
- Paths used are |
| 95 |
put /devices/{serial}/cellular/sims, |
| 96 |
""" |
| 97 |
|
| 98 |
EXAMPLES = r""" |
| 99 |
- name: Update all |
| 100 |
cisco.meraki.devices_cellular_sims: |
| 101 |
meraki_api_key: "{{ meraki_api_key }}" |
| 102 |
meraki_base_url: "{{ meraki_base_url }}" |
| 103 |
meraki_single_request_timeout: "{{ meraki_single_request_timeout }}" |
| 104 |
meraki_certificate_path: "{{ meraki_certificate_path }}" |
| 105 |
meraki_requests_proxy: "{{ meraki_requests_proxy }}" |
| 106 |
meraki_wait_on_rate_limit: "{{ meraki_wait_on_rate_limit }}" |
| 107 |
meraki_nginx_429_retry_wait_time: "{{ meraki_nginx_429_retry_wait_time }}" |
| 108 |
meraki_action_batch_retry_wait_time: "{{ meraki_action_batch_retry_wait_time }}" |
| 109 |
meraki_retry_4xx_error: "{{ meraki_retry_4xx_error }}" |
| 110 |
meraki_retry_4xx_error_wait_time: "{{ meraki_retry_4xx_error_wait_time }}" |
| 111 |
meraki_maximum_retries: "{{ meraki_maximum_retries }}" |
| 112 |
meraki_output_log: "{{ meraki_output_log }}" |
| 113 |
meraki_log_file_prefix: "{{ meraki_log_file_prefix }}" |
| 114 |
meraki_log_path: "{{ meraki_log_path }}" |
| 115 |
meraki_print_console: "{{ meraki_print_console }}" |
| 116 |
meraki_suppress_logging: "{{ meraki_suppress_logging }}" |
| 117 |
meraki_simulate: "{{ meraki_simulate }}" |
| 118 |
meraki_be_geo_id: "{{ meraki_be_geo_id }}" |
| 119 |
meraki_caller: "{{ meraki_caller }}" |
| 120 |
meraki_use_iterator_for_get_pages: "{{ meraki_use_iterator_for_get_pages }}" |
| 121 |
meraki_inherit_logging_config: "{{ meraki_inherit_logging_config }}" |
| 122 |
state: present |
| 123 |
serial: string |
| 124 |
simFailover: |
| 125 |
enabled: true |
| 126 |
timeout: 300 |
| 127 |
simOrdering: |
| 128 |
- sim1 |
| 129 |
- sim2 |
| 130 |
- sim3 |
| 131 |
sims: |
| 132 |
- apns: |
| 133 |
- allowedIpTypes: |
| 134 |
- ipv4 |
| 135 |
- ipv6 |
| 136 |
authentication: |
| 137 |
password: secret |
| 138 |
type: pap |
| 139 |
username: milesmeraki |
| 140 |
name: internet |
| 141 |
isPrimary: false |
| 142 |
simOrder: 3 |
| 143 |
slot: sim1 |
| 144 |
""" |
| 145 |
RETURN = r""" |
| 146 |
meraki_response: |
| 147 |
description: A dictionary or list with the response returned by the Cisco Meraki Python SDK |
| 148 |
returned: always |
| 149 |
type: dict |
| 150 |
sample: > |
| 151 |
{ |
| 152 |
"sims": [ |
| 153 |
{ |
| 154 |
"slot": "string", |
| 155 |
"iccid": "string", |
| 156 |
"imsi": "string", |
| 157 |
"msisdn": "string", |
| 158 |
"isPrimary": true, |
| 159 |
"status": "string", |
| 160 |
"apns": [ |
| 161 |
{ |
| 162 |
"name": "string", |
| 163 |
"allowedIpTypes": [ |
| 164 |
"string" |
| 165 |
], |
| 166 |
"authentication": { |
| 167 |
"type": "string", |
| 168 |
"username": "string", |
| 169 |
"password": "string" |
| 170 |
} |
| 171 |
} |
| 172 |
] |
| 173 |
} |
| 174 |
], |
| 175 |
"simOrdering": [ |
| 176 |
"string" |
| 177 |
], |
| 178 |
"simFailover": { |
| 179 |
"enabled": true, |
| 180 |
"timeout": 0 |
| 181 |
} |
| 182 |
} |
| 183 |
""" |