Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
TKIPisalegacycipher committed Aug 8, 2024
2 parents 82e2f88 + b55e2ab commit 9dea777
Show file tree
Hide file tree
Showing 19 changed files with 790 additions and 158 deletions.
2 changes: 1 addition & 1 deletion meraki/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
)
from meraki.rest_session import *

__version__ = '1.46.0'
__version__ = '1.48.0'


class DashboardAPI(object):
Expand Down
2 changes: 1 addition & 1 deletion meraki/aio/api/appliance.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def getDeviceAppliancePerformance(self, serial: str, **kwargs):
https://developer.cisco.com/meraki/api-v1/#!get-device-appliance-performance
- serial (string): Serial
- t0 (string): The beginning of the timespan for the data.
- t0 (string): The beginning of the timespan for the data. The maximum lookback period is 30 days from today.
- t1 (string): The end of the timespan for the data. t1 can be a maximum of 14 days after t0.
- timespan (number): The timespan for which the information will be fetched. If specifying timespan, do not specify parameters t0 and t1. The value must be in seconds and be greater than or equal to 30 minutes and be less than or equal to 14 days. The default is 30 minutes.
"""
Expand Down
3 changes: 2 additions & 1 deletion meraki/aio/api/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def updateDeviceCellularSims(self, serial: str, **kwargs):
- serial (string): Serial
- sims (array): List of SIMs. If a SIM was previously configured and not specified in this request, it will remain unchanged.
- simOrdering (array): Specifies the ordering of all SIMs for an MG: primary, secondary, and not-in-use (when applicable). It's required for devices with 3 or more SIMs and can be used in place of 'isPrimary' for dual-SIM devices. To indicate eSIM, use 'sim3'. Sim failover will occur only between primary and secondary sim slots.
- simFailover (object): SIM Failover settings.
"""

Expand All @@ -125,7 +126,7 @@ def updateDeviceCellularSims(self, serial: str, **kwargs):
serial = urllib.parse.quote(str(serial), safe='')
resource = f'/devices/{serial}/cellular/sims'

body_params = ['sims', 'simFailover', ]
body_params = ['sims', 'simOrdering', 'simFailover', ]
payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params}

return self._session.put(metadata, resource, payload)
Expand Down
15 changes: 9 additions & 6 deletions meraki/aio/api/networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,16 +642,17 @@ def getNetworkDevices(self, networkId: str):



def claimNetworkDevices(self, networkId: str, serials: list):
def claimNetworkDevices(self, networkId: str, serials: list, **kwargs):
"""
**Claim devices into a network. (Note: for recently claimed devices, it may take a few minutes for API requests against that device to succeed)**
https://developer.cisco.com/meraki/api-v1/#!claim-network-devices
- networkId (string): Network ID
- serials (array): A list of serials of devices to claim
- addAtomically (boolean): Whether to claim devices atomically. If true, all devices will be claimed or none will be claimed. Default is true.
"""

kwargs = locals()
kwargs.update(locals())

metadata = {
'tags': ['networks', 'configure', 'devices'],
Expand Down Expand Up @@ -730,7 +731,7 @@ def getNetworkEvents(self, networkId: str, total_pages=1, direction='prev', even
- total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages
- direction (string): direction to paginate, either "next" or "prev" (default) page
- event_log_end_time (string): ISO8601 Zulu/UTC time, to use in conjunction with startingAfter, to retrieve events within a time window
- productType (string): The product type to fetch events for. This parameter is required for networks with multiple device types. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, and secureConnect
- productType (string): The product type to fetch events for. This parameter is required for networks with multiple device types. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, wirelessController, and secureConnect
- includedEventTypes (array): A list of event types. The returned events will be filtered to only include events with these types.
- excludedEventTypes (array): A list of event types. The returned events will be filtered to exclude events with these types.
- deviceMac (string): The MAC address of the Meraki device which the list of events will be filtered with
Expand All @@ -741,6 +742,8 @@ def getNetworkEvents(self, networkId: str, total_pages=1, direction='prev', even
- clientName (string): The name, or partial name, of the client which the list of events will be filtered with
- smDeviceMac (string): The MAC address of the Systems Manager device which the list of events will be filtered with
- smDeviceName (string): The name of the Systems Manager device which the list of events will be filtered with
- eventDetails (string): The details of the event(Catalyst device only) which the list of events will be filtered with
- eventSeverity (string): The severity of the event(Catalyst device only) which the list of events will be filtered with
- perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 10.
- startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it.
- endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it.
Expand All @@ -749,7 +752,7 @@ def getNetworkEvents(self, networkId: str, total_pages=1, direction='prev', even
kwargs.update(locals())

if 'productType' in kwargs:
options = ['appliance', 'camera', 'cellularGateway', 'secureConnect', 'switch', 'systemsManager', 'wireless']
options = ['appliance', 'camera', 'cellularGateway', 'secureConnect', 'switch', 'systemsManager', 'wireless', 'wirelessController']
assert kwargs['productType'] in options, f'''"productType" cannot be "{kwargs['productType']}", & must be set to one of: {options}'''

metadata = {
Expand All @@ -759,7 +762,7 @@ def getNetworkEvents(self, networkId: str, total_pages=1, direction='prev', even
networkId = urllib.parse.quote(str(networkId), safe='')
resource = f'/networks/{networkId}/events'

query_params = ['productType', 'includedEventTypes', 'excludedEventTypes', 'deviceMac', 'deviceSerial', 'deviceName', 'clientIp', 'clientMac', 'clientName', 'smDeviceMac', 'smDeviceName', 'perPage', 'startingAfter', 'endingBefore', ]
query_params = ['productType', 'includedEventTypes', 'excludedEventTypes', 'deviceMac', 'deviceSerial', 'deviceName', 'clientIp', 'clientMac', 'clientName', 'smDeviceMac', 'smDeviceName', 'eventDetails', 'eventSeverity', 'perPage', 'startingAfter', 'endingBefore', ]
params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params}

array_params = ['includedEventTypes', 'excludedEventTypes', ]
Expand Down Expand Up @@ -852,7 +855,7 @@ def createNetworkFirmwareUpgradesRollback(self, networkId: str, reasons: list, *
kwargs.update(locals())

if 'product' in kwargs:
options = ['appliance', 'camera', 'cellularGateway', 'secureConnect', 'switch', 'switchCatalyst', 'wireless']
options = ['appliance', 'camera', 'cellularGateway', 'secureConnect', 'switch', 'switchCatalyst', 'wireless', 'wirelessController']
assert kwargs['product'] in options, f'''"product" cannot be "{kwargs['product']}", & must be set to one of: {options}'''

metadata = {
Expand Down
Loading

0 comments on commit 9dea777

Please sign in to comment.