From d140dfc907d384e47c14fb261f1d985e63a3582d Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Wed, 8 Nov 2023 00:12:09 +0000 Subject: [PATCH] Automatically regenerated library. --- meraki/__init__.py | 2 +- meraki/aio/api/devices.py | 6 +- meraki/aio/api/organizations.py | 27 ++++++- meraki/aio/api/sm.py | 7 +- meraki/aio/api/switch.py | 27 +++++++ meraki/aio/api/wireless.py | 126 ++++++++++++++++++++++++++++++++ meraki/api/devices.py | 6 +- meraki/api/organizations.py | 27 ++++++- meraki/api/sm.py | 7 +- meraki/api/switch.py | 27 +++++++ meraki/api/wireless.py | 126 ++++++++++++++++++++++++++++++++ 11 files changed, 373 insertions(+), 15 deletions(-) diff --git a/meraki/__init__.py b/meraki/__init__.py index ab296cee..2d15f7ec 100644 --- a/meraki/__init__.py +++ b/meraki/__init__.py @@ -43,7 +43,7 @@ ) from meraki.rest_session import * -__version__ = '1.38.0' +__version__ = '1.39.0' class DashboardAPI(object): diff --git a/meraki/aio/api/devices.py b/meraki/aio/api/devices.py index 6e33ce6b..25092e51 100644 --- a/meraki/aio/api/devices.py +++ b/meraki/aio/api/devices.py @@ -166,6 +166,7 @@ def createDeviceLiveToolsPing(self, serial: str, target: str, **kwargs): - serial (string): Serial - target (string): FQDN, IPv4 or IPv6 address - count (integer): Count parameter to pass to ping. [1..5], default 5 + - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret """ kwargs.update(locals()) @@ -177,7 +178,7 @@ def createDeviceLiveToolsPing(self, serial: str, target: str, **kwargs): serial = urllib.parse.quote(str(serial), safe='') resource = f'/devices/{serial}/liveTools/ping' - body_params = ['target', 'count', ] + body_params = ['target', 'count', 'callback', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} return self._session.post(metadata, resource, payload) @@ -212,6 +213,7 @@ def createDeviceLiveToolsPingDevice(self, serial: str, **kwargs): - serial (string): Serial - count (integer): Count parameter to pass to ping. [1..5], default 5 + - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret """ kwargs.update(locals()) @@ -223,7 +225,7 @@ def createDeviceLiveToolsPingDevice(self, serial: str, **kwargs): serial = urllib.parse.quote(str(serial), safe='') resource = f'/devices/{serial}/liveTools/pingDevice' - body_params = ['count', ] + body_params = ['count', 'callback', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} return self._session.post(metadata, resource, payload) diff --git a/meraki/aio/api/organizations.py b/meraki/aio/api/organizations.py index c0db1e4c..436dd873 100644 --- a/meraki/aio/api/organizations.py +++ b/meraki/aio/api/organizations.py @@ -123,6 +123,7 @@ def createOrganizationActionBatch(self, organizationId: str, actions: list, **kw - actions (array): A set of changes to make as part of this action (more details) - confirmed (boolean): Set to true for immediate execution. Set to false if the action should be previewed before executing. This property cannot be unset once it is true. Defaults to false. - synchronous (boolean): Set to true to force the batch to run synchronous. There can be at most 20 actions in synchronous batch. Defaults to false. + - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret """ kwargs.update(locals()) @@ -134,7 +135,7 @@ def createOrganizationActionBatch(self, organizationId: str, actions: list, **kw organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/actionBatches' - body_params = ['confirmed', 'synchronous', 'actions', ] + body_params = ['confirmed', 'synchronous', 'actions', 'callback', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} return self._session.post(metadata, resource, payload) @@ -2268,6 +2269,7 @@ def getOrganizationInventoryOnboardingCloudMonitoringNetworks(self, organization - deviceType (string): Device Type switch or wireless controller - 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 + - search (string): Optional parameter to search on network name - 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. @@ -2286,7 +2288,7 @@ def getOrganizationInventoryOnboardingCloudMonitoringNetworks(self, organization organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/inventory/onboarding/cloudMonitoring/networks' - query_params = ['deviceType', 'perPage', 'startingAfter', 'endingBefore', ] + query_params = ['deviceType', 'search', '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) @@ -3597,6 +3599,27 @@ def getOrganizationWebhooksAlertTypes(self, organizationId: str, **kwargs): + def getOrganizationWebhooksCallbacksStatus(self, organizationId: str, callbackId: str): + """ + **Return the status of an API callback** + https://developer.cisco.com/meraki/api-v1/#!get-organization-webhooks-callbacks-status + + - organizationId (string): Organization ID + - callbackId (string): Callback ID + """ + + metadata = { + 'tags': ['organizations', 'configure', 'webhooks', 'callbacks', 'statuses'], + 'operation': 'getOrganizationWebhooksCallbacksStatus' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + callbackId = urllib.parse.quote(str(callbackId), safe='') + resource = f'/organizations/{organizationId}/webhooks/callbacks/statuses/{callbackId}' + + return self._session.get(metadata, resource) + + + def getOrganizationWebhooksLogs(self, organizationId: str, total_pages=1, direction='next', **kwargs): """ **Return the log of webhook POSTs sent** diff --git a/meraki/aio/api/sm.py b/meraki/aio/api/sm.py index f2e9cee4..7ea3cee8 100644 --- a/meraki/aio/api/sm.py +++ b/meraki/aio/api/sm.py @@ -72,6 +72,7 @@ def getNetworkSmDevices(self, networkId: str, total_pages=1, direction='next', * - wifiMacs (array): Filter devices by wifi mac(s). - serials (array): Filter devices by serial(s). - ids (array): Filter devices by id(s). + - uuids (array): Filter devices by uuid(s). - scope (array): Specify a scope (one of all, none, withAny, withAll, withoutAny, or withoutAll) and a set of tags. - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. 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. @@ -87,10 +88,10 @@ def getNetworkSmDevices(self, networkId: str, total_pages=1, direction='next', * networkId = urllib.parse.quote(str(networkId), safe='') resource = f'/networks/{networkId}/sm/devices' - query_params = ['fields', 'wifiMacs', 'serials', 'ids', 'scope', 'perPage', 'startingAfter', 'endingBefore', ] + query_params = ['fields', 'wifiMacs', 'serials', 'ids', 'uuids', 'scope', 'perPage', 'startingAfter', 'endingBefore', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - array_params = ['fields', 'wifiMacs', 'serials', 'ids', 'scope', ] + array_params = ['fields', 'wifiMacs', 'serials', 'ids', 'uuids', 'scope', ] for k, v in kwargs.items(): if k.strip() in array_params: params[f'{k.strip()}[]'] = kwargs[f'{k}'] @@ -663,7 +664,7 @@ def getNetworkSmDeviceWlanLists(self, networkId: str, deviceId: str): def getNetworkSmProfiles(self, networkId: str): """ - **List all the profiles in the network** + **List all profiles in a network** https://developer.cisco.com/meraki/api-v1/#!get-network-sm-profiles - networkId (string): Network ID diff --git a/meraki/aio/api/switch.py b/meraki/aio/api/switch.py index 209ee468..ad49aab1 100644 --- a/meraki/aio/api/switch.py +++ b/meraki/aio/api/switch.py @@ -2472,6 +2472,33 @@ def updateOrganizationConfigTemplateSwitchProfilePort(self, organizationId: str, + def getOrganizationSummarySwitchPowerHistory(self, organizationId: str, **kwargs): + """ + **Returns the total PoE power draw for all switch ports in the organization over the requested timespan (by default the last 24 hours)** + https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-switch-power-history + + - 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. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['switch', 'monitor', 'summary', 'power', 'history'], + 'operation': 'getOrganizationSummarySwitchPowerHistory' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/summary/switch/power/history' + + query_params = ['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 cloneOrganizationSwitchDevices(self, organizationId: str, sourceSerial: str, targetSerials: list): """ **Clone port-level and some switch-level configuration settings from a source switch to one or more target switches** diff --git a/meraki/aio/api/wireless.py b/meraki/aio/api/wireless.py index 762686c5..df523ec8 100644 --- a/meraki/aio/api/wireless.py +++ b/meraki/aio/api/wireless.py @@ -2429,3 +2429,129 @@ def getOrganizationWirelessDevicesEthernetStatuses(self, organizationId: str, to return self._session.get_pages(metadata, resource, params, total_pages, direction) + + + def getOrganizationWirelessDevicesPacketLossByClient(self, organizationId: str, total_pages=1, direction='next', **kwargs): + """ + **Get average packet loss for the given timespan for all clients in the organization.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-packet-loss-by-client + + - 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 + - networkIds (array): Filter results by network. + - ssids (array): Filter results by SSID number. + - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. + - macs (array): Filter results by client mac address(es). + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. 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. + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 90 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 90 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 5 minutes and be less than or equal to 90 days. The default is 7 days. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'monitor', 'devices', 'packetLoss', 'byClient'], + 'operation': 'getOrganizationWirelessDevicesPacketLossByClient' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/wireless/devices/packetLoss/byClient' + + query_params = ['networkIds', 'ssids', 'bands', 'macs', 'perPage', 'startingAfter', 'endingBefore', 't0', 't1', 'timespan', ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = ['networkIds', 'ssids', 'bands', 'macs', ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f'{k.strip()}[]'] = kwargs[f'{k}'] + params.pop(k.strip()) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + + + def getOrganizationWirelessDevicesPacketLossByDevice(self, organizationId: str, total_pages=1, direction='next', **kwargs): + """ + **Get average packet loss for the given timespan for all devices in the organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-packet-loss-by-device + + - 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 + - networkIds (array): Filter results by network. + - serials (array): Filter results by device. + - ssids (array): Filter results by SSID number. + - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. 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. + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 90 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 90 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 5 minutes and be less than or equal to 90 days. The default is 7 days. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'monitor', 'devices', 'packetLoss', 'byDevice'], + 'operation': 'getOrganizationWirelessDevicesPacketLossByDevice' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/wireless/devices/packetLoss/byDevice' + + query_params = ['networkIds', 'serials', 'ssids', 'bands', 'perPage', 'startingAfter', 'endingBefore', 't0', 't1', 'timespan', ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = ['networkIds', 'serials', 'ssids', 'bands', ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f'{k.strip()}[]'] = kwargs[f'{k}'] + params.pop(k.strip()) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + + + def getOrganizationWirelessDevicesPacketLossByNetwork(self, organizationId: str, total_pages=1, direction='next', **kwargs): + """ + **Get average packet loss for the given timespan for all networks in the organization.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-packet-loss-by-network + + - 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 + - networkIds (array): Filter results by network. + - serials (array): Filter results by device. + - ssids (array): Filter results by SSID number. + - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. 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. + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 90 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 90 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 5 minutes and be less than or equal to 90 days. The default is 7 days. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'monitor', 'devices', 'packetLoss', 'byNetwork'], + 'operation': 'getOrganizationWirelessDevicesPacketLossByNetwork' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/wireless/devices/packetLoss/byNetwork' + + query_params = ['networkIds', 'serials', 'ssids', 'bands', 'perPage', 'startingAfter', 'endingBefore', 't0', 't1', 'timespan', ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = ['networkIds', 'serials', 'ssids', 'bands', ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f'{k.strip()}[]'] = kwargs[f'{k}'] + params.pop(k.strip()) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + diff --git a/meraki/api/devices.py b/meraki/api/devices.py index 2e3976d0..874a031b 100644 --- a/meraki/api/devices.py +++ b/meraki/api/devices.py @@ -166,6 +166,7 @@ def createDeviceLiveToolsPing(self, serial: str, target: str, **kwargs): - serial (string): Serial - target (string): FQDN, IPv4 or IPv6 address - count (integer): Count parameter to pass to ping. [1..5], default 5 + - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret """ kwargs.update(locals()) @@ -177,7 +178,7 @@ def createDeviceLiveToolsPing(self, serial: str, target: str, **kwargs): serial = urllib.parse.quote(str(serial), safe='') resource = f'/devices/{serial}/liveTools/ping' - body_params = ['target', 'count', ] + body_params = ['target', 'count', 'callback', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} return self._session.post(metadata, resource, payload) @@ -212,6 +213,7 @@ def createDeviceLiveToolsPingDevice(self, serial: str, **kwargs): - serial (string): Serial - count (integer): Count parameter to pass to ping. [1..5], default 5 + - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret """ kwargs.update(locals()) @@ -223,7 +225,7 @@ def createDeviceLiveToolsPingDevice(self, serial: str, **kwargs): serial = urllib.parse.quote(str(serial), safe='') resource = f'/devices/{serial}/liveTools/pingDevice' - body_params = ['count', ] + body_params = ['count', 'callback', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} return self._session.post(metadata, resource, payload) diff --git a/meraki/api/organizations.py b/meraki/api/organizations.py index a2055231..d00caa54 100644 --- a/meraki/api/organizations.py +++ b/meraki/api/organizations.py @@ -123,6 +123,7 @@ def createOrganizationActionBatch(self, organizationId: str, actions: list, **kw - actions (array): A set of changes to make as part of this action (more details) - confirmed (boolean): Set to true for immediate execution. Set to false if the action should be previewed before executing. This property cannot be unset once it is true. Defaults to false. - synchronous (boolean): Set to true to force the batch to run synchronous. There can be at most 20 actions in synchronous batch. Defaults to false. + - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret """ kwargs.update(locals()) @@ -134,7 +135,7 @@ def createOrganizationActionBatch(self, organizationId: str, actions: list, **kw organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/actionBatches' - body_params = ['confirmed', 'synchronous', 'actions', ] + body_params = ['confirmed', 'synchronous', 'actions', 'callback', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} return self._session.post(metadata, resource, payload) @@ -2268,6 +2269,7 @@ def getOrganizationInventoryOnboardingCloudMonitoringNetworks(self, organization - deviceType (string): Device Type switch or wireless controller - 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 + - search (string): Optional parameter to search on network name - 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. @@ -2286,7 +2288,7 @@ def getOrganizationInventoryOnboardingCloudMonitoringNetworks(self, organization organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/inventory/onboarding/cloudMonitoring/networks' - query_params = ['deviceType', 'perPage', 'startingAfter', 'endingBefore', ] + query_params = ['deviceType', 'search', '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) @@ -3597,6 +3599,27 @@ def getOrganizationWebhooksAlertTypes(self, organizationId: str, **kwargs): + def getOrganizationWebhooksCallbacksStatus(self, organizationId: str, callbackId: str): + """ + **Return the status of an API callback** + https://developer.cisco.com/meraki/api-v1/#!get-organization-webhooks-callbacks-status + + - organizationId (string): Organization ID + - callbackId (string): Callback ID + """ + + metadata = { + 'tags': ['organizations', 'configure', 'webhooks', 'callbacks', 'statuses'], + 'operation': 'getOrganizationWebhooksCallbacksStatus' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + callbackId = urllib.parse.quote(str(callbackId), safe='') + resource = f'/organizations/{organizationId}/webhooks/callbacks/statuses/{callbackId}' + + return self._session.get(metadata, resource) + + + def getOrganizationWebhooksLogs(self, organizationId: str, total_pages=1, direction='next', **kwargs): """ **Return the log of webhook POSTs sent** diff --git a/meraki/api/sm.py b/meraki/api/sm.py index bea94079..4f6db685 100644 --- a/meraki/api/sm.py +++ b/meraki/api/sm.py @@ -72,6 +72,7 @@ def getNetworkSmDevices(self, networkId: str, total_pages=1, direction='next', * - wifiMacs (array): Filter devices by wifi mac(s). - serials (array): Filter devices by serial(s). - ids (array): Filter devices by id(s). + - uuids (array): Filter devices by uuid(s). - scope (array): Specify a scope (one of all, none, withAny, withAll, withoutAny, or withoutAll) and a set of tags. - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. 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. @@ -87,10 +88,10 @@ def getNetworkSmDevices(self, networkId: str, total_pages=1, direction='next', * networkId = urllib.parse.quote(str(networkId), safe='') resource = f'/networks/{networkId}/sm/devices' - query_params = ['fields', 'wifiMacs', 'serials', 'ids', 'scope', 'perPage', 'startingAfter', 'endingBefore', ] + query_params = ['fields', 'wifiMacs', 'serials', 'ids', 'uuids', 'scope', 'perPage', 'startingAfter', 'endingBefore', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} - array_params = ['fields', 'wifiMacs', 'serials', 'ids', 'scope', ] + array_params = ['fields', 'wifiMacs', 'serials', 'ids', 'uuids', 'scope', ] for k, v in kwargs.items(): if k.strip() in array_params: params[f'{k.strip()}[]'] = kwargs[f'{k}'] @@ -663,7 +664,7 @@ def getNetworkSmDeviceWlanLists(self, networkId: str, deviceId: str): def getNetworkSmProfiles(self, networkId: str): """ - **List all the profiles in the network** + **List all profiles in a network** https://developer.cisco.com/meraki/api-v1/#!get-network-sm-profiles - networkId (string): Network ID diff --git a/meraki/api/switch.py b/meraki/api/switch.py index ba6e036f..8902a3e3 100644 --- a/meraki/api/switch.py +++ b/meraki/api/switch.py @@ -2472,6 +2472,33 @@ def updateOrganizationConfigTemplateSwitchProfilePort(self, organizationId: str, + def getOrganizationSummarySwitchPowerHistory(self, organizationId: str, **kwargs): + """ + **Returns the total PoE power draw for all switch ports in the organization over the requested timespan (by default the last 24 hours)** + https://developer.cisco.com/meraki/api-v1/#!get-organization-summary-switch-power-history + + - 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. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['switch', 'monitor', 'summary', 'power', 'history'], + 'operation': 'getOrganizationSummarySwitchPowerHistory' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/summary/switch/power/history' + + query_params = ['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 cloneOrganizationSwitchDevices(self, organizationId: str, sourceSerial: str, targetSerials: list): """ **Clone port-level and some switch-level configuration settings from a source switch to one or more target switches** diff --git a/meraki/api/wireless.py b/meraki/api/wireless.py index 9db3b63e..06041097 100644 --- a/meraki/api/wireless.py +++ b/meraki/api/wireless.py @@ -2429,3 +2429,129 @@ def getOrganizationWirelessDevicesEthernetStatuses(self, organizationId: str, to return self._session.get_pages(metadata, resource, params, total_pages, direction) + + + def getOrganizationWirelessDevicesPacketLossByClient(self, organizationId: str, total_pages=1, direction='next', **kwargs): + """ + **Get average packet loss for the given timespan for all clients in the organization.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-packet-loss-by-client + + - 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 + - networkIds (array): Filter results by network. + - ssids (array): Filter results by SSID number. + - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. + - macs (array): Filter results by client mac address(es). + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. 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. + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 90 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 90 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 5 minutes and be less than or equal to 90 days. The default is 7 days. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'monitor', 'devices', 'packetLoss', 'byClient'], + 'operation': 'getOrganizationWirelessDevicesPacketLossByClient' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/wireless/devices/packetLoss/byClient' + + query_params = ['networkIds', 'ssids', 'bands', 'macs', 'perPage', 'startingAfter', 'endingBefore', 't0', 't1', 'timespan', ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = ['networkIds', 'ssids', 'bands', 'macs', ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f'{k.strip()}[]'] = kwargs[f'{k}'] + params.pop(k.strip()) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + + + def getOrganizationWirelessDevicesPacketLossByDevice(self, organizationId: str, total_pages=1, direction='next', **kwargs): + """ + **Get average packet loss for the given timespan for all devices in the organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-packet-loss-by-device + + - 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 + - networkIds (array): Filter results by network. + - serials (array): Filter results by device. + - ssids (array): Filter results by SSID number. + - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. 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. + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 90 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 90 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 5 minutes and be less than or equal to 90 days. The default is 7 days. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'monitor', 'devices', 'packetLoss', 'byDevice'], + 'operation': 'getOrganizationWirelessDevicesPacketLossByDevice' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/wireless/devices/packetLoss/byDevice' + + query_params = ['networkIds', 'serials', 'ssids', 'bands', 'perPage', 'startingAfter', 'endingBefore', 't0', 't1', 'timespan', ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = ['networkIds', 'serials', 'ssids', 'bands', ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f'{k.strip()}[]'] = kwargs[f'{k}'] + params.pop(k.strip()) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + + + + def getOrganizationWirelessDevicesPacketLossByNetwork(self, organizationId: str, total_pages=1, direction='next', **kwargs): + """ + **Get average packet loss for the given timespan for all networks in the organization.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-packet-loss-by-network + + - 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 + - networkIds (array): Filter results by network. + - serials (array): Filter results by device. + - ssids (array): Filter results by SSID number. + - bands (array): Filter results by band. Valid bands are: 2.4, 5, and 6. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. 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. + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 90 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 90 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 5 minutes and be less than or equal to 90 days. The default is 7 days. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'monitor', 'devices', 'packetLoss', 'byNetwork'], + 'operation': 'getOrganizationWirelessDevicesPacketLossByNetwork' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/wireless/devices/packetLoss/byNetwork' + + query_params = ['networkIds', 'serials', 'ssids', 'bands', 'perPage', 'startingAfter', 'endingBefore', 't0', 't1', 'timespan', ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = ['networkIds', 'serials', 'ssids', 'bands', ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f'{k.strip()}[]'] = kwargs[f'{k}'] + params.pop(k.strip()) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) +