diff --git a/meraki/__init__.py b/meraki/__init__.py index 8c6ea072..9bedbcfe 100644 --- a/meraki/__init__.py +++ b/meraki/__init__.py @@ -43,7 +43,7 @@ ) from meraki.rest_session import * -__version__ = '1.46.0' +__version__ = '1.48.0' class DashboardAPI(object): diff --git a/meraki/aio/api/appliance.py b/meraki/aio/api/appliance.py index 2f7b6ddb..988131fd 100644 --- a/meraki/aio/api/appliance.py +++ b/meraki/aio/api/appliance.py @@ -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. """ diff --git a/meraki/aio/api/devices.py b/meraki/aio/api/devices.py index 2c0a458c..ae6e4a5b 100644 --- a/meraki/aio/api/devices.py +++ b/meraki/aio/api/devices.py @@ -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. """ @@ -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) diff --git a/meraki/aio/api/networks.py b/meraki/aio/api/networks.py index 96e66345..58f81dbe 100644 --- a/meraki/aio/api/networks.py +++ b/meraki/aio/api/networks.py @@ -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'], @@ -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 @@ -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. @@ -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 = { @@ -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', ] @@ -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 = { diff --git a/meraki/aio/api/organizations.py b/meraki/aio/api/organizations.py index dc998c4b..abc21229 100644 --- a/meraki/aio/api/organizations.py +++ b/meraki/aio/api/organizations.py @@ -1071,7 +1071,7 @@ def getOrganizationAssuranceAlerts(self, organizationId: str, total_pages=1, dir assert kwargs['sortBy'] in options, f'''"sortBy" cannot be "{kwargs['sortBy']}", & must be set to one of: {options}''' metadata = { - 'tags': ['organizations', 'configure', 'alerts'], + 'tags': ['organizations', 'monitor', 'alerts'], 'operation': 'getOrganizationAssuranceAlerts' } organizationId = urllib.parse.quote(str(organizationId), safe='') @@ -1096,13 +1096,13 @@ def dismissOrganizationAssuranceAlerts(self, organizationId: str, alertIds: list https://developer.cisco.com/meraki/api-v1/#!dismiss-organization-assurance-alerts - organizationId (string): Organization ID - - alertIds (array): Parameter to dismiss alerts by ID + - alertIds (array): Array of alert IDs to dismiss """ kwargs = locals() metadata = { - 'tags': ['organizations', 'configure', 'alerts'], + 'tags': ['organizations', 'monitor', 'alerts'], 'operation': 'dismissOrganizationAssuranceAlerts' } organizationId = urllib.parse.quote(str(organizationId), safe='') @@ -1138,7 +1138,7 @@ def getOrganizationAssuranceAlertsOverview(self, organizationId: str, **kwargs): kwargs.update(locals()) metadata = { - 'tags': ['organizations', 'configure', 'alerts', 'overview'], + 'tags': ['organizations', 'monitor', 'alerts', 'overview'], 'operation': 'getOrganizationAssuranceAlertsOverview' } organizationId = urllib.parse.quote(str(organizationId), safe='') @@ -1190,7 +1190,7 @@ def getOrganizationAssuranceAlertsOverviewByNetwork(self, organizationId: str, t assert kwargs['sortOrder'] in options, f'''"sortOrder" cannot be "{kwargs['sortOrder']}", & must be set to one of: {options}''' metadata = { - 'tags': ['organizations', 'configure', 'alerts', 'overview', 'byNetwork'], + 'tags': ['organizations', 'monitor', 'alerts', 'overview', 'byNetwork'], 'operation': 'getOrganizationAssuranceAlertsOverviewByNetwork' } organizationId = urllib.parse.quote(str(organizationId), safe='') @@ -1246,7 +1246,7 @@ def getOrganizationAssuranceAlertsOverviewByType(self, organizationId: str, tota assert kwargs['sortBy'] in options, f'''"sortBy" cannot be "{kwargs['sortBy']}", & must be set to one of: {options}''' metadata = { - 'tags': ['organizations', 'configure', 'alerts', 'overview', 'byType'], + 'tags': ['organizations', 'monitor', 'alerts', 'overview', 'byType'], 'operation': 'getOrganizationAssuranceAlertsOverviewByType' } organizationId = urllib.parse.quote(str(organizationId), safe='') @@ -1284,7 +1284,7 @@ def getOrganizationAssuranceAlertsOverviewHistorical(self, organizationId: str, kwargs.update(locals()) metadata = { - 'tags': ['organizations', 'configure', 'alerts', 'overview', 'historical'], + 'tags': ['organizations', 'monitor', 'alerts', 'overview', 'historical'], 'operation': 'getOrganizationAssuranceAlertsOverviewHistorical' } organizationId = urllib.parse.quote(str(organizationId), safe='') @@ -1309,13 +1309,13 @@ def restoreOrganizationAssuranceAlerts(self, organizationId: str, alertIds: list https://developer.cisco.com/meraki/api-v1/#!restore-organization-assurance-alerts - organizationId (string): Organization ID - - alertIds (array): Parameter to restore alerts by ID + - alertIds (array): Array of alert IDs to restore """ kwargs = locals() metadata = { - 'tags': ['organizations', 'configure', 'alerts'], + 'tags': ['organizations', 'monitor', 'alerts'], 'operation': 'restoreOrganizationAssuranceAlerts' } organizationId = urllib.parse.quote(str(organizationId), safe='') @@ -1338,7 +1338,7 @@ def getOrganizationAssuranceAlert(self, organizationId: str, id: str): """ metadata = { - 'tags': ['organizations', 'configure', 'alerts'], + 'tags': ['organizations', 'monitor', 'alerts'], 'operation': 'getOrganizationAssuranceAlert' } organizationId = urllib.parse.quote(str(organizationId), safe='') @@ -1556,9 +1556,14 @@ def getOrganizationClientsBandwidthUsageHistory(self, organizationId: str, **kwa https://developer.cisco.com/meraki/api-v1/#!get-organization-clients-bandwidth-usage-history - organizationId (string): Organization ID + - networkTag (string): Match result to an exact network tag + - deviceTag (string): Match result to an exact device tag + - networkId (string): Match result to an exact network id + - ssidName (string): Filter results by ssid name + - usageUplink (string): Filter results by usage uplink - t0 (string): The beginning of the timespan for the data. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 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 less than or equal to 31 days. The default is 1 day. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 186 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 less than or equal to 186 days. The default is 1 day. """ kwargs.update(locals()) @@ -1570,7 +1575,7 @@ def getOrganizationClientsBandwidthUsageHistory(self, organizationId: str, **kwa organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/clients/bandwidthUsageHistory' - query_params = ['t0', 't1', 'timespan', ] + query_params = ['networkTag', 'deviceTag', 'networkId', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} return self._session.get(metadata, resource, params) @@ -1822,7 +1827,7 @@ def getOrganizationDevices(self, organizationId: str, total_pages=1, direction=' - 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. - configurationUpdatedAfter (string): Filter results by whether or not the device's configuration has been updated after the given timestamp - networkIds (array): Optional parameter to filter devices by network. - - productTypes (array): Optional parameter to filter devices by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, and secureConnect. + - productTypes (array): Optional parameter to filter devices by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, wirelessController, and secureConnect. - tags (array): Optional parameter to filter devices by tags. - tagsFilterType (string): Optional parameter of value 'withAnyTags' or 'withAllTags' to indicate whether to return networks which contain ANY or ALL of the included tags. If no type is included, 'withAnyTags' will be selected. - name (string): Optional parameter to filter devices by name. All returned devices will have a name that contains the search term or is an exact match. @@ -1874,7 +1879,7 @@ def getOrganizationDevicesAvailabilities(self, organizationId: str, total_pages= - 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. - networkIds (array): Optional parameter to filter device availabilities by network ID. This filter uses multiple exact matches. - - productTypes (array): Optional parameter to filter device availabilities by device product types. This filter uses multiple exact matches. + - productTypes (array): Optional parameter to filter device availabilities by device product types. This filter uses multiple exact matches. Valid types are wireless, appliance, switch, camera, cellularGateway, sensor, and wirelessController - serials (array): Optional parameter to filter device availabilities by device serial numbers. This filter uses multiple exact matches. - tags (array): An optional parameter to filter devices by tags. The filtering is case-sensitive. If tags are included, 'tagsFilterType' should also be included (see below). This filter uses multiple exact matches. - tagsFilterType (string): An optional parameter of value 'withAnyTags' or 'withAllTags' to indicate whether to return devices which contain ANY or ALL of the included tags. If no type is included, 'withAnyTags' will be selected. @@ -1948,6 +1953,32 @@ def getOrganizationDevicesAvailabilitiesChangeHistory(self, organizationId: str, + def bulkUpdateOrganizationDevicesDetails(self, organizationId: str, serials: list, details: list): + """ + **Updating device details (currently only used for Catalyst devices)** + https://developer.cisco.com/meraki/api-v1/#!bulk-update-organization-devices-details + + - organizationId (string): Organization ID + - serials (array): A list of serials of devices to update + - details (array): An array of details + """ + + kwargs = locals() + + metadata = { + 'tags': ['organizations', 'configure', 'devices', 'details', 'bulkUpdate'], + 'operation': 'bulkUpdateOrganizationDevicesDetails' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/devices/details/bulkUpdate' + + body_params = ['serials', 'details', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.post(metadata, resource, payload) + + + def getOrganizationDevicesOverviewByModel(self, organizationId: str, **kwargs): """ **Lists the count for each device model** @@ -2087,7 +2118,7 @@ def getOrganizationDevicesStatuses(self, organizationId: str, total_pages=1, dir - networkIds (array): Optional parameter to filter devices by network ids. - serials (array): Optional parameter to filter devices by serials. - statuses (array): Optional parameter to filter devices by statuses. Valid statuses are ["online", "alerting", "offline", "dormant"]. - - productTypes (array): An optional parameter to filter device statuses by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, and secureConnect. + - productTypes (array): An optional parameter to filter device statuses by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, wirelessController, and secureConnect. - models (array): Optional parameter to filter devices by models. - tags (array): An optional parameter to filter devices by tags. The filtering is case-sensitive. If tags are included, 'tagsFilterType' should also be included (see below). - tagsFilterType (string): An optional parameter of value 'withAnyTags' or 'withAllTags' to indicate whether to return devices which contain ANY or ALL of the included tags. If no type is included, 'withAnyTags' will be selected. @@ -2125,7 +2156,7 @@ def getOrganizationDevicesStatusesOverview(self, organizationId: str, **kwargs): https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-statuses-overview - organizationId (string): Organization ID - - productTypes (array): An optional parameter to filter device statuses by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, and secureConnect. + - productTypes (array): An optional parameter to filter device statuses by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, wirelessController, and secureConnect. - networkIds (array): An optional parameter to filter device statuses by network. """ @@ -2414,6 +2445,7 @@ def getOrganizationFirmwareUpgradesByDevice(self, organizationId: str, total_pag - macs (array): Optional parameter to filter by one or more MAC addresses belonging to devices. All devices returned belong to MAC addresses that are an exact match. - firmwareUpgradeBatchIds (array): Optional parameter to filter by firmware upgrade batch ids. - upgradeStatuses (array): Optional parameter to filter by firmware upgrade statuses. + - currentUpgradesOnly (boolean): Optional parameter to filter to only current or pending upgrade statuses """ kwargs.update(locals()) @@ -2425,7 +2457,7 @@ def getOrganizationFirmwareUpgradesByDevice(self, organizationId: str, total_pag organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/firmware/upgrades/byDevice' - query_params = ['perPage', 'startingAfter', 'endingBefore', 'networkIds', 'serials', 'macs', 'firmwareUpgradeBatchIds', 'upgradeStatuses', ] + query_params = ['perPage', 'startingAfter', 'endingBefore', 'networkIds', 'serials', 'macs', 'firmwareUpgradeBatchIds', 'upgradeStatuses', 'currentUpgradesOnly', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = ['networkIds', 'serials', 'macs', 'firmwareUpgradeBatchIds', 'upgradeStatuses', ] @@ -2485,7 +2517,7 @@ def getOrganizationInventoryDevices(self, organizationId: str, total_pages=1, di - orderNumbers (array): Search for devices in inventory based on order numbers. - tags (array): Filter devices by tags. The filtering is case-sensitive. If tags are included, 'tagsFilterType' should also be included (see below). - tagsFilterType (string): To use with 'tags' parameter, to filter devices which contain ANY or ALL given tags. Accepted values are 'withAnyTags' or 'withAllTags', default is 'withAnyTags'. - - productTypes (array): Filter devices by product type. Accepted values are appliance, camera, cellularGateway, secureConnect, sensor, switch, systemsManager, and wireless. + - productTypes (array): Filter devices by product type. Accepted values are appliance, camera, cellularGateway, secureConnect, sensor, switch, systemsManager, wireless, and wirelessController. """ kwargs.update(locals()) @@ -3030,6 +3062,7 @@ def getOrganizationNetworks(self, organizationId: str, total_pages=1, direction= - isBoundToConfigTemplate (boolean): An optional parameter to filter config template bound networks. If configTemplateId is set, this cannot be false. - tags (array): An optional parameter to filter networks by tags. The filtering is case-sensitive. If tags are included, 'tagsFilterType' should also be included (see below). - tagsFilterType (string): An optional parameter of value 'withAnyTags' or 'withAllTags' to indicate whether to return networks which contain ANY or ALL of the included tags. If no type is included, 'withAnyTags' will be selected. + - productTypes (array): An optional parameter to filter networks by product type. Results will have at least one of the included product types. - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100000. Default is 1000. - 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. @@ -3048,10 +3081,10 @@ def getOrganizationNetworks(self, organizationId: str, total_pages=1, direction= organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/networks' - query_params = ['configTemplateId', 'isBoundToConfigTemplate', 'tags', 'tagsFilterType', 'perPage', 'startingAfter', 'endingBefore', ] + query_params = ['configTemplateId', 'isBoundToConfigTemplate', 'tags', 'tagsFilterType', 'productTypes', 'perPage', 'startingAfter', 'endingBefore', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - array_params = ['tags', ] + array_params = ['tags', 'productTypes', ] for k, v in kwargs.items(): if k.strip() in array_params: params[f'{k.strip()}[]'] = kwargs[f'{k}'] @@ -3893,9 +3926,15 @@ def getOrganizationSummaryTopAppliancesByUtilization(self, organizationId: str, https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-top-appliances-by-utilization - organizationId (string): Organization ID + - networkTag (string): Match result to an exact network tag + - deviceTag (string): Match result to an exact device tag + - networkId (string): Match result to an exact network id + - quantity (integer): Set number of desired results to return. Default is 10. + - ssidName (string): Filter results by ssid name + - usageUplink (string): Filter results by usage uplink - t0 (string): The beginning of the timespan for the data. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 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 25 minutes and be less than or equal to 31 days. The default is 1 day. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 186 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 25 minutes and be less than or equal to 186 days. The default is 1 day. """ kwargs.update(locals()) @@ -3907,7 +3946,73 @@ def getOrganizationSummaryTopAppliancesByUtilization(self, organizationId: str, organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/summary/top/appliances/byUtilization' - query_params = ['t0', 't1', 'timespan', ] + query_params = ['networkTag', 'deviceTag', 'networkId', 'quantity', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + return self._session.get(metadata, resource, params) + + + + def getOrganizationSummaryTopApplicationsByUsage(self, organizationId: str, **kwargs): + """ + **Return the top applications sorted by data usage over given time range** + https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-top-applications-by-usage + + - organizationId (string): Organization ID + - networkTag (string): Match result to an exact network tag + - device (string): Match result to an exact device tag + - networkId (string): Match result to an exact network id + - quantity (integer): Set number of desired results to return. Default is 10. + - ssidName (string): Filter results by ssid name + - usageUplink (string): Filter results by usage uplink + - t0 (string): The beginning of the timespan for the data. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 186 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 25 minutes and be less than or equal to 186 days. The default is 1 day. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['organizations', 'monitor', 'summary', 'top', 'applications', 'byUsage'], + 'operation': 'getOrganizationSummaryTopApplicationsByUsage' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/summary/top/applications/byUsage' + + query_params = ['networkTag', 'device', 'networkId', 'quantity', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + return self._session.get(metadata, resource, params) + + + + def getOrganizationSummaryTopApplicationsCategoriesByUsage(self, organizationId: str, **kwargs): + """ + **Return the top application categories sorted by data usage over given time range** + https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-top-applications-categories-by-usage + + - organizationId (string): Organization ID + - networkTag (string): Match result to an exact network tag + - deviceTag (string): Match result to an exact device tag + - networkId (string): Match result to an exact network id + - quantity (integer): Set number of desired results to return. Default is 10. + - ssidName (string): Filter results by ssid name + - usageUplink (string): Filter results by usage uplink + - t0 (string): The beginning of the timespan for the data. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 186 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 25 minutes and be less than or equal to 186 days. The default is 1 day. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['organizations', 'monitor', 'summary', 'top', 'applications', 'categories', 'byUsage'], + 'operation': 'getOrganizationSummaryTopApplicationsCategoriesByUsage' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/summary/top/applications/categories/byUsage' + + query_params = ['networkTag', 'deviceTag', 'networkId', 'quantity', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} return self._session.get(metadata, resource, params) @@ -3920,9 +4025,15 @@ def getOrganizationSummaryTopClientsByUsage(self, organizationId: str, **kwargs) https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-top-clients-by-usage - organizationId (string): Organization ID + - networkTag (string): Match result to an exact network tag + - deviceTag (string): Match result to an exact device tag + - networkId (string): Match result to an exact network id + - quantity (integer): Set number of desired results to return. Default is 10. + - ssidName (string): Filter results by ssid name + - usageUplink (string): Filter results by usage uplink - t0 (string): The beginning of the timespan for the data. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 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 8 hours and be less than or equal to 31 days. The default is 1 day. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 186 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 8 hours and be less than or equal to 186 days. The default is 1 day. """ kwargs.update(locals()) @@ -3934,7 +4045,7 @@ def getOrganizationSummaryTopClientsByUsage(self, organizationId: str, **kwargs) organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/summary/top/clients/byUsage' - query_params = ['t0', 't1', 'timespan', ] + query_params = ['networkTag', 'deviceTag', 'networkId', 'quantity', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} return self._session.get(metadata, resource, params) @@ -3947,9 +4058,15 @@ def getOrganizationSummaryTopClientsManufacturersByUsage(self, organizationId: s https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-top-clients-manufacturers-by-usage - organizationId (string): Organization ID + - networkTag (string): Match result to an exact network tag + - deviceTag (string): Match result to an exact device tag + - networkId (string): Match result to an exact network id + - quantity (integer): Set number of desired results to return. Default is 10. + - ssidName (string): Filter results by ssid name + - usageUplink (string): Filter results by usage uplink - t0 (string): The beginning of the timespan for the data. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 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 less than or equal to 31 days. The default is 1 day. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 186 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 less than or equal to 186 days. The default is 1 day. """ kwargs.update(locals()) @@ -3961,7 +4078,7 @@ def getOrganizationSummaryTopClientsManufacturersByUsage(self, organizationId: s organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/summary/top/clients/manufacturers/byUsage' - query_params = ['t0', 't1', 'timespan', ] + query_params = ['networkTag', 'deviceTag', 'networkId', 'quantity', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} return self._session.get(metadata, resource, params) @@ -3974,9 +4091,15 @@ def getOrganizationSummaryTopDevicesByUsage(self, organizationId: str, **kwargs) https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-top-devices-by-usage - organizationId (string): Organization ID + - networkTag (string): Match result to an exact network tag + - deviceTag (string): Match result to an exact device tag + - networkId (string): Match result to an exact network id + - quantity (integer): Set number of desired results to return. Default is 10. + - ssidName (string): Filter results by ssid name + - usageUplink (string): Filter results by usage uplink - t0 (string): The beginning of the timespan for the data. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 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 8 hours and be less than or equal to 31 days. The default is 1 day. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 186 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 8 hours and be less than or equal to 186 days. The default is 1 day. """ kwargs.update(locals()) @@ -3988,7 +4111,7 @@ def getOrganizationSummaryTopDevicesByUsage(self, organizationId: str, **kwargs) organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/summary/top/devices/byUsage' - query_params = ['t0', 't1', 'timespan', ] + query_params = ['networkTag', 'deviceTag', 'networkId', 'quantity', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} return self._session.get(metadata, resource, params) @@ -4001,9 +4124,15 @@ def getOrganizationSummaryTopDevicesModelsByUsage(self, organizationId: str, **k https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-top-devices-models-by-usage - organizationId (string): Organization ID + - networkTag (string): Match result to an exact network tag + - deviceTag (string): Match result to an exact device tag + - networkId (string): Match result to an exact network id + - quantity (integer): Set number of desired results to return. Default is 10. + - ssidName (string): Filter results by ssid name + - usageUplink (string): Filter results by usage uplink - t0 (string): The beginning of the timespan for the data. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 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 8 hours and be less than or equal to 31 days. The default is 1 day. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 186 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 8 hours and be less than or equal to 186 days. The default is 1 day. """ kwargs.update(locals()) @@ -4015,7 +4144,7 @@ def getOrganizationSummaryTopDevicesModelsByUsage(self, organizationId: str, **k organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/summary/top/devices/models/byUsage' - query_params = ['t0', 't1', 'timespan', ] + query_params = ['networkTag', 'deviceTag', 'networkId', 'quantity', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} return self._session.get(metadata, resource, params) @@ -4030,6 +4159,12 @@ def getOrganizationSummaryTopNetworksByStatus(self, organizationId: str, total_p - organizationId (string): Organization ID - 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" (default) or "prev" page + - networkTag (string): Match result to an exact network tag + - deviceTag (string): Match result to an exact device tag + - networkId (string): Match result to an exact network id + - quantity (integer): Set number of desired results to return. Default is 10. + - ssidName (string): Filter results by ssid name + - usageUplink (string): Filter results by usage uplink - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 5000. - 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. @@ -4044,7 +4179,7 @@ def getOrganizationSummaryTopNetworksByStatus(self, organizationId: str, total_p organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/summary/top/networks/byStatus' - query_params = ['perPage', 'startingAfter', 'endingBefore', ] + query_params = ['networkTag', 'deviceTag', 'networkId', 'quantity', 'ssidName', 'usageUplink', 'perPage', 'startingAfter', 'endingBefore', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} return self._session.get_pages(metadata, resource, params, total_pages, direction) @@ -4057,9 +4192,15 @@ def getOrganizationSummaryTopSsidsByUsage(self, organizationId: str, **kwargs): https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-top-ssids-by-usage - organizationId (string): Organization ID + - networkTag (string): Match result to an exact network tag + - deviceTag (string): Match result to an exact device tag + - networkId (string): Match result to an exact network id + - quantity (integer): Set number of desired results to return. Default is 10. + - ssidName (string): Filter results by ssid name + - usageUplink (string): Filter results by usage uplink - t0 (string): The beginning of the timespan for the data. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 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 8 hours and be less than or equal to 31 days. The default is 1 day. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 186 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 8 hours and be less than or equal to 186 days. The default is 1 day. """ kwargs.update(locals()) @@ -4071,7 +4212,7 @@ def getOrganizationSummaryTopSsidsByUsage(self, organizationId: str, **kwargs): organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/summary/top/ssids/byUsage' - query_params = ['t0', 't1', 'timespan', ] + query_params = ['networkTag', 'deviceTag', 'networkId', 'quantity', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} return self._session.get(metadata, resource, params) @@ -4084,9 +4225,15 @@ def getOrganizationSummaryTopSwitchesByEnergyUsage(self, organizationId: str, ** https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-top-switches-by-energy-usage - organizationId (string): Organization ID + - networkTag (string): Match result to an exact network tag + - deviceTag (string): Match result to an exact device tag + - networkId (string): Match result to an exact network id + - quantity (integer): Set number of desired results to return. Default is 10. + - ssidName (string): Filter results by ssid name + - usageUplink (string): Filter results by usage uplink - t0 (string): The beginning of the timespan for the data. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 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 25 minutes and be less than or equal to 31 days. The default is 1 day. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 186 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 25 minutes and be less than or equal to 186 days. The default is 1 day. """ kwargs.update(locals()) @@ -4098,7 +4245,7 @@ def getOrganizationSummaryTopSwitchesByEnergyUsage(self, organizationId: str, ** organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/summary/top/switches/byEnergyUsage' - query_params = ['t0', 't1', 'timespan', ] + query_params = ['networkTag', 'deviceTag', 'networkId', 'quantity', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} return self._session.get(metadata, resource, params) diff --git a/meraki/aio/api/switch.py b/meraki/aio/api/switch.py index a714cec8..596f5174 100644 --- a/meraki/aio/api/switch.py +++ b/meraki/aio/api/switch.py @@ -157,6 +157,7 @@ def updateDeviceSwitchPort(self, serial: str, portId: str, **kwargs): - flexibleStackingEnabled (boolean): For supported switches (e.g. MS420/MS425), whether or not the port has flexible stacking enabled. - daiTrusted (boolean): If true, ARP packets for this port will be considered trusted, and Dynamic ARP Inspection will allow the traffic. - profile (object): Profile attributes + - dot3az (object): dot3az settings for the port """ kwargs.update(locals()) @@ -182,7 +183,7 @@ def updateDeviceSwitchPort(self, serial: str, portId: str, **kwargs): portId = urllib.parse.quote(str(portId), safe='') resource = f'/devices/{serial}/switch/ports/{portId}' - body_params = ['name', 'tags', 'enabled', 'poeEnabled', 'type', 'vlan', 'voiceVlan', 'allowedVlans', 'isolationEnabled', 'rstpEnabled', 'stpGuard', 'linkNegotiation', 'portScheduleId', 'udld', 'accessPolicyType', 'accessPolicyNumber', 'macAllowList', 'stickyMacAllowList', 'stickyMacAllowListLimit', 'stormControlEnabled', 'adaptivePolicyGroupId', 'peerSgtCapable', 'flexibleStackingEnabled', 'daiTrusted', 'profile', ] + body_params = ['name', 'tags', 'enabled', 'poeEnabled', 'type', 'vlan', 'voiceVlan', 'allowedVlans', 'isolationEnabled', 'rstpEnabled', 'stpGuard', 'linkNegotiation', 'portScheduleId', 'udld', 'accessPolicyType', 'accessPolicyNumber', 'macAllowList', 'stickyMacAllowList', 'stickyMacAllowListLimit', 'stormControlEnabled', 'adaptivePolicyGroupId', 'peerSgtCapable', 'flexibleStackingEnabled', 'daiTrusted', 'profile', 'dot3az', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} return self._session.put(metadata, resource, payload) @@ -2436,6 +2437,7 @@ def updateOrganizationConfigTemplateSwitchProfilePort(self, organizationId: str, - flexibleStackingEnabled (boolean): For supported switches (e.g. MS420/MS425), whether or not the port has flexible stacking enabled. - daiTrusted (boolean): If true, ARP packets for this port will be considered trusted, and Dynamic ARP Inspection will allow the traffic. - profile (object): Profile attributes + - dot3az (object): dot3az settings for the port """ kwargs.update(locals()) @@ -2463,7 +2465,7 @@ def updateOrganizationConfigTemplateSwitchProfilePort(self, organizationId: str, portId = urllib.parse.quote(str(portId), safe='') resource = f'/organizations/{organizationId}/configTemplates/{configTemplateId}/switch/profiles/{profileId}/ports/{portId}' - body_params = ['name', 'tags', 'enabled', 'poeEnabled', 'type', 'vlan', 'voiceVlan', 'allowedVlans', 'isolationEnabled', 'rstpEnabled', 'stpGuard', 'linkNegotiation', 'portScheduleId', 'udld', 'accessPolicyType', 'accessPolicyNumber', 'macAllowList', 'stickyMacAllowList', 'stickyMacAllowListLimit', 'stormControlEnabled', 'flexibleStackingEnabled', 'daiTrusted', 'profile', ] + body_params = ['name', 'tags', 'enabled', 'poeEnabled', 'type', 'vlan', 'voiceVlan', 'allowedVlans', 'isolationEnabled', 'rstpEnabled', 'stpGuard', 'linkNegotiation', 'portScheduleId', 'udld', 'accessPolicyType', 'accessPolicyNumber', 'macAllowList', 'stickyMacAllowList', 'stickyMacAllowListLimit', 'stormControlEnabled', 'flexibleStackingEnabled', 'daiTrusted', 'profile', 'dot3az', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} return self._session.put(metadata, resource, payload) @@ -2477,8 +2479,8 @@ def getOrganizationSummarySwitchPowerHistory(self, organizationId: str, **kwargs - organizationId (string): Organization ID - t0 (string): The beginning of the timespan for the data. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 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 less than or equal to 31 days. The default is 1 day. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 186 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 less than or equal to 186 days. The default is 1 day. """ kwargs.update(locals()) @@ -2534,14 +2536,14 @@ def getOrganizationSwitchPortsBySwitch(self, organizationId: str, total_pages=1, - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 50. Default is 50. - 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. - - networkIds (array): Optional parameter to filter switchports by network. - - portProfileIds (array): Optional parameter to filter switchports belonging to the specified port profiles. - - name (string): Optional parameter to filter switchports belonging to switches by name. All returned switches will have a name that contains the search term or is an exact match. - - mac (string): Optional parameter to filter switchports belonging to switches by MAC address. All returned switches will have a MAC address that contains the search term or is an exact match. - - macs (array): Optional parameter to filter switchports by one or more MAC addresses belonging to devices. All switchports returned belong to MAC addresses of switches that are an exact match. - - serial (string): Optional parameter to filter switchports belonging to switches by serial number. All returned switches will have a serial number that contains the search term or is an exact match. - - serials (array): Optional parameter to filter switchports belonging to switches with one or more serial numbers. All switchports returned belong to serial numbers of switches that are an exact match. - - configurationUpdatedAfter (string): Optional parameter to filter results by switches where the configuration has been updated after the given timestamp. + - configurationUpdatedAfter (string): Optional parameter to filter items to switches where the configuration has been updated after the given timestamp. + - mac (string): Optional parameter to filter items to switches with MAC addresses that contain the search term or are an exact match. + - macs (array): Optional parameter to filter items to switches that have one of the provided MAC addresses. + - name (string): Optional parameter to filter items to switches with names that contain the search term or are an exact match. + - networkIds (array): Optional parameter to filter items to switches in one of the provided networks. + - portProfileIds (array): Optional parameter to filter items to switches that contain switchports belonging to one of the specified port profiles. + - serial (string): Optional parameter to filter items to switches with serial number that contains the search term or are an exact match. + - serials (array): Optional parameter to filter items to switches that have one of the provided serials. """ kwargs.update(locals()) @@ -2553,10 +2555,10 @@ def getOrganizationSwitchPortsBySwitch(self, organizationId: str, total_pages=1, organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/switch/ports/bySwitch' - query_params = ['perPage', 'startingAfter', 'endingBefore', 'networkIds', 'portProfileIds', 'name', 'mac', 'macs', 'serial', 'serials', 'configurationUpdatedAfter', ] + query_params = ['perPage', 'startingAfter', 'endingBefore', 'configurationUpdatedAfter', 'mac', 'macs', 'name', 'networkIds', 'portProfileIds', 'serial', 'serials', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - array_params = ['networkIds', 'portProfileIds', 'macs', 'serials', ] + array_params = ['macs', 'networkIds', 'portProfileIds', 'serials', ] for k, v in kwargs.items(): if k.strip() in array_params: params[f'{k.strip()}[]'] = kwargs[f'{k}'] @@ -2573,8 +2575,8 @@ def getOrganizationSwitchPortsOverview(self, organizationId: str, **kwargs): - organizationId (string): Organization ID - t0 (string): The beginning of the timespan for the data. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 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 12 hours and be less than or equal to 31 days. The default is 1 day. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 186 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 12 hours and be less than or equal to 186 days. The default is 1 day. """ kwargs.update(locals()) diff --git a/meraki/aio/api/wireless.py b/meraki/aio/api/wireless.py index b58d9548..dc947786 100644 --- a/meraki/aio/api/wireless.py +++ b/meraki/aio/api/wireless.py @@ -114,6 +114,51 @@ def getDeviceWirelessConnectionStats(self, serial: str, **kwargs): + def getDeviceWirelessElectronicShelfLabel(self, serial: str): + """ + **Return the ESL settings of a device** + https://developer.cisco.com/meraki/api-v1/#!get-device-wireless-electronic-shelf-label + + - serial (string): Serial + """ + + metadata = { + 'tags': ['wireless', 'configure', 'electronicShelfLabel'], + 'operation': 'getDeviceWirelessElectronicShelfLabel' + } + serial = urllib.parse.quote(str(serial), safe='') + resource = f'/devices/{serial}/wireless/electronicShelfLabel' + + return self._session.get(metadata, resource) + + + + def updateDeviceWirelessElectronicShelfLabel(self, serial: str, **kwargs): + """ + **Update the ESL settings of a device** + https://developer.cisco.com/meraki/api-v1/#!update-device-wireless-electronic-shelf-label + + - serial (string): Serial + - channel (string): Desired ESL channel for the device, or 'Auto' (case insensitive) to use the recommended channel + - enabled (boolean): Turn ESL features on and off for this device + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'configure', 'electronicShelfLabel'], + 'operation': 'updateDeviceWirelessElectronicShelfLabel' + } + serial = urllib.parse.quote(str(serial), safe='') + resource = f'/devices/{serial}/wireless/electronicShelfLabel' + + body_params = ['channel', 'enabled', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.put(metadata, resource, payload) + + + def getDeviceWirelessLatencyStats(self, serial: str, **kwargs): """ **Aggregated latency info for a given AP on this network** @@ -945,6 +990,70 @@ def getNetworkWirelessDevicesLatencyStats(self, networkId: str, **kwargs): + def getNetworkWirelessElectronicShelfLabel(self, networkId: str): + """ + **Return the ESL settings of a wireless network** + https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-electronic-shelf-label + + - networkId (string): Network ID + """ + + metadata = { + 'tags': ['wireless', 'configure', 'electronicShelfLabel'], + 'operation': 'getNetworkWirelessElectronicShelfLabel' + } + networkId = urllib.parse.quote(str(networkId), safe='') + resource = f'/networks/{networkId}/wireless/electronicShelfLabel' + + return self._session.get(metadata, resource) + + + + def updateNetworkWirelessElectronicShelfLabel(self, networkId: str, **kwargs): + """ + **Update the ESL settings of a wireless network** + https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-electronic-shelf-label + + - networkId (string): Network ID + - hostname (string): Desired ESL hostname of the network + - enabled (boolean): Turn ESL features on and off for this network + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'configure', 'electronicShelfLabel'], + 'operation': 'updateNetworkWirelessElectronicShelfLabel' + } + networkId = urllib.parse.quote(str(networkId), safe='') + resource = f'/networks/{networkId}/wireless/electronicShelfLabel' + + body_params = ['hostname', 'enabled', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.put(metadata, resource, payload) + + + + def getNetworkWirelessElectronicShelfLabelConfiguredDevices(self, networkId: str): + """ + **Get a list of all ESL eligible devices of a network** + https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-electronic-shelf-label-configured-devices + + - networkId (string): Network ID + """ + + metadata = { + 'tags': ['wireless', 'configure', 'electronicShelfLabel', 'configuredDevices'], + 'operation': 'getNetworkWirelessElectronicShelfLabelConfiguredDevices' + } + networkId = urllib.parse.quote(str(networkId), safe='') + resource = f'/networks/{networkId}/wireless/electronicShelfLabel/configuredDevices' + + return self._session.get(metadata, resource) + + + def getNetworkWirelessEthernetPortsProfiles(self, networkId: str): """ **List the AP port profiles for this network** @@ -1550,14 +1659,14 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): - number (string): Number - name (string): The name of the SSID - enabled (boolean): Whether or not the SSID is enabled - - authMode (string): The association control method for the SSID ('open', 'open-enhanced', 'psk', 'open-with-radius', 'open-with-nac', '8021x-meraki', '8021x-nac', '8021x-radius', '8021x-google', '8021x-localradius', 'ipsk-with-radius', 'ipsk-without-radius' or 'ipsk-with-nac') + - authMode (string): The association control method for the SSID ('open', 'open-enhanced', 'psk', 'open-with-radius', 'open-with-nac', '8021x-meraki', '8021x-nac', '8021x-radius', '8021x-google', '8021x-entra', '8021x-localradius', 'ipsk-with-radius', 'ipsk-without-radius' or 'ipsk-with-nac') - enterpriseAdminAccess (string): Whether or not an SSID is accessible by 'enterprise' administrators ('access disabled' or 'access enabled') - encryptionMode (string): The psk encryption mode for the SSID ('wep' or 'wpa'). This param is only valid if the authMode is 'psk' - psk (string): The passkey for the SSID. This param is only valid if the authMode is 'psk' - wpaEncryptionMode (string): The types of WPA encryption. ('WPA1 only', 'WPA1 and WPA2', 'WPA2 only', 'WPA3 Transition Mode', 'WPA3 only' or 'WPA3 192-bit Security') - dot11w (object): The current setting for Protected Management Frames (802.11w). - dot11r (object): The current setting for 802.11r - - splashPage (string): The type of splash page for the SSID ('None', 'Click-through splash page', 'Billing', 'Password-protected with Meraki RADIUS', 'Password-protected with custom RADIUS', 'Password-protected with Active Directory', 'Password-protected with LDAP', 'SMS authentication', 'Systems Manager Sentry', 'Facebook Wi-Fi', 'Google OAuth', 'Sponsored guest', 'Cisco ISE' or 'Google Apps domain'). This attribute is not supported for template children. + - splashPage (string): The type of splash page for the SSID ('None', 'Click-through splash page', 'Billing', 'Password-protected with Meraki RADIUS', 'Password-protected with custom RADIUS', 'Password-protected with Active Directory', 'Password-protected with LDAP', 'SMS authentication', 'Systems Manager Sentry', 'Facebook Wi-Fi', 'Google OAuth', 'Microsoft Entra ID', 'Sponsored guest', 'Cisco ISE' or 'Google Apps domain'). This attribute is not supported for template children. - splashGuestSponsorDomains (array): Array of valid sponsor email domains for sponsored guest splash type. - oauth (object): The OAuth settings of this SSID. Only valid if splashPage is 'Google OAuth'. - localRadius (object): The current setting for Local Authentication, a built-in RADIUS server on the access point. Only valid if authMode is '8021x-localradius'. @@ -1612,7 +1721,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): kwargs.update(locals()) if 'authMode' in kwargs: - options = ['8021x-google', '8021x-localradius', '8021x-meraki', '8021x-nac', '8021x-radius', 'ipsk-with-nac', 'ipsk-with-radius', 'ipsk-without-radius', 'open', 'open-enhanced', 'open-with-nac', 'open-with-radius', 'psk'] + options = ['8021x-entra', '8021x-google', '8021x-localradius', '8021x-meraki', '8021x-nac', '8021x-radius', 'ipsk-with-nac', 'ipsk-with-radius', 'ipsk-without-radius', 'open', 'open-enhanced', 'open-with-nac', 'open-with-radius', 'psk'] assert kwargs['authMode'] in options, f'''"authMode" cannot be "{kwargs['authMode']}", & must be set to one of: {options}''' if 'enterpriseAdminAccess' in kwargs: options = ['access disabled', 'access enabled'] @@ -1624,7 +1733,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): options = ['WPA1 and WPA2', 'WPA1 only', 'WPA2 only', 'WPA3 192-bit Security', 'WPA3 Transition Mode', 'WPA3 only'] assert kwargs['wpaEncryptionMode'] in options, f'''"wpaEncryptionMode" cannot be "{kwargs['wpaEncryptionMode']}", & must be set to one of: {options}''' if 'splashPage' in kwargs: - options = ['Billing', 'Cisco ISE', 'Click-through splash page', 'Facebook Wi-Fi', 'Google Apps domain', 'Google OAuth', 'None', 'Password-protected with Active Directory', 'Password-protected with LDAP', 'Password-protected with Meraki RADIUS', 'Password-protected with custom RADIUS', 'SMS authentication', 'Sponsored guest', 'Systems Manager Sentry'] + options = ['Billing', 'Cisco ISE', 'Click-through splash page', 'Facebook Wi-Fi', 'Google Apps domain', 'Google OAuth', 'Microsoft Entra ID', 'None', 'Password-protected with Active Directory', 'Password-protected with LDAP', 'Password-protected with Meraki RADIUS', 'Password-protected with custom RADIUS', 'SMS authentication', 'Sponsored guest', 'Systems Manager Sentry'] assert kwargs['splashPage'] in options, f'''"splashPage" cannot be "{kwargs['splashPage']}", & must be set to one of: {options}''' if 'radiusFailoverPolicy' in kwargs: options = ['Allow access', 'Deny access'] @@ -2184,6 +2293,9 @@ def updateNetworkWirelessSsidSplashSettings(self, networkId: str, number: str, * kwargs.update(locals()) + if 'splashTimeout' in kwargs: + options = [30, 60, 120, 240, 480, 720, 1080, 1440, 2880, 5760, 7200, 10080, 20160, 43200, 86400, 129600] + assert kwargs['splashTimeout'] in options, f'''"splashTimeout" cannot be "{kwargs['splashTimeout']}", & must be set to one of: {options}''' if 'controllerDisconnectionBehavior' in kwargs: options = ['default', 'open', 'restricted'] assert kwargs['controllerDisconnectionBehavior'] in options, f'''"controllerDisconnectionBehavior" cannot be "{kwargs['controllerDisconnectionBehavior']}", & must be set to one of: {options}''' @@ -2754,7 +2866,7 @@ def getOrganizationWirelessRfProfilesAssignmentsByDevice(self, organizationId: s - 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. - networkIds (array): Optional parameter to filter devices by network. - - productTypes (array): Optional parameter to filter devices by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, and secureConnect. + - productTypes (array): Optional parameter to filter devices by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, wirelessController, and secureConnect. - name (string): Optional parameter to filter RF profiles by device name. All returned devices will have a name that contains the search term or is an exact match. - mac (string): Optional parameter to filter RF profiles by device MAC address. All returned devices will have a MAC address that contains the search term or is an exact match. - serial (string): Optional parameter to filter RF profiles by device serial number. All returned devices will have a serial number that contains the search term or is an exact match. @@ -2806,7 +2918,7 @@ def getOrganizationWirelessSsidsStatusesByDevice(self, organizationId: str, tota kwargs.update(locals()) metadata = { - 'tags': ['wireless', 'configure', 'ssids', 'statuses', 'byDevice'], + 'tags': ['wireless', 'monitor', 'ssids', 'statuses', 'byDevice'], 'operation': 'getOrganizationWirelessSsidsStatusesByDevice' } organizationId = urllib.parse.quote(str(organizationId), safe='') diff --git a/meraki/api/appliance.py b/meraki/api/appliance.py index 1e57fb40..4b30e4ee 100644 --- a/meraki/api/appliance.py +++ b/meraki/api/appliance.py @@ -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. """ diff --git a/meraki/api/batch/appliance.py b/meraki/api/batch/appliance.py index d3fd2e0a..9a7ffae6 100644 --- a/meraki/api/batch/appliance.py +++ b/meraki/api/batch/appliance.py @@ -969,7 +969,7 @@ def updateNetworkApplianceVpnBgp(self, networkId: str, enabled: bool, **kwargs): payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { "resource": resource, - "operation": "update", + "operation": "settings/update", "body": payload } return action diff --git a/meraki/api/batch/devices.py b/meraki/api/batch/devices.py index 5357a503..ad601256 100644 --- a/meraki/api/batch/devices.py +++ b/meraki/api/batch/devices.py @@ -48,7 +48,7 @@ def updateDevice(self, serial: str, **kwargs): def createDeviceLiveToolsThroughputTest(self, serial: str, **kwargs): """ - **Enqueue a job to test a device throughput, the test will run for 10 secs to test throughput** + **Enqueue a job to test a device throughput, the test will run for 10 secs to test throughput. This endpoint has a rate limit of one request every five seconds per device.** https://developer.cisco.com/meraki/api-v1/#!create-device-live-tools-throughput-test - serial (string): Serial diff --git a/meraki/api/batch/networks.py b/meraki/api/batch/networks.py index 65e05fa5..5de349f9 100644 --- a/meraki/api/batch/networks.py +++ b/meraki/api/batch/networks.py @@ -138,16 +138,17 @@ def provisionNetworkClients(self, networkId: str, clients: list, devicePolicy: s - 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). This operation can be used up to ten times within a single five minute window.** 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'], @@ -283,7 +284,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 = { diff --git a/meraki/api/batch/organizations.py b/meraki/api/batch/organizations.py index bec10484..cbd8653a 100644 --- a/meraki/api/batch/organizations.py +++ b/meraki/api/batch/organizations.py @@ -648,6 +648,38 @@ def updateOrganizationConfigTemplate(self, organizationId: str, configTemplateId + def bulkUpdateOrganizationDevicesDetails(self, organizationId: str, serials: list, details: list): + """ + **Updating device details (currently only used for Catalyst devices)** + https://developer.cisco.com/meraki/api-v1/#!bulk-update-organization-devices-details + + - organizationId (string): Organization ID + - serials (array): A list of serials of devices to update + - details (array): An array of details + """ + + kwargs = locals() + + metadata = { + 'tags': ['organizations', 'configure', 'devices', 'details', 'bulkUpdate'], + 'operation': 'bulkUpdateOrganizationDevicesDetails' + } + resource = f'/organizations/{organizationId}/devices/details/bulkUpdate' + + body_params = ['serials', 'details', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "details/update", + "body": payload + } + return action + + + + + + def updateOrganizationEarlyAccessFeaturesOptIn(self, organizationId: str, optInId: str, **kwargs): """ **Update an early access feature opt-in for an organization** diff --git a/meraki/api/batch/switch.py b/meraki/api/batch/switch.py index f91673f1..c36a044f 100644 --- a/meraki/api/batch/switch.py +++ b/meraki/api/batch/switch.py @@ -70,6 +70,7 @@ def updateDeviceSwitchPort(self, serial: str, portId: str, **kwargs): - flexibleStackingEnabled (boolean): For supported switches (e.g. MS420/MS425), whether or not the port has flexible stacking enabled. - daiTrusted (boolean): If true, ARP packets for this port will be considered trusted, and Dynamic ARP Inspection will allow the traffic. - profile (object): Profile attributes + - dot3az (object): dot3az settings for the port """ kwargs.update(locals()) @@ -93,7 +94,7 @@ def updateDeviceSwitchPort(self, serial: str, portId: str, **kwargs): } resource = f'/devices/{serial}/switch/ports/{portId}' - body_params = ['name', 'tags', 'enabled', 'poeEnabled', 'type', 'vlan', 'voiceVlan', 'allowedVlans', 'isolationEnabled', 'rstpEnabled', 'stpGuard', 'linkNegotiation', 'portScheduleId', 'udld', 'accessPolicyType', 'accessPolicyNumber', 'macAllowList', 'stickyMacAllowList', 'stickyMacAllowListLimit', 'stormControlEnabled', 'adaptivePolicyGroupId', 'peerSgtCapable', 'flexibleStackingEnabled', 'daiTrusted', 'profile', ] + body_params = ['name', 'tags', 'enabled', 'poeEnabled', 'type', 'vlan', 'voiceVlan', 'allowedVlans', 'isolationEnabled', 'rstpEnabled', 'stpGuard', 'linkNegotiation', 'portScheduleId', 'udld', 'accessPolicyType', 'accessPolicyNumber', 'macAllowList', 'stickyMacAllowList', 'stickyMacAllowListLimit', 'stormControlEnabled', 'adaptivePolicyGroupId', 'peerSgtCapable', 'flexibleStackingEnabled', 'daiTrusted', 'profile', 'dot3az', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { "resource": resource, @@ -1600,6 +1601,7 @@ def updateOrganizationConfigTemplateSwitchProfilePort(self, organizationId: str, - flexibleStackingEnabled (boolean): For supported switches (e.g. MS420/MS425), whether or not the port has flexible stacking enabled. - daiTrusted (boolean): If true, ARP packets for this port will be considered trusted, and Dynamic ARP Inspection will allow the traffic. - profile (object): Profile attributes + - dot3az (object): dot3az settings for the port """ kwargs.update(locals()) @@ -1623,7 +1625,7 @@ def updateOrganizationConfigTemplateSwitchProfilePort(self, organizationId: str, } resource = f'/organizations/{organizationId}/configTemplates/{configTemplateId}/switch/profiles/{profileId}/ports/{portId}' - body_params = ['name', 'tags', 'enabled', 'poeEnabled', 'type', 'vlan', 'voiceVlan', 'allowedVlans', 'isolationEnabled', 'rstpEnabled', 'stpGuard', 'linkNegotiation', 'portScheduleId', 'udld', 'accessPolicyType', 'accessPolicyNumber', 'macAllowList', 'stickyMacAllowList', 'stickyMacAllowListLimit', 'stormControlEnabled', 'flexibleStackingEnabled', 'daiTrusted', 'profile', ] + body_params = ['name', 'tags', 'enabled', 'poeEnabled', 'type', 'vlan', 'voiceVlan', 'allowedVlans', 'isolationEnabled', 'rstpEnabled', 'stpGuard', 'linkNegotiation', 'portScheduleId', 'udld', 'accessPolicyType', 'accessPolicyNumber', 'macAllowList', 'stickyMacAllowList', 'stickyMacAllowListLimit', 'stormControlEnabled', 'flexibleStackingEnabled', 'daiTrusted', 'profile', 'dot3az', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { "resource": resource, diff --git a/meraki/api/batch/wireless.py b/meraki/api/batch/wireless.py index d58c9fab..c20d5f20 100644 --- a/meraki/api/batch/wireless.py +++ b/meraki/api/batch/wireless.py @@ -71,6 +71,38 @@ def updateDeviceWirelessBluetoothSettings(self, serial: str, **kwargs): + def updateDeviceWirelessElectronicShelfLabel(self, serial: str, **kwargs): + """ + **Update the ESL settings of a device** + https://developer.cisco.com/meraki/api-v1/#!update-device-wireless-electronic-shelf-label + + - serial (string): Serial + - channel (string): Desired ESL channel for the device, or 'Auto' (case insensitive) to use the recommended channel + - enabled (boolean): Turn ESL features on and off for this device + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'configure', 'electronicShelfLabel'], + 'operation': 'updateDeviceWirelessElectronicShelfLabel' + } + resource = f'/devices/{serial}/wireless/electronicShelfLabel' + + body_params = ['channel', 'enabled', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "update", + "body": payload + } + return action + + + + + + def updateDeviceWirelessRadioSettings(self, serial: str, **kwargs): """ **Update the radio settings of a device** @@ -304,6 +336,38 @@ def updateNetworkWirelessBilling(self, networkId: str, **kwargs): + def updateNetworkWirelessElectronicShelfLabel(self, networkId: str, **kwargs): + """ + **Update the ESL settings of a wireless network** + https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-electronic-shelf-label + + - networkId (string): Network ID + - hostname (string): Desired ESL hostname of the network + - enabled (boolean): Turn ESL features on and off for this network + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'configure', 'electronicShelfLabel'], + 'operation': 'updateNetworkWirelessElectronicShelfLabel' + } + resource = f'/networks/{networkId}/wireless/electronicShelfLabel' + + body_params = ['hostname', 'enabled', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "update", + "body": payload + } + return action + + + + + + def createNetworkWirelessEthernetPortsProfile(self, networkId: str, name: str, ports: list, **kwargs): """ **Create an AP port profile** @@ -632,14 +696,14 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): - number (string): Number - name (string): The name of the SSID - enabled (boolean): Whether or not the SSID is enabled - - authMode (string): The association control method for the SSID ('open', 'open-enhanced', 'psk', 'open-with-radius', 'open-with-nac', '8021x-meraki', '8021x-nac', '8021x-radius', '8021x-google', '8021x-localradius', 'ipsk-with-radius', 'ipsk-without-radius' or 'ipsk-with-nac') + - authMode (string): The association control method for the SSID ('open', 'open-enhanced', 'psk', 'open-with-radius', 'open-with-nac', '8021x-meraki', '8021x-nac', '8021x-radius', '8021x-google', '8021x-entra', '8021x-localradius', 'ipsk-with-radius', 'ipsk-without-radius' or 'ipsk-with-nac') - enterpriseAdminAccess (string): Whether or not an SSID is accessible by 'enterprise' administrators ('access disabled' or 'access enabled') - encryptionMode (string): The psk encryption mode for the SSID ('wep' or 'wpa'). This param is only valid if the authMode is 'psk' - psk (string): The passkey for the SSID. This param is only valid if the authMode is 'psk' - wpaEncryptionMode (string): The types of WPA encryption. ('WPA1 only', 'WPA1 and WPA2', 'WPA2 only', 'WPA3 Transition Mode', 'WPA3 only' or 'WPA3 192-bit Security') - dot11w (object): The current setting for Protected Management Frames (802.11w). - dot11r (object): The current setting for 802.11r - - splashPage (string): The type of splash page for the SSID ('None', 'Click-through splash page', 'Billing', 'Password-protected with Meraki RADIUS', 'Password-protected with custom RADIUS', 'Password-protected with Active Directory', 'Password-protected with LDAP', 'SMS authentication', 'Systems Manager Sentry', 'Facebook Wi-Fi', 'Google OAuth', 'Sponsored guest', 'Cisco ISE' or 'Google Apps domain'). This attribute is not supported for template children. + - splashPage (string): The type of splash page for the SSID ('None', 'Click-through splash page', 'Billing', 'Password-protected with Meraki RADIUS', 'Password-protected with custom RADIUS', 'Password-protected with Active Directory', 'Password-protected with LDAP', 'SMS authentication', 'Systems Manager Sentry', 'Facebook Wi-Fi', 'Google OAuth', 'Microsoft Entra ID', 'Sponsored guest', 'Cisco ISE' or 'Google Apps domain'). This attribute is not supported for template children. - splashGuestSponsorDomains (array): Array of valid sponsor email domains for sponsored guest splash type. - oauth (object): The OAuth settings of this SSID. Only valid if splashPage is 'Google OAuth'. - localRadius (object): The current setting for Local Authentication, a built-in RADIUS server on the access point. Only valid if authMode is '8021x-localradius'. @@ -694,7 +758,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): kwargs.update(locals()) if 'authMode' in kwargs: - options = ['8021x-google', '8021x-localradius', '8021x-meraki', '8021x-nac', '8021x-radius', 'ipsk-with-nac', 'ipsk-with-radius', 'ipsk-without-radius', 'open', 'open-enhanced', 'open-with-nac', 'open-with-radius', 'psk'] + options = ['8021x-entra', '8021x-google', '8021x-localradius', '8021x-meraki', '8021x-nac', '8021x-radius', 'ipsk-with-nac', 'ipsk-with-radius', 'ipsk-without-radius', 'open', 'open-enhanced', 'open-with-nac', 'open-with-radius', 'psk'] assert kwargs['authMode'] in options, f'''"authMode" cannot be "{kwargs['authMode']}", & must be set to one of: {options}''' if 'enterpriseAdminAccess' in kwargs: options = ['access disabled', 'access enabled'] @@ -706,7 +770,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): options = ['WPA1 and WPA2', 'WPA1 only', 'WPA2 only', 'WPA3 192-bit Security', 'WPA3 Transition Mode', 'WPA3 only'] assert kwargs['wpaEncryptionMode'] in options, f'''"wpaEncryptionMode" cannot be "{kwargs['wpaEncryptionMode']}", & must be set to one of: {options}''' if 'splashPage' in kwargs: - options = ['Billing', 'Cisco ISE', 'Click-through splash page', 'Facebook Wi-Fi', 'Google Apps domain', 'Google OAuth', 'None', 'Password-protected with Active Directory', 'Password-protected with LDAP', 'Password-protected with Meraki RADIUS', 'Password-protected with custom RADIUS', 'SMS authentication', 'Sponsored guest', 'Systems Manager Sentry'] + options = ['Billing', 'Cisco ISE', 'Click-through splash page', 'Facebook Wi-Fi', 'Google Apps domain', 'Google OAuth', 'Microsoft Entra ID', 'None', 'Password-protected with Active Directory', 'Password-protected with LDAP', 'Password-protected with Meraki RADIUS', 'Password-protected with custom RADIUS', 'SMS authentication', 'Sponsored guest', 'Systems Manager Sentry'] assert kwargs['splashPage'] in options, f'''"splashPage" cannot be "{kwargs['splashPage']}", & must be set to one of: {options}''' if 'radiusFailoverPolicy' in kwargs: options = ['Allow access', 'Deny access'] @@ -1107,6 +1171,9 @@ def updateNetworkWirelessSsidSplashSettings(self, networkId: str, number: str, * kwargs.update(locals()) + if 'splashTimeout' in kwargs: + options = [30, 60, 120, 240, 480, 720, 1080, 1440, 2880, 5760, 7200, 10080, 20160, 43200, 86400, 129600] + assert kwargs['splashTimeout'] in options, f'''"splashTimeout" cannot be "{kwargs['splashTimeout']}", & must be set to one of: {options}''' if 'controllerDisconnectionBehavior' in kwargs: options = ['default', 'open', 'restricted'] assert kwargs['controllerDisconnectionBehavior'] in options, f'''"controllerDisconnectionBehavior" cannot be "{kwargs['controllerDisconnectionBehavior']}", & must be set to one of: {options}''' diff --git a/meraki/api/devices.py b/meraki/api/devices.py index 902e9a6f..76eb932a 100644 --- a/meraki/api/devices.py +++ b/meraki/api/devices.py @@ -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. """ @@ -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) diff --git a/meraki/api/networks.py b/meraki/api/networks.py index 3b744a54..b9e0dbe4 100644 --- a/meraki/api/networks.py +++ b/meraki/api/networks.py @@ -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'], @@ -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 @@ -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. @@ -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 = { @@ -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', ] @@ -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 = { diff --git a/meraki/api/organizations.py b/meraki/api/organizations.py index d159e82e..1701ba8b 100644 --- a/meraki/api/organizations.py +++ b/meraki/api/organizations.py @@ -1071,7 +1071,7 @@ def getOrganizationAssuranceAlerts(self, organizationId: str, total_pages=1, dir assert kwargs['sortBy'] in options, f'''"sortBy" cannot be "{kwargs['sortBy']}", & must be set to one of: {options}''' metadata = { - 'tags': ['organizations', 'configure', 'alerts'], + 'tags': ['organizations', 'monitor', 'alerts'], 'operation': 'getOrganizationAssuranceAlerts' } organizationId = urllib.parse.quote(str(organizationId), safe='') @@ -1096,13 +1096,13 @@ def dismissOrganizationAssuranceAlerts(self, organizationId: str, alertIds: list https://developer.cisco.com/meraki/api-v1/#!dismiss-organization-assurance-alerts - organizationId (string): Organization ID - - alertIds (array): Parameter to dismiss alerts by ID + - alertIds (array): Array of alert IDs to dismiss """ kwargs = locals() metadata = { - 'tags': ['organizations', 'configure', 'alerts'], + 'tags': ['organizations', 'monitor', 'alerts'], 'operation': 'dismissOrganizationAssuranceAlerts' } organizationId = urllib.parse.quote(str(organizationId), safe='') @@ -1138,7 +1138,7 @@ def getOrganizationAssuranceAlertsOverview(self, organizationId: str, **kwargs): kwargs.update(locals()) metadata = { - 'tags': ['organizations', 'configure', 'alerts', 'overview'], + 'tags': ['organizations', 'monitor', 'alerts', 'overview'], 'operation': 'getOrganizationAssuranceAlertsOverview' } organizationId = urllib.parse.quote(str(organizationId), safe='') @@ -1190,7 +1190,7 @@ def getOrganizationAssuranceAlertsOverviewByNetwork(self, organizationId: str, t assert kwargs['sortOrder'] in options, f'''"sortOrder" cannot be "{kwargs['sortOrder']}", & must be set to one of: {options}''' metadata = { - 'tags': ['organizations', 'configure', 'alerts', 'overview', 'byNetwork'], + 'tags': ['organizations', 'monitor', 'alerts', 'overview', 'byNetwork'], 'operation': 'getOrganizationAssuranceAlertsOverviewByNetwork' } organizationId = urllib.parse.quote(str(organizationId), safe='') @@ -1246,7 +1246,7 @@ def getOrganizationAssuranceAlertsOverviewByType(self, organizationId: str, tota assert kwargs['sortBy'] in options, f'''"sortBy" cannot be "{kwargs['sortBy']}", & must be set to one of: {options}''' metadata = { - 'tags': ['organizations', 'configure', 'alerts', 'overview', 'byType'], + 'tags': ['organizations', 'monitor', 'alerts', 'overview', 'byType'], 'operation': 'getOrganizationAssuranceAlertsOverviewByType' } organizationId = urllib.parse.quote(str(organizationId), safe='') @@ -1284,7 +1284,7 @@ def getOrganizationAssuranceAlertsOverviewHistorical(self, organizationId: str, kwargs.update(locals()) metadata = { - 'tags': ['organizations', 'configure', 'alerts', 'overview', 'historical'], + 'tags': ['organizations', 'monitor', 'alerts', 'overview', 'historical'], 'operation': 'getOrganizationAssuranceAlertsOverviewHistorical' } organizationId = urllib.parse.quote(str(organizationId), safe='') @@ -1309,13 +1309,13 @@ def restoreOrganizationAssuranceAlerts(self, organizationId: str, alertIds: list https://developer.cisco.com/meraki/api-v1/#!restore-organization-assurance-alerts - organizationId (string): Organization ID - - alertIds (array): Parameter to restore alerts by ID + - alertIds (array): Array of alert IDs to restore """ kwargs = locals() metadata = { - 'tags': ['organizations', 'configure', 'alerts'], + 'tags': ['organizations', 'monitor', 'alerts'], 'operation': 'restoreOrganizationAssuranceAlerts' } organizationId = urllib.parse.quote(str(organizationId), safe='') @@ -1338,7 +1338,7 @@ def getOrganizationAssuranceAlert(self, organizationId: str, id: str): """ metadata = { - 'tags': ['organizations', 'configure', 'alerts'], + 'tags': ['organizations', 'monitor', 'alerts'], 'operation': 'getOrganizationAssuranceAlert' } organizationId = urllib.parse.quote(str(organizationId), safe='') @@ -1556,9 +1556,14 @@ def getOrganizationClientsBandwidthUsageHistory(self, organizationId: str, **kwa https://developer.cisco.com/meraki/api-v1/#!get-organization-clients-bandwidth-usage-history - organizationId (string): Organization ID + - networkTag (string): Match result to an exact network tag + - deviceTag (string): Match result to an exact device tag + - networkId (string): Match result to an exact network id + - ssidName (string): Filter results by ssid name + - usageUplink (string): Filter results by usage uplink - t0 (string): The beginning of the timespan for the data. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 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 less than or equal to 31 days. The default is 1 day. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 186 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 less than or equal to 186 days. The default is 1 day. """ kwargs.update(locals()) @@ -1570,7 +1575,7 @@ def getOrganizationClientsBandwidthUsageHistory(self, organizationId: str, **kwa organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/clients/bandwidthUsageHistory' - query_params = ['t0', 't1', 'timespan', ] + query_params = ['networkTag', 'deviceTag', 'networkId', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} return self._session.get(metadata, resource, params) @@ -1822,7 +1827,7 @@ def getOrganizationDevices(self, organizationId: str, total_pages=1, direction=' - 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. - configurationUpdatedAfter (string): Filter results by whether or not the device's configuration has been updated after the given timestamp - networkIds (array): Optional parameter to filter devices by network. - - productTypes (array): Optional parameter to filter devices by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, and secureConnect. + - productTypes (array): Optional parameter to filter devices by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, wirelessController, and secureConnect. - tags (array): Optional parameter to filter devices by tags. - tagsFilterType (string): Optional parameter of value 'withAnyTags' or 'withAllTags' to indicate whether to return networks which contain ANY or ALL of the included tags. If no type is included, 'withAnyTags' will be selected. - name (string): Optional parameter to filter devices by name. All returned devices will have a name that contains the search term or is an exact match. @@ -1874,7 +1879,7 @@ def getOrganizationDevicesAvailabilities(self, organizationId: str, total_pages= - 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. - networkIds (array): Optional parameter to filter device availabilities by network ID. This filter uses multiple exact matches. - - productTypes (array): Optional parameter to filter device availabilities by device product types. This filter uses multiple exact matches. + - productTypes (array): Optional parameter to filter device availabilities by device product types. This filter uses multiple exact matches. Valid types are wireless, appliance, switch, camera, cellularGateway, sensor, and wirelessController - serials (array): Optional parameter to filter device availabilities by device serial numbers. This filter uses multiple exact matches. - tags (array): An optional parameter to filter devices by tags. The filtering is case-sensitive. If tags are included, 'tagsFilterType' should also be included (see below). This filter uses multiple exact matches. - tagsFilterType (string): An optional parameter of value 'withAnyTags' or 'withAllTags' to indicate whether to return devices which contain ANY or ALL of the included tags. If no type is included, 'withAnyTags' will be selected. @@ -1948,6 +1953,32 @@ def getOrganizationDevicesAvailabilitiesChangeHistory(self, organizationId: str, + def bulkUpdateOrganizationDevicesDetails(self, organizationId: str, serials: list, details: list): + """ + **Updating device details (currently only used for Catalyst devices)** + https://developer.cisco.com/meraki/api-v1/#!bulk-update-organization-devices-details + + - organizationId (string): Organization ID + - serials (array): A list of serials of devices to update + - details (array): An array of details + """ + + kwargs = locals() + + metadata = { + 'tags': ['organizations', 'configure', 'devices', 'details', 'bulkUpdate'], + 'operation': 'bulkUpdateOrganizationDevicesDetails' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/devices/details/bulkUpdate' + + body_params = ['serials', 'details', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.post(metadata, resource, payload) + + + def getOrganizationDevicesOverviewByModel(self, organizationId: str, **kwargs): """ **Lists the count for each device model** @@ -2087,7 +2118,7 @@ def getOrganizationDevicesStatuses(self, organizationId: str, total_pages=1, dir - networkIds (array): Optional parameter to filter devices by network ids. - serials (array): Optional parameter to filter devices by serials. - statuses (array): Optional parameter to filter devices by statuses. Valid statuses are ["online", "alerting", "offline", "dormant"]. - - productTypes (array): An optional parameter to filter device statuses by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, and secureConnect. + - productTypes (array): An optional parameter to filter device statuses by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, wirelessController, and secureConnect. - models (array): Optional parameter to filter devices by models. - tags (array): An optional parameter to filter devices by tags. The filtering is case-sensitive. If tags are included, 'tagsFilterType' should also be included (see below). - tagsFilterType (string): An optional parameter of value 'withAnyTags' or 'withAllTags' to indicate whether to return devices which contain ANY or ALL of the included tags. If no type is included, 'withAnyTags' will be selected. @@ -2125,7 +2156,7 @@ def getOrganizationDevicesStatusesOverview(self, organizationId: str, **kwargs): https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-statuses-overview - organizationId (string): Organization ID - - productTypes (array): An optional parameter to filter device statuses by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, and secureConnect. + - productTypes (array): An optional parameter to filter device statuses by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, wirelessController, and secureConnect. - networkIds (array): An optional parameter to filter device statuses by network. """ @@ -2414,6 +2445,7 @@ def getOrganizationFirmwareUpgradesByDevice(self, organizationId: str, total_pag - macs (array): Optional parameter to filter by one or more MAC addresses belonging to devices. All devices returned belong to MAC addresses that are an exact match. - firmwareUpgradeBatchIds (array): Optional parameter to filter by firmware upgrade batch ids. - upgradeStatuses (array): Optional parameter to filter by firmware upgrade statuses. + - currentUpgradesOnly (boolean): Optional parameter to filter to only current or pending upgrade statuses """ kwargs.update(locals()) @@ -2425,7 +2457,7 @@ def getOrganizationFirmwareUpgradesByDevice(self, organizationId: str, total_pag organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/firmware/upgrades/byDevice' - query_params = ['perPage', 'startingAfter', 'endingBefore', 'networkIds', 'serials', 'macs', 'firmwareUpgradeBatchIds', 'upgradeStatuses', ] + query_params = ['perPage', 'startingAfter', 'endingBefore', 'networkIds', 'serials', 'macs', 'firmwareUpgradeBatchIds', 'upgradeStatuses', 'currentUpgradesOnly', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = ['networkIds', 'serials', 'macs', 'firmwareUpgradeBatchIds', 'upgradeStatuses', ] @@ -2485,7 +2517,7 @@ def getOrganizationInventoryDevices(self, organizationId: str, total_pages=1, di - orderNumbers (array): Search for devices in inventory based on order numbers. - tags (array): Filter devices by tags. The filtering is case-sensitive. If tags are included, 'tagsFilterType' should also be included (see below). - tagsFilterType (string): To use with 'tags' parameter, to filter devices which contain ANY or ALL given tags. Accepted values are 'withAnyTags' or 'withAllTags', default is 'withAnyTags'. - - productTypes (array): Filter devices by product type. Accepted values are appliance, camera, cellularGateway, secureConnect, sensor, switch, systemsManager, and wireless. + - productTypes (array): Filter devices by product type. Accepted values are appliance, camera, cellularGateway, secureConnect, sensor, switch, systemsManager, wireless, and wirelessController. """ kwargs.update(locals()) @@ -3030,6 +3062,7 @@ def getOrganizationNetworks(self, organizationId: str, total_pages=1, direction= - isBoundToConfigTemplate (boolean): An optional parameter to filter config template bound networks. If configTemplateId is set, this cannot be false. - tags (array): An optional parameter to filter networks by tags. The filtering is case-sensitive. If tags are included, 'tagsFilterType' should also be included (see below). - tagsFilterType (string): An optional parameter of value 'withAnyTags' or 'withAllTags' to indicate whether to return networks which contain ANY or ALL of the included tags. If no type is included, 'withAnyTags' will be selected. + - productTypes (array): An optional parameter to filter networks by product type. Results will have at least one of the included product types. - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 100000. Default is 1000. - 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. @@ -3048,10 +3081,10 @@ def getOrganizationNetworks(self, organizationId: str, total_pages=1, direction= organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/networks' - query_params = ['configTemplateId', 'isBoundToConfigTemplate', 'tags', 'tagsFilterType', 'perPage', 'startingAfter', 'endingBefore', ] + query_params = ['configTemplateId', 'isBoundToConfigTemplate', 'tags', 'tagsFilterType', 'productTypes', 'perPage', 'startingAfter', 'endingBefore', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - array_params = ['tags', ] + array_params = ['tags', 'productTypes', ] for k, v in kwargs.items(): if k.strip() in array_params: params[f'{k.strip()}[]'] = kwargs[f'{k}'] @@ -3893,9 +3926,15 @@ def getOrganizationSummaryTopAppliancesByUtilization(self, organizationId: str, https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-top-appliances-by-utilization - organizationId (string): Organization ID + - networkTag (string): Match result to an exact network tag + - deviceTag (string): Match result to an exact device tag + - networkId (string): Match result to an exact network id + - quantity (integer): Set number of desired results to return. Default is 10. + - ssidName (string): Filter results by ssid name + - usageUplink (string): Filter results by usage uplink - t0 (string): The beginning of the timespan for the data. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 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 25 minutes and be less than or equal to 31 days. The default is 1 day. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 186 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 25 minutes and be less than or equal to 186 days. The default is 1 day. """ kwargs.update(locals()) @@ -3907,7 +3946,73 @@ def getOrganizationSummaryTopAppliancesByUtilization(self, organizationId: str, organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/summary/top/appliances/byUtilization' - query_params = ['t0', 't1', 'timespan', ] + query_params = ['networkTag', 'deviceTag', 'networkId', 'quantity', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + return self._session.get(metadata, resource, params) + + + + def getOrganizationSummaryTopApplicationsByUsage(self, organizationId: str, **kwargs): + """ + **Return the top applications sorted by data usage over given time range** + https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-top-applications-by-usage + + - organizationId (string): Organization ID + - networkTag (string): Match result to an exact network tag + - device (string): Match result to an exact device tag + - networkId (string): Match result to an exact network id + - quantity (integer): Set number of desired results to return. Default is 10. + - ssidName (string): Filter results by ssid name + - usageUplink (string): Filter results by usage uplink + - t0 (string): The beginning of the timespan for the data. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 186 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 25 minutes and be less than or equal to 186 days. The default is 1 day. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['organizations', 'monitor', 'summary', 'top', 'applications', 'byUsage'], + 'operation': 'getOrganizationSummaryTopApplicationsByUsage' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/summary/top/applications/byUsage' + + query_params = ['networkTag', 'device', 'networkId', 'quantity', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + return self._session.get(metadata, resource, params) + + + + def getOrganizationSummaryTopApplicationsCategoriesByUsage(self, organizationId: str, **kwargs): + """ + **Return the top application categories sorted by data usage over given time range** + https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-top-applications-categories-by-usage + + - organizationId (string): Organization ID + - networkTag (string): Match result to an exact network tag + - deviceTag (string): Match result to an exact device tag + - networkId (string): Match result to an exact network id + - quantity (integer): Set number of desired results to return. Default is 10. + - ssidName (string): Filter results by ssid name + - usageUplink (string): Filter results by usage uplink + - t0 (string): The beginning of the timespan for the data. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 186 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 25 minutes and be less than or equal to 186 days. The default is 1 day. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['organizations', 'monitor', 'summary', 'top', 'applications', 'categories', 'byUsage'], + 'operation': 'getOrganizationSummaryTopApplicationsCategoriesByUsage' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/summary/top/applications/categories/byUsage' + + query_params = ['networkTag', 'deviceTag', 'networkId', 'quantity', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} return self._session.get(metadata, resource, params) @@ -3920,9 +4025,15 @@ def getOrganizationSummaryTopClientsByUsage(self, organizationId: str, **kwargs) https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-top-clients-by-usage - organizationId (string): Organization ID + - networkTag (string): Match result to an exact network tag + - deviceTag (string): Match result to an exact device tag + - networkId (string): Match result to an exact network id + - quantity (integer): Set number of desired results to return. Default is 10. + - ssidName (string): Filter results by ssid name + - usageUplink (string): Filter results by usage uplink - t0 (string): The beginning of the timespan for the data. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 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 8 hours and be less than or equal to 31 days. The default is 1 day. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 186 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 8 hours and be less than or equal to 186 days. The default is 1 day. """ kwargs.update(locals()) @@ -3934,7 +4045,7 @@ def getOrganizationSummaryTopClientsByUsage(self, organizationId: str, **kwargs) organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/summary/top/clients/byUsage' - query_params = ['t0', 't1', 'timespan', ] + query_params = ['networkTag', 'deviceTag', 'networkId', 'quantity', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} return self._session.get(metadata, resource, params) @@ -3947,9 +4058,15 @@ def getOrganizationSummaryTopClientsManufacturersByUsage(self, organizationId: s https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-top-clients-manufacturers-by-usage - organizationId (string): Organization ID + - networkTag (string): Match result to an exact network tag + - deviceTag (string): Match result to an exact device tag + - networkId (string): Match result to an exact network id + - quantity (integer): Set number of desired results to return. Default is 10. + - ssidName (string): Filter results by ssid name + - usageUplink (string): Filter results by usage uplink - t0 (string): The beginning of the timespan for the data. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 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 less than or equal to 31 days. The default is 1 day. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 186 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 less than or equal to 186 days. The default is 1 day. """ kwargs.update(locals()) @@ -3961,7 +4078,7 @@ def getOrganizationSummaryTopClientsManufacturersByUsage(self, organizationId: s organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/summary/top/clients/manufacturers/byUsage' - query_params = ['t0', 't1', 'timespan', ] + query_params = ['networkTag', 'deviceTag', 'networkId', 'quantity', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} return self._session.get(metadata, resource, params) @@ -3974,9 +4091,15 @@ def getOrganizationSummaryTopDevicesByUsage(self, organizationId: str, **kwargs) https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-top-devices-by-usage - organizationId (string): Organization ID + - networkTag (string): Match result to an exact network tag + - deviceTag (string): Match result to an exact device tag + - networkId (string): Match result to an exact network id + - quantity (integer): Set number of desired results to return. Default is 10. + - ssidName (string): Filter results by ssid name + - usageUplink (string): Filter results by usage uplink - t0 (string): The beginning of the timespan for the data. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 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 8 hours and be less than or equal to 31 days. The default is 1 day. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 186 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 8 hours and be less than or equal to 186 days. The default is 1 day. """ kwargs.update(locals()) @@ -3988,7 +4111,7 @@ def getOrganizationSummaryTopDevicesByUsage(self, organizationId: str, **kwargs) organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/summary/top/devices/byUsage' - query_params = ['t0', 't1', 'timespan', ] + query_params = ['networkTag', 'deviceTag', 'networkId', 'quantity', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} return self._session.get(metadata, resource, params) @@ -4001,9 +4124,15 @@ def getOrganizationSummaryTopDevicesModelsByUsage(self, organizationId: str, **k https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-top-devices-models-by-usage - organizationId (string): Organization ID + - networkTag (string): Match result to an exact network tag + - deviceTag (string): Match result to an exact device tag + - networkId (string): Match result to an exact network id + - quantity (integer): Set number of desired results to return. Default is 10. + - ssidName (string): Filter results by ssid name + - usageUplink (string): Filter results by usage uplink - t0 (string): The beginning of the timespan for the data. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 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 8 hours and be less than or equal to 31 days. The default is 1 day. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 186 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 8 hours and be less than or equal to 186 days. The default is 1 day. """ kwargs.update(locals()) @@ -4015,7 +4144,7 @@ def getOrganizationSummaryTopDevicesModelsByUsage(self, organizationId: str, **k organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/summary/top/devices/models/byUsage' - query_params = ['t0', 't1', 'timespan', ] + query_params = ['networkTag', 'deviceTag', 'networkId', 'quantity', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} return self._session.get(metadata, resource, params) @@ -4030,6 +4159,12 @@ def getOrganizationSummaryTopNetworksByStatus(self, organizationId: str, total_p - organizationId (string): Organization ID - 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" (default) or "prev" page + - networkTag (string): Match result to an exact network tag + - deviceTag (string): Match result to an exact device tag + - networkId (string): Match result to an exact network id + - quantity (integer): Set number of desired results to return. Default is 10. + - ssidName (string): Filter results by ssid name + - usageUplink (string): Filter results by usage uplink - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 5000. - 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. @@ -4044,7 +4179,7 @@ def getOrganizationSummaryTopNetworksByStatus(self, organizationId: str, total_p organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/summary/top/networks/byStatus' - query_params = ['perPage', 'startingAfter', 'endingBefore', ] + query_params = ['networkTag', 'deviceTag', 'networkId', 'quantity', 'ssidName', 'usageUplink', 'perPage', 'startingAfter', 'endingBefore', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} return self._session.get_pages(metadata, resource, params, total_pages, direction) @@ -4057,9 +4192,15 @@ def getOrganizationSummaryTopSsidsByUsage(self, organizationId: str, **kwargs): https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-top-ssids-by-usage - organizationId (string): Organization ID + - networkTag (string): Match result to an exact network tag + - deviceTag (string): Match result to an exact device tag + - networkId (string): Match result to an exact network id + - quantity (integer): Set number of desired results to return. Default is 10. + - ssidName (string): Filter results by ssid name + - usageUplink (string): Filter results by usage uplink - t0 (string): The beginning of the timespan for the data. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 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 8 hours and be less than or equal to 31 days. The default is 1 day. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 186 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 8 hours and be less than or equal to 186 days. The default is 1 day. """ kwargs.update(locals()) @@ -4071,7 +4212,7 @@ def getOrganizationSummaryTopSsidsByUsage(self, organizationId: str, **kwargs): organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/summary/top/ssids/byUsage' - query_params = ['t0', 't1', 'timespan', ] + query_params = ['networkTag', 'deviceTag', 'networkId', 'quantity', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} return self._session.get(metadata, resource, params) @@ -4084,9 +4225,15 @@ def getOrganizationSummaryTopSwitchesByEnergyUsage(self, organizationId: str, ** https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-top-switches-by-energy-usage - organizationId (string): Organization ID + - networkTag (string): Match result to an exact network tag + - deviceTag (string): Match result to an exact device tag + - networkId (string): Match result to an exact network id + - quantity (integer): Set number of desired results to return. Default is 10. + - ssidName (string): Filter results by ssid name + - usageUplink (string): Filter results by usage uplink - t0 (string): The beginning of the timespan for the data. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 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 25 minutes and be less than or equal to 31 days. The default is 1 day. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 186 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 25 minutes and be less than or equal to 186 days. The default is 1 day. """ kwargs.update(locals()) @@ -4098,7 +4245,7 @@ def getOrganizationSummaryTopSwitchesByEnergyUsage(self, organizationId: str, ** organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/summary/top/switches/byEnergyUsage' - query_params = ['t0', 't1', 'timespan', ] + query_params = ['networkTag', 'deviceTag', 'networkId', 'quantity', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} return self._session.get(metadata, resource, params) diff --git a/meraki/api/switch.py b/meraki/api/switch.py index 429ace25..f8c0652d 100644 --- a/meraki/api/switch.py +++ b/meraki/api/switch.py @@ -157,6 +157,7 @@ def updateDeviceSwitchPort(self, serial: str, portId: str, **kwargs): - flexibleStackingEnabled (boolean): For supported switches (e.g. MS420/MS425), whether or not the port has flexible stacking enabled. - daiTrusted (boolean): If true, ARP packets for this port will be considered trusted, and Dynamic ARP Inspection will allow the traffic. - profile (object): Profile attributes + - dot3az (object): dot3az settings for the port """ kwargs.update(locals()) @@ -182,7 +183,7 @@ def updateDeviceSwitchPort(self, serial: str, portId: str, **kwargs): portId = urllib.parse.quote(str(portId), safe='') resource = f'/devices/{serial}/switch/ports/{portId}' - body_params = ['name', 'tags', 'enabled', 'poeEnabled', 'type', 'vlan', 'voiceVlan', 'allowedVlans', 'isolationEnabled', 'rstpEnabled', 'stpGuard', 'linkNegotiation', 'portScheduleId', 'udld', 'accessPolicyType', 'accessPolicyNumber', 'macAllowList', 'stickyMacAllowList', 'stickyMacAllowListLimit', 'stormControlEnabled', 'adaptivePolicyGroupId', 'peerSgtCapable', 'flexibleStackingEnabled', 'daiTrusted', 'profile', ] + body_params = ['name', 'tags', 'enabled', 'poeEnabled', 'type', 'vlan', 'voiceVlan', 'allowedVlans', 'isolationEnabled', 'rstpEnabled', 'stpGuard', 'linkNegotiation', 'portScheduleId', 'udld', 'accessPolicyType', 'accessPolicyNumber', 'macAllowList', 'stickyMacAllowList', 'stickyMacAllowListLimit', 'stormControlEnabled', 'adaptivePolicyGroupId', 'peerSgtCapable', 'flexibleStackingEnabled', 'daiTrusted', 'profile', 'dot3az', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} return self._session.put(metadata, resource, payload) @@ -2436,6 +2437,7 @@ def updateOrganizationConfigTemplateSwitchProfilePort(self, organizationId: str, - flexibleStackingEnabled (boolean): For supported switches (e.g. MS420/MS425), whether or not the port has flexible stacking enabled. - daiTrusted (boolean): If true, ARP packets for this port will be considered trusted, and Dynamic ARP Inspection will allow the traffic. - profile (object): Profile attributes + - dot3az (object): dot3az settings for the port """ kwargs.update(locals()) @@ -2463,7 +2465,7 @@ def updateOrganizationConfigTemplateSwitchProfilePort(self, organizationId: str, portId = urllib.parse.quote(str(portId), safe='') resource = f'/organizations/{organizationId}/configTemplates/{configTemplateId}/switch/profiles/{profileId}/ports/{portId}' - body_params = ['name', 'tags', 'enabled', 'poeEnabled', 'type', 'vlan', 'voiceVlan', 'allowedVlans', 'isolationEnabled', 'rstpEnabled', 'stpGuard', 'linkNegotiation', 'portScheduleId', 'udld', 'accessPolicyType', 'accessPolicyNumber', 'macAllowList', 'stickyMacAllowList', 'stickyMacAllowListLimit', 'stormControlEnabled', 'flexibleStackingEnabled', 'daiTrusted', 'profile', ] + body_params = ['name', 'tags', 'enabled', 'poeEnabled', 'type', 'vlan', 'voiceVlan', 'allowedVlans', 'isolationEnabled', 'rstpEnabled', 'stpGuard', 'linkNegotiation', 'portScheduleId', 'udld', 'accessPolicyType', 'accessPolicyNumber', 'macAllowList', 'stickyMacAllowList', 'stickyMacAllowListLimit', 'stormControlEnabled', 'flexibleStackingEnabled', 'daiTrusted', 'profile', 'dot3az', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} return self._session.put(metadata, resource, payload) @@ -2477,8 +2479,8 @@ def getOrganizationSummarySwitchPowerHistory(self, organizationId: str, **kwargs - organizationId (string): Organization ID - t0 (string): The beginning of the timespan for the data. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 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 less than or equal to 31 days. The default is 1 day. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 186 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 less than or equal to 186 days. The default is 1 day. """ kwargs.update(locals()) @@ -2534,14 +2536,14 @@ def getOrganizationSwitchPortsBySwitch(self, organizationId: str, total_pages=1, - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 50. Default is 50. - 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. - - networkIds (array): Optional parameter to filter switchports by network. - - portProfileIds (array): Optional parameter to filter switchports belonging to the specified port profiles. - - name (string): Optional parameter to filter switchports belonging to switches by name. All returned switches will have a name that contains the search term or is an exact match. - - mac (string): Optional parameter to filter switchports belonging to switches by MAC address. All returned switches will have a MAC address that contains the search term or is an exact match. - - macs (array): Optional parameter to filter switchports by one or more MAC addresses belonging to devices. All switchports returned belong to MAC addresses of switches that are an exact match. - - serial (string): Optional parameter to filter switchports belonging to switches by serial number. All returned switches will have a serial number that contains the search term or is an exact match. - - serials (array): Optional parameter to filter switchports belonging to switches with one or more serial numbers. All switchports returned belong to serial numbers of switches that are an exact match. - - configurationUpdatedAfter (string): Optional parameter to filter results by switches where the configuration has been updated after the given timestamp. + - configurationUpdatedAfter (string): Optional parameter to filter items to switches where the configuration has been updated after the given timestamp. + - mac (string): Optional parameter to filter items to switches with MAC addresses that contain the search term or are an exact match. + - macs (array): Optional parameter to filter items to switches that have one of the provided MAC addresses. + - name (string): Optional parameter to filter items to switches with names that contain the search term or are an exact match. + - networkIds (array): Optional parameter to filter items to switches in one of the provided networks. + - portProfileIds (array): Optional parameter to filter items to switches that contain switchports belonging to one of the specified port profiles. + - serial (string): Optional parameter to filter items to switches with serial number that contains the search term or are an exact match. + - serials (array): Optional parameter to filter items to switches that have one of the provided serials. """ kwargs.update(locals()) @@ -2553,10 +2555,10 @@ def getOrganizationSwitchPortsBySwitch(self, organizationId: str, total_pages=1, organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/switch/ports/bySwitch' - query_params = ['perPage', 'startingAfter', 'endingBefore', 'networkIds', 'portProfileIds', 'name', 'mac', 'macs', 'serial', 'serials', 'configurationUpdatedAfter', ] + query_params = ['perPage', 'startingAfter', 'endingBefore', 'configurationUpdatedAfter', 'mac', 'macs', 'name', 'networkIds', 'portProfileIds', 'serial', 'serials', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - array_params = ['networkIds', 'portProfileIds', 'macs', 'serials', ] + array_params = ['macs', 'networkIds', 'portProfileIds', 'serials', ] for k, v in kwargs.items(): if k.strip() in array_params: params[f'{k.strip()}[]'] = kwargs[f'{k}'] @@ -2573,8 +2575,8 @@ def getOrganizationSwitchPortsOverview(self, organizationId: str, **kwargs): - organizationId (string): Organization ID - t0 (string): The beginning of the timespan for the data. - - t1 (string): The end of the timespan for the data. t1 can be a maximum of 31 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 12 hours and be less than or equal to 31 days. The default is 1 day. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 186 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 12 hours and be less than or equal to 186 days. The default is 1 day. """ kwargs.update(locals()) diff --git a/meraki/api/wireless.py b/meraki/api/wireless.py index 89d31b35..4ec9a821 100644 --- a/meraki/api/wireless.py +++ b/meraki/api/wireless.py @@ -114,6 +114,51 @@ def getDeviceWirelessConnectionStats(self, serial: str, **kwargs): + def getDeviceWirelessElectronicShelfLabel(self, serial: str): + """ + **Return the ESL settings of a device** + https://developer.cisco.com/meraki/api-v1/#!get-device-wireless-electronic-shelf-label + + - serial (string): Serial + """ + + metadata = { + 'tags': ['wireless', 'configure', 'electronicShelfLabel'], + 'operation': 'getDeviceWirelessElectronicShelfLabel' + } + serial = urllib.parse.quote(str(serial), safe='') + resource = f'/devices/{serial}/wireless/electronicShelfLabel' + + return self._session.get(metadata, resource) + + + + def updateDeviceWirelessElectronicShelfLabel(self, serial: str, **kwargs): + """ + **Update the ESL settings of a device** + https://developer.cisco.com/meraki/api-v1/#!update-device-wireless-electronic-shelf-label + + - serial (string): Serial + - channel (string): Desired ESL channel for the device, or 'Auto' (case insensitive) to use the recommended channel + - enabled (boolean): Turn ESL features on and off for this device + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'configure', 'electronicShelfLabel'], + 'operation': 'updateDeviceWirelessElectronicShelfLabel' + } + serial = urllib.parse.quote(str(serial), safe='') + resource = f'/devices/{serial}/wireless/electronicShelfLabel' + + body_params = ['channel', 'enabled', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.put(metadata, resource, payload) + + + def getDeviceWirelessLatencyStats(self, serial: str, **kwargs): """ **Aggregated latency info for a given AP on this network** @@ -945,6 +990,70 @@ def getNetworkWirelessDevicesLatencyStats(self, networkId: str, **kwargs): + def getNetworkWirelessElectronicShelfLabel(self, networkId: str): + """ + **Return the ESL settings of a wireless network** + https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-electronic-shelf-label + + - networkId (string): Network ID + """ + + metadata = { + 'tags': ['wireless', 'configure', 'electronicShelfLabel'], + 'operation': 'getNetworkWirelessElectronicShelfLabel' + } + networkId = urllib.parse.quote(str(networkId), safe='') + resource = f'/networks/{networkId}/wireless/electronicShelfLabel' + + return self._session.get(metadata, resource) + + + + def updateNetworkWirelessElectronicShelfLabel(self, networkId: str, **kwargs): + """ + **Update the ESL settings of a wireless network** + https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-electronic-shelf-label + + - networkId (string): Network ID + - hostname (string): Desired ESL hostname of the network + - enabled (boolean): Turn ESL features on and off for this network + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'configure', 'electronicShelfLabel'], + 'operation': 'updateNetworkWirelessElectronicShelfLabel' + } + networkId = urllib.parse.quote(str(networkId), safe='') + resource = f'/networks/{networkId}/wireless/electronicShelfLabel' + + body_params = ['hostname', 'enabled', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.put(metadata, resource, payload) + + + + def getNetworkWirelessElectronicShelfLabelConfiguredDevices(self, networkId: str): + """ + **Get a list of all ESL eligible devices of a network** + https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-electronic-shelf-label-configured-devices + + - networkId (string): Network ID + """ + + metadata = { + 'tags': ['wireless', 'configure', 'electronicShelfLabel', 'configuredDevices'], + 'operation': 'getNetworkWirelessElectronicShelfLabelConfiguredDevices' + } + networkId = urllib.parse.quote(str(networkId), safe='') + resource = f'/networks/{networkId}/wireless/electronicShelfLabel/configuredDevices' + + return self._session.get(metadata, resource) + + + def getNetworkWirelessEthernetPortsProfiles(self, networkId: str): """ **List the AP port profiles for this network** @@ -1550,14 +1659,14 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): - number (string): Number - name (string): The name of the SSID - enabled (boolean): Whether or not the SSID is enabled - - authMode (string): The association control method for the SSID ('open', 'open-enhanced', 'psk', 'open-with-radius', 'open-with-nac', '8021x-meraki', '8021x-nac', '8021x-radius', '8021x-google', '8021x-localradius', 'ipsk-with-radius', 'ipsk-without-radius' or 'ipsk-with-nac') + - authMode (string): The association control method for the SSID ('open', 'open-enhanced', 'psk', 'open-with-radius', 'open-with-nac', '8021x-meraki', '8021x-nac', '8021x-radius', '8021x-google', '8021x-entra', '8021x-localradius', 'ipsk-with-radius', 'ipsk-without-radius' or 'ipsk-with-nac') - enterpriseAdminAccess (string): Whether or not an SSID is accessible by 'enterprise' administrators ('access disabled' or 'access enabled') - encryptionMode (string): The psk encryption mode for the SSID ('wep' or 'wpa'). This param is only valid if the authMode is 'psk' - psk (string): The passkey for the SSID. This param is only valid if the authMode is 'psk' - wpaEncryptionMode (string): The types of WPA encryption. ('WPA1 only', 'WPA1 and WPA2', 'WPA2 only', 'WPA3 Transition Mode', 'WPA3 only' or 'WPA3 192-bit Security') - dot11w (object): The current setting for Protected Management Frames (802.11w). - dot11r (object): The current setting for 802.11r - - splashPage (string): The type of splash page for the SSID ('None', 'Click-through splash page', 'Billing', 'Password-protected with Meraki RADIUS', 'Password-protected with custom RADIUS', 'Password-protected with Active Directory', 'Password-protected with LDAP', 'SMS authentication', 'Systems Manager Sentry', 'Facebook Wi-Fi', 'Google OAuth', 'Sponsored guest', 'Cisco ISE' or 'Google Apps domain'). This attribute is not supported for template children. + - splashPage (string): The type of splash page for the SSID ('None', 'Click-through splash page', 'Billing', 'Password-protected with Meraki RADIUS', 'Password-protected with custom RADIUS', 'Password-protected with Active Directory', 'Password-protected with LDAP', 'SMS authentication', 'Systems Manager Sentry', 'Facebook Wi-Fi', 'Google OAuth', 'Microsoft Entra ID', 'Sponsored guest', 'Cisco ISE' or 'Google Apps domain'). This attribute is not supported for template children. - splashGuestSponsorDomains (array): Array of valid sponsor email domains for sponsored guest splash type. - oauth (object): The OAuth settings of this SSID. Only valid if splashPage is 'Google OAuth'. - localRadius (object): The current setting for Local Authentication, a built-in RADIUS server on the access point. Only valid if authMode is '8021x-localradius'. @@ -1612,7 +1721,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): kwargs.update(locals()) if 'authMode' in kwargs: - options = ['8021x-google', '8021x-localradius', '8021x-meraki', '8021x-nac', '8021x-radius', 'ipsk-with-nac', 'ipsk-with-radius', 'ipsk-without-radius', 'open', 'open-enhanced', 'open-with-nac', 'open-with-radius', 'psk'] + options = ['8021x-entra', '8021x-google', '8021x-localradius', '8021x-meraki', '8021x-nac', '8021x-radius', 'ipsk-with-nac', 'ipsk-with-radius', 'ipsk-without-radius', 'open', 'open-enhanced', 'open-with-nac', 'open-with-radius', 'psk'] assert kwargs['authMode'] in options, f'''"authMode" cannot be "{kwargs['authMode']}", & must be set to one of: {options}''' if 'enterpriseAdminAccess' in kwargs: options = ['access disabled', 'access enabled'] @@ -1624,7 +1733,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): options = ['WPA1 and WPA2', 'WPA1 only', 'WPA2 only', 'WPA3 192-bit Security', 'WPA3 Transition Mode', 'WPA3 only'] assert kwargs['wpaEncryptionMode'] in options, f'''"wpaEncryptionMode" cannot be "{kwargs['wpaEncryptionMode']}", & must be set to one of: {options}''' if 'splashPage' in kwargs: - options = ['Billing', 'Cisco ISE', 'Click-through splash page', 'Facebook Wi-Fi', 'Google Apps domain', 'Google OAuth', 'None', 'Password-protected with Active Directory', 'Password-protected with LDAP', 'Password-protected with Meraki RADIUS', 'Password-protected with custom RADIUS', 'SMS authentication', 'Sponsored guest', 'Systems Manager Sentry'] + options = ['Billing', 'Cisco ISE', 'Click-through splash page', 'Facebook Wi-Fi', 'Google Apps domain', 'Google OAuth', 'Microsoft Entra ID', 'None', 'Password-protected with Active Directory', 'Password-protected with LDAP', 'Password-protected with Meraki RADIUS', 'Password-protected with custom RADIUS', 'SMS authentication', 'Sponsored guest', 'Systems Manager Sentry'] assert kwargs['splashPage'] in options, f'''"splashPage" cannot be "{kwargs['splashPage']}", & must be set to one of: {options}''' if 'radiusFailoverPolicy' in kwargs: options = ['Allow access', 'Deny access'] @@ -2184,6 +2293,9 @@ def updateNetworkWirelessSsidSplashSettings(self, networkId: str, number: str, * kwargs.update(locals()) + if 'splashTimeout' in kwargs: + options = [30, 60, 120, 240, 480, 720, 1080, 1440, 2880, 5760, 7200, 10080, 20160, 43200, 86400, 129600] + assert kwargs['splashTimeout'] in options, f'''"splashTimeout" cannot be "{kwargs['splashTimeout']}", & must be set to one of: {options}''' if 'controllerDisconnectionBehavior' in kwargs: options = ['default', 'open', 'restricted'] assert kwargs['controllerDisconnectionBehavior'] in options, f'''"controllerDisconnectionBehavior" cannot be "{kwargs['controllerDisconnectionBehavior']}", & must be set to one of: {options}''' @@ -2754,7 +2866,7 @@ def getOrganizationWirelessRfProfilesAssignmentsByDevice(self, organizationId: s - 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. - networkIds (array): Optional parameter to filter devices by network. - - productTypes (array): Optional parameter to filter devices by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, and secureConnect. + - productTypes (array): Optional parameter to filter devices by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, wirelessController, and secureConnect. - name (string): Optional parameter to filter RF profiles by device name. All returned devices will have a name that contains the search term or is an exact match. - mac (string): Optional parameter to filter RF profiles by device MAC address. All returned devices will have a MAC address that contains the search term or is an exact match. - serial (string): Optional parameter to filter RF profiles by device serial number. All returned devices will have a serial number that contains the search term or is an exact match. @@ -2806,7 +2918,7 @@ def getOrganizationWirelessSsidsStatusesByDevice(self, organizationId: str, tota kwargs.update(locals()) metadata = { - 'tags': ['wireless', 'configure', 'ssids', 'statuses', 'byDevice'], + 'tags': ['wireless', 'monitor', 'ssids', 'statuses', 'byDevice'], 'operation': 'getOrganizationWirelessSsidsStatusesByDevice' } organizationId = urllib.parse.quote(str(organizationId), safe='')