From 2e1684343395ca9434461505834766270f9b28f6 Mon Sep 17 00:00:00 2001 From: "John M. Kuchta" Date: Wed, 7 Aug 2024 17:38:34 -0700 Subject: [PATCH] Automatically regenerated library to version 1.49.0. (#265) Co-authored-by: GitHub Action --- meraki/__init__.py | 2 +- meraki/aio/api/administered.py | 53 +++++++++++++++++++++++++++++ meraki/aio/api/devices.py | 2 +- meraki/aio/api/organizations.py | 59 +++++++++++++++++++-------------- meraki/aio/api/sm.py | 6 ++-- meraki/aio/api/switch.py | 6 ++-- meraki/aio/api/wireless.py | 10 ++++-- meraki/api/administered.py | 53 +++++++++++++++++++++++++++++ meraki/api/batch/switch.py | 6 ++-- meraki/api/batch/wireless.py | 6 ++-- meraki/api/devices.py | 2 +- meraki/api/organizations.py | 59 +++++++++++++++++++-------------- meraki/api/sm.py | 6 ++-- meraki/api/switch.py | 6 ++-- meraki/api/wireless.py | 10 ++++-- 15 files changed, 215 insertions(+), 71 deletions(-) diff --git a/meraki/__init__.py b/meraki/__init__.py index 729278e4..e57589a8 100644 --- a/meraki/__init__.py +++ b/meraki/__init__.py @@ -44,7 +44,7 @@ ) from meraki.rest_session import * -__version__ = '1.48.0' +__version__ = '1.49.0' class DashboardAPI(object): diff --git a/meraki/aio/api/administered.py b/meraki/aio/api/administered.py index 4b8c655d..4568a92e 100644 --- a/meraki/aio/api/administered.py +++ b/meraki/aio/api/administered.py @@ -23,3 +23,56 @@ def getAdministeredIdentitiesMe(self): return self._session.get(metadata, resource) + + + def getAdministeredIdentitiesMeApiKeys(self): + """ + **List the non-sensitive metadata associated with the API keys that belong to the user** + https://developer.cisco.com/meraki/api-v1/#!get-administered-identities-me-api-keys + + """ + + metadata = { + 'tags': ['administered', 'configure', 'identities', 'me', 'api', 'keys'], + 'operation': 'getAdministeredIdentitiesMeApiKeys' + } + resource = f'/administered/identities/me/api/keys' + + return self._session.get(metadata, resource) + + + + def generateAdministeredIdentitiesMeApiKeys(self): + """ + **Generates an API key for an identity** + https://developer.cisco.com/meraki/api-v1/#!generate-administered-identities-me-api-keys + + """ + + metadata = { + 'tags': ['administered', 'configure', 'identities', 'me', 'api', 'keys'], + 'operation': 'generateAdministeredIdentitiesMeApiKeys' + } + resource = f'/administered/identities/me/api/keys/generate' + + return self._session.post(metadata, resource) + + + + def revokeAdministeredIdentitiesMeApiKeys(self, suffix: str): + """ + **Revokes an identity's API key, using the last four characters of the key** + https://developer.cisco.com/meraki/api-v1/#!revoke-administered-identities-me-api-keys + + - suffix (string): Suffix + """ + + metadata = { + 'tags': ['administered', 'configure', 'identities', 'me', 'api', 'keys'], + 'operation': 'revokeAdministeredIdentitiesMeApiKeys' + } + suffix = urllib.parse.quote(str(suffix), safe='') + resource = f'/administered/identities/me/api/keys/{suffix}/revoke' + + return self._session.post(metadata, resource) + diff --git a/meraki/aio/api/devices.py b/meraki/aio/api/devices.py index ae6e4a5b..4df9309f 100644 --- a/meraki/aio/api/devices.py +++ b/meraki/aio/api/devices.py @@ -211,7 +211,7 @@ def createDeviceLiveToolsCableTest(self, serial: str, ports: list, **kwargs): https://developer.cisco.com/meraki/api-v1/#!create-device-live-tools-cable-test - serial (string): Serial - - ports (array): A list of ports for which to perform the cable test. + - ports (array): A list of ports for which to perform the cable test. For Catalyst switches, IOS interface names are also supported, such as "GigabitEthernet1/0/8", "Gi1/0/8", or even "1/0/8". - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret """ diff --git a/meraki/aio/api/organizations.py b/meraki/aio/api/organizations.py index c55f5181..ace42fad 100644 --- a/meraki/aio/api/organizations.py +++ b/meraki/aio/api/organizations.py @@ -717,7 +717,7 @@ def createOrganizationAdmin(self, organizationId: str, email: str, name: str, or - orgAccess (string): The privilege of the dashboard administrator on the organization. Can be one of 'full', 'read-only', 'enterprise' or 'none' - tags (array): The list of tags that the dashboard administrator has privileges on - networks (array): The list of networks that the dashboard administrator has privileges on - - authenticationMethod (string): The method of authentication the user will use to sign in to the Meraki dashboard. Can be one of 'Email' or 'Cisco SecureX Sign-On'. The default is Email authentication + - authenticationMethod (string): No longer used as of Cisco SecureX end-of-life. Can be one of 'Email'. The default is Email authentication. """ kwargs.update(locals()) @@ -726,7 +726,7 @@ def createOrganizationAdmin(self, organizationId: str, email: str, name: str, or options = ['enterprise', 'full', 'none', 'read-only'] assert kwargs['orgAccess'] in options, f'''"orgAccess" cannot be "{kwargs['orgAccess']}", & must be set to one of: {options}''' if 'authenticationMethod' in kwargs: - options = ['Cisco SecureX Sign-On', 'Email'] + options = ['Email'] assert kwargs['authenticationMethod'] in options, f'''"authenticationMethod" cannot be "{kwargs['authenticationMethod']}", & must be set to one of: {options}''' metadata = { @@ -1126,6 +1126,7 @@ def getOrganizationAssuranceAlertsOverview(self, organizationId: str, **kwargs): - types (array): Optional parameter to filter by alert type. - tsStart (string): Optional parameter to filter by starting timestamp - tsEnd (string): Optional parameter to filter by end timestamp + - category (string): Optional parameter to filter by category. - serials (array): Optional parameter to filter by primary device serial - deviceTypes (array): Optional parameter to filter by device types - deviceTags (array): Optional parameter to filter by device tags @@ -1137,6 +1138,10 @@ def getOrganizationAssuranceAlertsOverview(self, organizationId: str, **kwargs): kwargs.update(locals()) + if 'category' in kwargs: + options = ['configuration', 'connectivity', 'device_health', 'insights'] + assert kwargs['category'] in options, f'''"category" cannot be "{kwargs['category']}", & must be set to one of: {options}''' + metadata = { 'tags': ['organizations', 'monitor', 'alerts', 'overview'], 'operation': 'getOrganizationAssuranceAlertsOverview' @@ -1144,7 +1149,7 @@ def getOrganizationAssuranceAlertsOverview(self, organizationId: str, **kwargs): organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/assurance/alerts/overview' - query_params = ['networkId', 'severity', 'types', 'tsStart', 'tsEnd', 'serials', 'deviceTypes', 'deviceTags', 'active', 'dismissed', 'resolved', 'suppressAlertsForOfflineNodes', ] + query_params = ['networkId', 'severity', 'types', 'tsStart', 'tsEnd', 'category', 'serials', 'deviceTypes', 'deviceTags', 'active', 'dismissed', 'resolved', 'suppressAlertsForOfflineNodes', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = ['types', 'serials', 'deviceTypes', 'deviceTags', ] @@ -1174,6 +1179,7 @@ def getOrganizationAssuranceAlertsOverviewByNetwork(self, organizationId: str, t - types (array): Optional parameter to filter by alert type. - tsStart (string): Optional parameter to filter by starting timestamp - tsEnd (string): Optional parameter to filter by end timestamp + - category (string): Optional parameter to filter by category. - serials (array): Optional parameter to filter by primary device serial - deviceTypes (array): Optional parameter to filter by device types - deviceTags (array): Optional parameter to filter by device tags @@ -1188,6 +1194,9 @@ def getOrganizationAssuranceAlertsOverviewByNetwork(self, organizationId: str, t if 'sortOrder' in kwargs: options = ['ascending', 'descending'] assert kwargs['sortOrder'] in options, f'''"sortOrder" cannot be "{kwargs['sortOrder']}", & must be set to one of: {options}''' + if 'category' in kwargs: + options = ['configuration', 'connectivity', 'device_health', 'insights'] + assert kwargs['category'] in options, f'''"category" cannot be "{kwargs['category']}", & must be set to one of: {options}''' metadata = { 'tags': ['organizations', 'monitor', 'alerts', 'overview', 'byNetwork'], @@ -1196,7 +1205,7 @@ def getOrganizationAssuranceAlertsOverviewByNetwork(self, organizationId: str, t organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/assurance/alerts/overview/byNetwork' - query_params = ['perPage', 'startingAfter', 'endingBefore', 'sortOrder', 'networkId', 'severity', 'types', 'tsStart', 'tsEnd', 'serials', 'deviceTypes', 'deviceTags', 'active', 'dismissed', 'resolved', 'suppressAlertsForOfflineNodes', ] + query_params = ['perPage', 'startingAfter', 'endingBefore', 'sortOrder', 'networkId', 'severity', 'types', 'tsStart', 'tsEnd', 'category', 'serials', 'deviceTypes', 'deviceTags', 'active', 'dismissed', 'resolved', 'suppressAlertsForOfflineNodes', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = ['types', 'serials', 'deviceTypes', 'deviceTags', ] @@ -1226,6 +1235,7 @@ def getOrganizationAssuranceAlertsOverviewByType(self, organizationId: str, tota - types (array): Optional parameter to filter by alert type. - tsStart (string): Optional parameter to filter by starting timestamp - tsEnd (string): Optional parameter to filter by end timestamp + - category (string): Optional parameter to filter by category. - sortBy (string): Optional parameter to set column to sort by. - serials (array): Optional parameter to filter by primary device serial - deviceTypes (array): Optional parameter to filter by device types @@ -1241,6 +1251,9 @@ def getOrganizationAssuranceAlertsOverviewByType(self, organizationId: str, tota if 'sortOrder' in kwargs: options = ['ascending', 'descending'] assert kwargs['sortOrder'] in options, f'''"sortOrder" cannot be "{kwargs['sortOrder']}", & must be set to one of: {options}''' + if 'category' in kwargs: + options = ['configuration', 'connectivity', 'device_health', 'insights'] + assert kwargs['category'] in options, f'''"category" cannot be "{kwargs['category']}", & must be set to one of: {options}''' if 'sortBy' in kwargs: options = ['count', 'lastAlertedAt', 'networkCount', 'severity', 'startedAt'] assert kwargs['sortBy'] in options, f'''"sortBy" cannot be "{kwargs['sortBy']}", & must be set to one of: {options}''' @@ -1252,7 +1265,7 @@ def getOrganizationAssuranceAlertsOverviewByType(self, organizationId: str, tota organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/assurance/alerts/overview/byType' - query_params = ['perPage', 'startingAfter', 'endingBefore', 'sortOrder', 'networkId', 'severity', 'types', 'tsStart', 'tsEnd', 'sortBy', 'serials', 'deviceTypes', 'deviceTags', 'active', 'dismissed', 'resolved', 'suppressAlertsForOfflineNodes', ] + query_params = ['perPage', 'startingAfter', 'endingBefore', 'sortOrder', 'networkId', 'severity', 'types', 'tsStart', 'tsEnd', 'category', 'sortBy', 'serials', 'deviceTypes', 'deviceTags', 'active', 'dismissed', 'resolved', 'suppressAlertsForOfflineNodes', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = ['types', 'serials', 'deviceTypes', 'deviceTags', ] @@ -1277,12 +1290,17 @@ def getOrganizationAssuranceAlertsOverviewHistorical(self, organizationId: str, - severity (string): Optional parameter to filter alerts overview by severity type. - types (array): Optional parameter to filter by alert type. - tsEnd (string): Optional parameter to filter by end timestamp defaults to the current time + - category (string): Optional parameter to filter by category. - serials (array): Optional parameter to filter by primary device serial - deviceTypes (array): Optional parameter to filter by device types """ kwargs.update(locals()) + if 'category' in kwargs: + options = ['configuration', 'connectivity', 'device_health', 'insights'] + assert kwargs['category'] in options, f'''"category" cannot be "{kwargs['category']}", & must be set to one of: {options}''' + metadata = { 'tags': ['organizations', 'monitor', 'alerts', 'overview', 'historical'], 'operation': 'getOrganizationAssuranceAlertsOverviewHistorical' @@ -1290,7 +1308,7 @@ def getOrganizationAssuranceAlertsOverviewHistorical(self, organizationId: str, organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/assurance/alerts/overview/historical' - query_params = ['segmentDuration', 'networkId', 'severity', 'types', 'tsStart', 'tsEnd', 'serials', 'deviceTypes', ] + query_params = ['segmentDuration', 'networkId', 'severity', 'types', 'tsStart', 'tsEnd', 'category', 'serials', 'deviceTypes', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = ['types', 'serials', 'deviceTypes', ] @@ -1558,7 +1576,6 @@ def getOrganizationClientsBandwidthUsageHistory(self, organizationId: str, **kwa - 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. @@ -1575,7 +1592,7 @@ def getOrganizationClientsBandwidthUsageHistory(self, organizationId: str, **kwa organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/clients/bandwidthUsageHistory' - query_params = ['networkTag', 'deviceTag', 'networkId', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] + query_params = ['networkTag', 'deviceTag', '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) @@ -1816,7 +1833,7 @@ def getOrganizationConfigurationChanges(self, organizationId: str, total_pages=1 def getOrganizationDevices(self, organizationId: str, total_pages=1, direction='next', **kwargs): """ - **List the devices in an organization** + **List the devices in an organization that have been assigned to a network.** https://developer.cisco.com/meraki/api-v1/#!get-organization-devices - organizationId (string): Organization ID @@ -3928,7 +3945,6 @@ def getOrganizationSummaryTopAppliancesByUtilization(self, organizationId: str, - 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 @@ -3946,7 +3962,7 @@ def getOrganizationSummaryTopAppliancesByUtilization(self, organizationId: str, organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/summary/top/appliances/byUtilization' - query_params = ['networkTag', 'deviceTag', 'networkId', 'quantity', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] + query_params = ['networkTag', 'deviceTag', '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) @@ -4027,7 +4043,6 @@ def getOrganizationSummaryTopClientsByUsage(self, organizationId: str, **kwargs) - 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 @@ -4045,7 +4060,7 @@ def getOrganizationSummaryTopClientsByUsage(self, organizationId: str, **kwargs) organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/summary/top/clients/byUsage' - query_params = ['networkTag', 'deviceTag', 'networkId', 'quantity', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] + query_params = ['networkTag', 'deviceTag', '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) @@ -4060,7 +4075,6 @@ def getOrganizationSummaryTopClientsManufacturersByUsage(self, organizationId: s - 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 @@ -4078,7 +4092,7 @@ def getOrganizationSummaryTopClientsManufacturersByUsage(self, organizationId: s organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/summary/top/clients/manufacturers/byUsage' - query_params = ['networkTag', 'deviceTag', 'networkId', 'quantity', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] + query_params = ['networkTag', 'deviceTag', '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) @@ -4093,7 +4107,6 @@ def getOrganizationSummaryTopDevicesByUsage(self, organizationId: str, **kwargs) - 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 @@ -4111,7 +4124,7 @@ def getOrganizationSummaryTopDevicesByUsage(self, organizationId: str, **kwargs) organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/summary/top/devices/byUsage' - query_params = ['networkTag', 'deviceTag', 'networkId', 'quantity', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] + query_params = ['networkTag', 'deviceTag', '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) @@ -4126,7 +4139,6 @@ def getOrganizationSummaryTopDevicesModelsByUsage(self, organizationId: str, **k - 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 @@ -4144,7 +4156,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 = ['networkTag', 'deviceTag', 'networkId', 'quantity', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] + query_params = ['networkTag', 'deviceTag', '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) @@ -4161,7 +4173,6 @@ def getOrganizationSummaryTopNetworksByStatus(self, organizationId: str, total_p - 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 @@ -4179,7 +4190,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 = ['networkTag', 'deviceTag', 'networkId', 'quantity', 'ssidName', 'usageUplink', 'perPage', 'startingAfter', 'endingBefore', ] + query_params = ['networkTag', 'deviceTag', '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) @@ -4194,7 +4205,6 @@ def getOrganizationSummaryTopSsidsByUsage(self, organizationId: str, **kwargs): - 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 @@ -4212,7 +4222,7 @@ def getOrganizationSummaryTopSsidsByUsage(self, organizationId: str, **kwargs): organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/summary/top/ssids/byUsage' - query_params = ['networkTag', 'deviceTag', 'networkId', 'quantity', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] + query_params = ['networkTag', 'deviceTag', '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) @@ -4227,7 +4237,6 @@ def getOrganizationSummaryTopSwitchesByEnergyUsage(self, organizationId: str, ** - 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 @@ -4245,7 +4254,7 @@ def getOrganizationSummaryTopSwitchesByEnergyUsage(self, organizationId: str, ** organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/summary/top/switches/byEnergyUsage' - query_params = ['networkTag', 'deviceTag', 'networkId', 'quantity', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] + query_params = ['networkTag', 'deviceTag', '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/sm.py b/meraki/aio/api/sm.py index fa35b8a7..2d0e8886 100644 --- a/meraki/aio/api/sm.py +++ b/meraki/aio/api/sm.py @@ -975,7 +975,7 @@ def getNetworkSmUsers(self, networkId: str, **kwargs): kwargs.update(locals()) metadata = { - 'tags': ['sm', 'configure', 'users'], + 'tags': ['sm', 'configure'], 'operation': 'getNetworkSmUsers' } networkId = urllib.parse.quote(str(networkId), safe='') @@ -1004,7 +1004,7 @@ def getNetworkSmUserDeviceProfiles(self, networkId: str, userId: str): """ metadata = { - 'tags': ['sm', 'configure', 'users', 'deviceProfiles'], + 'tags': ['sm', 'configure', 'deviceProfiles'], 'operation': 'getNetworkSmUserDeviceProfiles' } networkId = urllib.parse.quote(str(networkId), safe='') @@ -1025,7 +1025,7 @@ def getNetworkSmUserSoftwares(self, networkId: str, userId: str): """ metadata = { - 'tags': ['sm', 'configure', 'users', 'softwares'], + 'tags': ['sm', 'configure', 'softwares'], 'operation': 'getNetworkSmUserSoftwares' } networkId = urllib.parse.quote(str(networkId), safe='') diff --git a/meraki/aio/api/switch.py b/meraki/aio/api/switch.py index 596f5174..363c9860 100644 --- a/meraki/aio/api/switch.py +++ b/meraki/aio/api/switch.py @@ -477,6 +477,7 @@ def updateDeviceSwitchRoutingStaticRoute(self, serial: str, staticRouteId: str, - name (string): Name or description for layer 3 static route - subnet (string): The subnet which is routed via this static route and should be specified in CIDR notation (ex. 1.2.3.0/24) - nextHopIp (string): IP address of the next hop device to which the device sends its traffic for the subnet + - managementNextHop (string): Optional fallback IP address for management traffic - advertiseViaOspfEnabled (boolean): Option to advertise static route via OSPF - preferOverOspfRoutesEnabled (boolean): Option to prefer static route over OSPF routes """ @@ -491,7 +492,7 @@ def updateDeviceSwitchRoutingStaticRoute(self, serial: str, staticRouteId: str, staticRouteId = urllib.parse.quote(str(staticRouteId), safe='') resource = f'/devices/{serial}/switch/routing/staticRoutes/{staticRouteId}' - body_params = ['name', 'subnet', 'nextHopIp', 'advertiseViaOspfEnabled', 'preferOverOspfRoutesEnabled', ] + body_params = ['name', 'subnet', 'nextHopIp', 'managementNextHop', 'advertiseViaOspfEnabled', 'preferOverOspfRoutesEnabled', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} return self._session.put(metadata, resource, payload) @@ -2200,6 +2201,7 @@ def updateNetworkSwitchStackRoutingStaticRoute(self, networkId: str, switchStack - name (string): Name or description for layer 3 static route - subnet (string): The subnet which is routed via this static route and should be specified in CIDR notation (ex. 1.2.3.0/24) - nextHopIp (string): IP address of the next hop device to which the device sends its traffic for the subnet + - managementNextHop (string): Optional fallback IP address for management traffic - advertiseViaOspfEnabled (boolean): Option to advertise static route via OSPF - preferOverOspfRoutesEnabled (boolean): Option to prefer static route over OSPF routes """ @@ -2215,7 +2217,7 @@ def updateNetworkSwitchStackRoutingStaticRoute(self, networkId: str, switchStack staticRouteId = urllib.parse.quote(str(staticRouteId), safe='') resource = f'/networks/{networkId}/switch/stacks/{switchStackId}/routing/staticRoutes/{staticRouteId}' - body_params = ['name', 'subnet', 'nextHopIp', 'advertiseViaOspfEnabled', 'preferOverOspfRoutesEnabled', ] + body_params = ['name', 'subnet', 'nextHopIp', 'managementNextHop', 'advertiseViaOspfEnabled', 'preferOverOspfRoutesEnabled', ] 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/wireless.py b/meraki/aio/api/wireless.py index dc947786..f5e376db 100644 --- a/meraki/aio/api/wireless.py +++ b/meraki/aio/api/wireless.py @@ -738,6 +738,7 @@ def getNetworkWirelessClientConnectivityEvents(self, networkId: str, clientId: s - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 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. + - sortOrder (string): Sorted order of entries. Order options are 'ascending' and 'descending'. Default is 'ascending'. - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. - 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. @@ -750,6 +751,9 @@ def getNetworkWirelessClientConnectivityEvents(self, networkId: str, clientId: s kwargs.update(locals()) + if 'sortOrder' in kwargs: + options = ['ascending', 'descending'] + assert kwargs['sortOrder'] in options, f'''"sortOrder" cannot be "{kwargs['sortOrder']}", & must be set to one of: {options}''' if 'band' in kwargs: options = ['2.4', '5', '6'] assert kwargs['band'] in options, f'''"band" cannot be "{kwargs['band']}", & must be set to one of: {options}''' @@ -765,7 +769,7 @@ def getNetworkWirelessClientConnectivityEvents(self, networkId: str, clientId: s clientId = urllib.parse.quote(str(clientId), safe='') resource = f'/networks/{networkId}/wireless/clients/{clientId}/connectivityEvents' - query_params = ['perPage', 'startingAfter', 'endingBefore', 't0', 't1', 'timespan', 'types', 'band', 'ssidNumber', 'includedSeverities', 'deviceSerial', ] + query_params = ['perPage', 'startingAfter', 'endingBefore', 'sortOrder', 't0', 't1', 'timespan', 'types', 'band', 'ssidNumber', 'includedSeverities', 'deviceSerial', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = ['types', 'includedSeverities', ] @@ -1441,6 +1445,8 @@ def updateNetworkWirelessRfProfile(self, networkId: str, rfProfileId: str, **kwa - networkId (string): Network ID - rfProfileId (string): Rf profile ID - name (string): The name of the new profile. Must be unique. + - isIndoorDefault (boolean): Set this profile as the default indoor rf profile. If the profile ID is one of 'indoor' or 'outdoor', then a new profile will be created from the respective ID and set as the default + - isOutdoorDefault (boolean): Set this profile as the default outdoor rf profile. If the profile ID is one of 'indoor' or 'outdoor', then a new profile will be created from the respective ID and set as the default - clientBalancingEnabled (boolean): Steers client to best available access point. Can be either true or false. - minBitrateType (string): Minimum bitrate can be set to either 'band' or 'ssid'. - bandSelectionType (string): Band selection can be set to either 'ssid' or 'ap'. @@ -1470,7 +1476,7 @@ def updateNetworkWirelessRfProfile(self, networkId: str, rfProfileId: str, **kwa rfProfileId = urllib.parse.quote(str(rfProfileId), safe='') resource = f'/networks/{networkId}/wireless/rfProfiles/{rfProfileId}' - body_params = ['name', 'clientBalancingEnabled', 'minBitrateType', 'bandSelectionType', 'apBandSettings', 'twoFourGhzSettings', 'fiveGhzSettings', 'sixGhzSettings', 'transmission', 'perSsidSettings', 'flexRadios', ] + body_params = ['name', 'isIndoorDefault', 'isOutdoorDefault', 'clientBalancingEnabled', 'minBitrateType', 'bandSelectionType', 'apBandSettings', 'twoFourGhzSettings', 'fiveGhzSettings', 'sixGhzSettings', 'transmission', 'perSsidSettings', 'flexRadios', ] 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/administered.py b/meraki/api/administered.py index ad1cf107..68805251 100644 --- a/meraki/api/administered.py +++ b/meraki/api/administered.py @@ -23,3 +23,56 @@ def getAdministeredIdentitiesMe(self): return self._session.get(metadata, resource) + + + def getAdministeredIdentitiesMeApiKeys(self): + """ + **List the non-sensitive metadata associated with the API keys that belong to the user** + https://developer.cisco.com/meraki/api-v1/#!get-administered-identities-me-api-keys + + """ + + metadata = { + 'tags': ['administered', 'configure', 'identities', 'me', 'api', 'keys'], + 'operation': 'getAdministeredIdentitiesMeApiKeys' + } + resource = f'/administered/identities/me/api/keys' + + return self._session.get(metadata, resource) + + + + def generateAdministeredIdentitiesMeApiKeys(self): + """ + **Generates an API key for an identity** + https://developer.cisco.com/meraki/api-v1/#!generate-administered-identities-me-api-keys + + """ + + metadata = { + 'tags': ['administered', 'configure', 'identities', 'me', 'api', 'keys'], + 'operation': 'generateAdministeredIdentitiesMeApiKeys' + } + resource = f'/administered/identities/me/api/keys/generate' + + return self._session.post(metadata, resource) + + + + def revokeAdministeredIdentitiesMeApiKeys(self, suffix: str): + """ + **Revokes an identity's API key, using the last four characters of the key** + https://developer.cisco.com/meraki/api-v1/#!revoke-administered-identities-me-api-keys + + - suffix (string): Suffix + """ + + metadata = { + 'tags': ['administered', 'configure', 'identities', 'me', 'api', 'keys'], + 'operation': 'revokeAdministeredIdentitiesMeApiKeys' + } + suffix = urllib.parse.quote(str(suffix), safe='') + resource = f'/administered/identities/me/api/keys/{suffix}/revoke' + + return self._session.post(metadata, resource) + diff --git a/meraki/api/batch/switch.py b/meraki/api/batch/switch.py index c36a044f..16034cb9 100644 --- a/meraki/api/batch/switch.py +++ b/meraki/api/batch/switch.py @@ -321,6 +321,7 @@ def updateDeviceSwitchRoutingStaticRoute(self, serial: str, staticRouteId: str, - name (string): Name or description for layer 3 static route - subnet (string): The subnet which is routed via this static route and should be specified in CIDR notation (ex. 1.2.3.0/24) - nextHopIp (string): IP address of the next hop device to which the device sends its traffic for the subnet + - managementNextHop (string): Optional fallback IP address for management traffic - advertiseViaOspfEnabled (boolean): Option to advertise static route via OSPF - preferOverOspfRoutesEnabled (boolean): Option to prefer static route over OSPF routes """ @@ -333,7 +334,7 @@ def updateDeviceSwitchRoutingStaticRoute(self, serial: str, staticRouteId: str, } resource = f'/devices/{serial}/switch/routing/staticRoutes/{staticRouteId}' - body_params = ['name', 'subnet', 'nextHopIp', 'advertiseViaOspfEnabled', 'preferOverOspfRoutesEnabled', ] + body_params = ['name', 'subnet', 'nextHopIp', 'managementNextHop', 'advertiseViaOspfEnabled', 'preferOverOspfRoutesEnabled', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { "resource": resource, @@ -1451,6 +1452,7 @@ def updateNetworkSwitchStackRoutingStaticRoute(self, networkId: str, switchStack - name (string): Name or description for layer 3 static route - subnet (string): The subnet which is routed via this static route and should be specified in CIDR notation (ex. 1.2.3.0/24) - nextHopIp (string): IP address of the next hop device to which the device sends its traffic for the subnet + - managementNextHop (string): Optional fallback IP address for management traffic - advertiseViaOspfEnabled (boolean): Option to advertise static route via OSPF - preferOverOspfRoutesEnabled (boolean): Option to prefer static route over OSPF routes """ @@ -1463,7 +1465,7 @@ def updateNetworkSwitchStackRoutingStaticRoute(self, networkId: str, switchStack } resource = f'/networks/{networkId}/switch/stacks/{switchStackId}/routing/staticRoutes/{staticRouteId}' - body_params = ['name', 'subnet', 'nextHopIp', 'advertiseViaOspfEnabled', 'preferOverOspfRoutesEnabled', ] + body_params = ['name', 'subnet', 'nextHopIp', 'managementNextHop', 'advertiseViaOspfEnabled', 'preferOverOspfRoutesEnabled', ] 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 c20d5f20..2b8fc727 100644 --- a/meraki/api/batch/wireless.py +++ b/meraki/api/batch/wireless.py @@ -574,12 +574,14 @@ def createNetworkWirelessRfProfile(self, networkId: str, name: str, bandSelectio def updateNetworkWirelessRfProfile(self, networkId: str, rfProfileId: str, **kwargs): """ - **Updates specified RF profile for this network** + **Updates specified RF profile for this network. Note: built-in RF profiles can only be assigned as a default, and its attributes are immutable** https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-rf-profile - networkId (string): Network ID - rfProfileId (string): Rf profile ID - name (string): The name of the new profile. Must be unique. + - isIndoorDefault (boolean): Set this profile as the default indoor rf profile. If the profile ID is one of 'indoor' or 'outdoor', then a new profile will be created from the respective ID and set as the default + - isOutdoorDefault (boolean): Set this profile as the default outdoor rf profile. If the profile ID is one of 'indoor' or 'outdoor', then a new profile will be created from the respective ID and set as the default - clientBalancingEnabled (boolean): Steers client to best available access point. Can be either true or false. - minBitrateType (string): Minimum bitrate can be set to either 'band' or 'ssid'. - bandSelectionType (string): Band selection can be set to either 'ssid' or 'ap'. @@ -607,7 +609,7 @@ def updateNetworkWirelessRfProfile(self, networkId: str, rfProfileId: str, **kwa } resource = f'/networks/{networkId}/wireless/rfProfiles/{rfProfileId}' - body_params = ['name', 'clientBalancingEnabled', 'minBitrateType', 'bandSelectionType', 'apBandSettings', 'twoFourGhzSettings', 'fiveGhzSettings', 'sixGhzSettings', 'transmission', 'perSsidSettings', 'flexRadios', ] + body_params = ['name', 'isIndoorDefault', 'isOutdoorDefault', 'clientBalancingEnabled', 'minBitrateType', 'bandSelectionType', 'apBandSettings', 'twoFourGhzSettings', 'fiveGhzSettings', 'sixGhzSettings', 'transmission', 'perSsidSettings', 'flexRadios', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { "resource": resource, diff --git a/meraki/api/devices.py b/meraki/api/devices.py index 76eb932a..d9bf9c54 100644 --- a/meraki/api/devices.py +++ b/meraki/api/devices.py @@ -211,7 +211,7 @@ def createDeviceLiveToolsCableTest(self, serial: str, ports: list, **kwargs): https://developer.cisco.com/meraki/api-v1/#!create-device-live-tools-cable-test - serial (string): Serial - - ports (array): A list of ports for which to perform the cable test. + - ports (array): A list of ports for which to perform the cable test. For Catalyst switches, IOS interface names are also supported, such as "GigabitEthernet1/0/8", "Gi1/0/8", or even "1/0/8". - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret """ diff --git a/meraki/api/organizations.py b/meraki/api/organizations.py index 4b62b761..d22984e2 100644 --- a/meraki/api/organizations.py +++ b/meraki/api/organizations.py @@ -717,7 +717,7 @@ def createOrganizationAdmin(self, organizationId: str, email: str, name: str, or - orgAccess (string): The privilege of the dashboard administrator on the organization. Can be one of 'full', 'read-only', 'enterprise' or 'none' - tags (array): The list of tags that the dashboard administrator has privileges on - networks (array): The list of networks that the dashboard administrator has privileges on - - authenticationMethod (string): The method of authentication the user will use to sign in to the Meraki dashboard. Can be one of 'Email' or 'Cisco SecureX Sign-On'. The default is Email authentication + - authenticationMethod (string): No longer used as of Cisco SecureX end-of-life. Can be one of 'Email'. The default is Email authentication. """ kwargs.update(locals()) @@ -726,7 +726,7 @@ def createOrganizationAdmin(self, organizationId: str, email: str, name: str, or options = ['enterprise', 'full', 'none', 'read-only'] assert kwargs['orgAccess'] in options, f'''"orgAccess" cannot be "{kwargs['orgAccess']}", & must be set to one of: {options}''' if 'authenticationMethod' in kwargs: - options = ['Cisco SecureX Sign-On', 'Email'] + options = ['Email'] assert kwargs['authenticationMethod'] in options, f'''"authenticationMethod" cannot be "{kwargs['authenticationMethod']}", & must be set to one of: {options}''' metadata = { @@ -1126,6 +1126,7 @@ def getOrganizationAssuranceAlertsOverview(self, organizationId: str, **kwargs): - types (array): Optional parameter to filter by alert type. - tsStart (string): Optional parameter to filter by starting timestamp - tsEnd (string): Optional parameter to filter by end timestamp + - category (string): Optional parameter to filter by category. - serials (array): Optional parameter to filter by primary device serial - deviceTypes (array): Optional parameter to filter by device types - deviceTags (array): Optional parameter to filter by device tags @@ -1137,6 +1138,10 @@ def getOrganizationAssuranceAlertsOverview(self, organizationId: str, **kwargs): kwargs.update(locals()) + if 'category' in kwargs: + options = ['configuration', 'connectivity', 'device_health', 'insights'] + assert kwargs['category'] in options, f'''"category" cannot be "{kwargs['category']}", & must be set to one of: {options}''' + metadata = { 'tags': ['organizations', 'monitor', 'alerts', 'overview'], 'operation': 'getOrganizationAssuranceAlertsOverview' @@ -1144,7 +1149,7 @@ def getOrganizationAssuranceAlertsOverview(self, organizationId: str, **kwargs): organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/assurance/alerts/overview' - query_params = ['networkId', 'severity', 'types', 'tsStart', 'tsEnd', 'serials', 'deviceTypes', 'deviceTags', 'active', 'dismissed', 'resolved', 'suppressAlertsForOfflineNodes', ] + query_params = ['networkId', 'severity', 'types', 'tsStart', 'tsEnd', 'category', 'serials', 'deviceTypes', 'deviceTags', 'active', 'dismissed', 'resolved', 'suppressAlertsForOfflineNodes', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = ['types', 'serials', 'deviceTypes', 'deviceTags', ] @@ -1174,6 +1179,7 @@ def getOrganizationAssuranceAlertsOverviewByNetwork(self, organizationId: str, t - types (array): Optional parameter to filter by alert type. - tsStart (string): Optional parameter to filter by starting timestamp - tsEnd (string): Optional parameter to filter by end timestamp + - category (string): Optional parameter to filter by category. - serials (array): Optional parameter to filter by primary device serial - deviceTypes (array): Optional parameter to filter by device types - deviceTags (array): Optional parameter to filter by device tags @@ -1188,6 +1194,9 @@ def getOrganizationAssuranceAlertsOverviewByNetwork(self, organizationId: str, t if 'sortOrder' in kwargs: options = ['ascending', 'descending'] assert kwargs['sortOrder'] in options, f'''"sortOrder" cannot be "{kwargs['sortOrder']}", & must be set to one of: {options}''' + if 'category' in kwargs: + options = ['configuration', 'connectivity', 'device_health', 'insights'] + assert kwargs['category'] in options, f'''"category" cannot be "{kwargs['category']}", & must be set to one of: {options}''' metadata = { 'tags': ['organizations', 'monitor', 'alerts', 'overview', 'byNetwork'], @@ -1196,7 +1205,7 @@ def getOrganizationAssuranceAlertsOverviewByNetwork(self, organizationId: str, t organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/assurance/alerts/overview/byNetwork' - query_params = ['perPage', 'startingAfter', 'endingBefore', 'sortOrder', 'networkId', 'severity', 'types', 'tsStart', 'tsEnd', 'serials', 'deviceTypes', 'deviceTags', 'active', 'dismissed', 'resolved', 'suppressAlertsForOfflineNodes', ] + query_params = ['perPage', 'startingAfter', 'endingBefore', 'sortOrder', 'networkId', 'severity', 'types', 'tsStart', 'tsEnd', 'category', 'serials', 'deviceTypes', 'deviceTags', 'active', 'dismissed', 'resolved', 'suppressAlertsForOfflineNodes', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = ['types', 'serials', 'deviceTypes', 'deviceTags', ] @@ -1226,6 +1235,7 @@ def getOrganizationAssuranceAlertsOverviewByType(self, organizationId: str, tota - types (array): Optional parameter to filter by alert type. - tsStart (string): Optional parameter to filter by starting timestamp - tsEnd (string): Optional parameter to filter by end timestamp + - category (string): Optional parameter to filter by category. - sortBy (string): Optional parameter to set column to sort by. - serials (array): Optional parameter to filter by primary device serial - deviceTypes (array): Optional parameter to filter by device types @@ -1241,6 +1251,9 @@ def getOrganizationAssuranceAlertsOverviewByType(self, organizationId: str, tota if 'sortOrder' in kwargs: options = ['ascending', 'descending'] assert kwargs['sortOrder'] in options, f'''"sortOrder" cannot be "{kwargs['sortOrder']}", & must be set to one of: {options}''' + if 'category' in kwargs: + options = ['configuration', 'connectivity', 'device_health', 'insights'] + assert kwargs['category'] in options, f'''"category" cannot be "{kwargs['category']}", & must be set to one of: {options}''' if 'sortBy' in kwargs: options = ['count', 'lastAlertedAt', 'networkCount', 'severity', 'startedAt'] assert kwargs['sortBy'] in options, f'''"sortBy" cannot be "{kwargs['sortBy']}", & must be set to one of: {options}''' @@ -1252,7 +1265,7 @@ def getOrganizationAssuranceAlertsOverviewByType(self, organizationId: str, tota organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/assurance/alerts/overview/byType' - query_params = ['perPage', 'startingAfter', 'endingBefore', 'sortOrder', 'networkId', 'severity', 'types', 'tsStart', 'tsEnd', 'sortBy', 'serials', 'deviceTypes', 'deviceTags', 'active', 'dismissed', 'resolved', 'suppressAlertsForOfflineNodes', ] + query_params = ['perPage', 'startingAfter', 'endingBefore', 'sortOrder', 'networkId', 'severity', 'types', 'tsStart', 'tsEnd', 'category', 'sortBy', 'serials', 'deviceTypes', 'deviceTags', 'active', 'dismissed', 'resolved', 'suppressAlertsForOfflineNodes', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = ['types', 'serials', 'deviceTypes', 'deviceTags', ] @@ -1277,12 +1290,17 @@ def getOrganizationAssuranceAlertsOverviewHistorical(self, organizationId: str, - severity (string): Optional parameter to filter alerts overview by severity type. - types (array): Optional parameter to filter by alert type. - tsEnd (string): Optional parameter to filter by end timestamp defaults to the current time + - category (string): Optional parameter to filter by category. - serials (array): Optional parameter to filter by primary device serial - deviceTypes (array): Optional parameter to filter by device types """ kwargs.update(locals()) + if 'category' in kwargs: + options = ['configuration', 'connectivity', 'device_health', 'insights'] + assert kwargs['category'] in options, f'''"category" cannot be "{kwargs['category']}", & must be set to one of: {options}''' + metadata = { 'tags': ['organizations', 'monitor', 'alerts', 'overview', 'historical'], 'operation': 'getOrganizationAssuranceAlertsOverviewHistorical' @@ -1290,7 +1308,7 @@ def getOrganizationAssuranceAlertsOverviewHistorical(self, organizationId: str, organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/assurance/alerts/overview/historical' - query_params = ['segmentDuration', 'networkId', 'severity', 'types', 'tsStart', 'tsEnd', 'serials', 'deviceTypes', ] + query_params = ['segmentDuration', 'networkId', 'severity', 'types', 'tsStart', 'tsEnd', 'category', 'serials', 'deviceTypes', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = ['types', 'serials', 'deviceTypes', ] @@ -1558,7 +1576,6 @@ def getOrganizationClientsBandwidthUsageHistory(self, organizationId: str, **kwa - 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. @@ -1575,7 +1592,7 @@ def getOrganizationClientsBandwidthUsageHistory(self, organizationId: str, **kwa organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/clients/bandwidthUsageHistory' - query_params = ['networkTag', 'deviceTag', 'networkId', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] + query_params = ['networkTag', 'deviceTag', '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) @@ -1816,7 +1833,7 @@ def getOrganizationConfigurationChanges(self, organizationId: str, total_pages=1 def getOrganizationDevices(self, organizationId: str, total_pages=1, direction='next', **kwargs): """ - **List the devices in an organization** + **List the devices in an organization that have been assigned to a network.** https://developer.cisco.com/meraki/api-v1/#!get-organization-devices - organizationId (string): Organization ID @@ -3928,7 +3945,6 @@ def getOrganizationSummaryTopAppliancesByUtilization(self, organizationId: str, - 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 @@ -3946,7 +3962,7 @@ def getOrganizationSummaryTopAppliancesByUtilization(self, organizationId: str, organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/summary/top/appliances/byUtilization' - query_params = ['networkTag', 'deviceTag', 'networkId', 'quantity', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] + query_params = ['networkTag', 'deviceTag', '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) @@ -4027,7 +4043,6 @@ def getOrganizationSummaryTopClientsByUsage(self, organizationId: str, **kwargs) - 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 @@ -4045,7 +4060,7 @@ def getOrganizationSummaryTopClientsByUsage(self, organizationId: str, **kwargs) organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/summary/top/clients/byUsage' - query_params = ['networkTag', 'deviceTag', 'networkId', 'quantity', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] + query_params = ['networkTag', 'deviceTag', '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) @@ -4060,7 +4075,6 @@ def getOrganizationSummaryTopClientsManufacturersByUsage(self, organizationId: s - 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 @@ -4078,7 +4092,7 @@ def getOrganizationSummaryTopClientsManufacturersByUsage(self, organizationId: s organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/summary/top/clients/manufacturers/byUsage' - query_params = ['networkTag', 'deviceTag', 'networkId', 'quantity', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] + query_params = ['networkTag', 'deviceTag', '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) @@ -4093,7 +4107,6 @@ def getOrganizationSummaryTopDevicesByUsage(self, organizationId: str, **kwargs) - 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 @@ -4111,7 +4124,7 @@ def getOrganizationSummaryTopDevicesByUsage(self, organizationId: str, **kwargs) organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/summary/top/devices/byUsage' - query_params = ['networkTag', 'deviceTag', 'networkId', 'quantity', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] + query_params = ['networkTag', 'deviceTag', '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) @@ -4126,7 +4139,6 @@ def getOrganizationSummaryTopDevicesModelsByUsage(self, organizationId: str, **k - 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 @@ -4144,7 +4156,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 = ['networkTag', 'deviceTag', 'networkId', 'quantity', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] + query_params = ['networkTag', 'deviceTag', '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) @@ -4161,7 +4173,6 @@ def getOrganizationSummaryTopNetworksByStatus(self, organizationId: str, total_p - 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 @@ -4179,7 +4190,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 = ['networkTag', 'deviceTag', 'networkId', 'quantity', 'ssidName', 'usageUplink', 'perPage', 'startingAfter', 'endingBefore', ] + query_params = ['networkTag', 'deviceTag', '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) @@ -4194,7 +4205,6 @@ def getOrganizationSummaryTopSsidsByUsage(self, organizationId: str, **kwargs): - 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 @@ -4212,7 +4222,7 @@ def getOrganizationSummaryTopSsidsByUsage(self, organizationId: str, **kwargs): organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/summary/top/ssids/byUsage' - query_params = ['networkTag', 'deviceTag', 'networkId', 'quantity', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] + query_params = ['networkTag', 'deviceTag', '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) @@ -4227,7 +4237,6 @@ def getOrganizationSummaryTopSwitchesByEnergyUsage(self, organizationId: str, ** - 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 @@ -4245,7 +4254,7 @@ def getOrganizationSummaryTopSwitchesByEnergyUsage(self, organizationId: str, ** organizationId = urllib.parse.quote(str(organizationId), safe='') resource = f'/organizations/{organizationId}/summary/top/switches/byEnergyUsage' - query_params = ['networkTag', 'deviceTag', 'networkId', 'quantity', 'ssidName', 'usageUplink', 't0', 't1', 'timespan', ] + query_params = ['networkTag', 'deviceTag', '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/sm.py b/meraki/api/sm.py index c38195ea..3aaa5a14 100644 --- a/meraki/api/sm.py +++ b/meraki/api/sm.py @@ -975,7 +975,7 @@ def getNetworkSmUsers(self, networkId: str, **kwargs): kwargs.update(locals()) metadata = { - 'tags': ['sm', 'configure', 'users'], + 'tags': ['sm', 'configure'], 'operation': 'getNetworkSmUsers' } networkId = urllib.parse.quote(str(networkId), safe='') @@ -1004,7 +1004,7 @@ def getNetworkSmUserDeviceProfiles(self, networkId: str, userId: str): """ metadata = { - 'tags': ['sm', 'configure', 'users', 'deviceProfiles'], + 'tags': ['sm', 'configure', 'deviceProfiles'], 'operation': 'getNetworkSmUserDeviceProfiles' } networkId = urllib.parse.quote(str(networkId), safe='') @@ -1025,7 +1025,7 @@ def getNetworkSmUserSoftwares(self, networkId: str, userId: str): """ metadata = { - 'tags': ['sm', 'configure', 'users', 'softwares'], + 'tags': ['sm', 'configure', 'softwares'], 'operation': 'getNetworkSmUserSoftwares' } networkId = urllib.parse.quote(str(networkId), safe='') diff --git a/meraki/api/switch.py b/meraki/api/switch.py index f8c0652d..c9baa458 100644 --- a/meraki/api/switch.py +++ b/meraki/api/switch.py @@ -477,6 +477,7 @@ def updateDeviceSwitchRoutingStaticRoute(self, serial: str, staticRouteId: str, - name (string): Name or description for layer 3 static route - subnet (string): The subnet which is routed via this static route and should be specified in CIDR notation (ex. 1.2.3.0/24) - nextHopIp (string): IP address of the next hop device to which the device sends its traffic for the subnet + - managementNextHop (string): Optional fallback IP address for management traffic - advertiseViaOspfEnabled (boolean): Option to advertise static route via OSPF - preferOverOspfRoutesEnabled (boolean): Option to prefer static route over OSPF routes """ @@ -491,7 +492,7 @@ def updateDeviceSwitchRoutingStaticRoute(self, serial: str, staticRouteId: str, staticRouteId = urllib.parse.quote(str(staticRouteId), safe='') resource = f'/devices/{serial}/switch/routing/staticRoutes/{staticRouteId}' - body_params = ['name', 'subnet', 'nextHopIp', 'advertiseViaOspfEnabled', 'preferOverOspfRoutesEnabled', ] + body_params = ['name', 'subnet', 'nextHopIp', 'managementNextHop', 'advertiseViaOspfEnabled', 'preferOverOspfRoutesEnabled', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} return self._session.put(metadata, resource, payload) @@ -2200,6 +2201,7 @@ def updateNetworkSwitchStackRoutingStaticRoute(self, networkId: str, switchStack - name (string): Name or description for layer 3 static route - subnet (string): The subnet which is routed via this static route and should be specified in CIDR notation (ex. 1.2.3.0/24) - nextHopIp (string): IP address of the next hop device to which the device sends its traffic for the subnet + - managementNextHop (string): Optional fallback IP address for management traffic - advertiseViaOspfEnabled (boolean): Option to advertise static route via OSPF - preferOverOspfRoutesEnabled (boolean): Option to prefer static route over OSPF routes """ @@ -2215,7 +2217,7 @@ def updateNetworkSwitchStackRoutingStaticRoute(self, networkId: str, switchStack staticRouteId = urllib.parse.quote(str(staticRouteId), safe='') resource = f'/networks/{networkId}/switch/stacks/{switchStackId}/routing/staticRoutes/{staticRouteId}' - body_params = ['name', 'subnet', 'nextHopIp', 'advertiseViaOspfEnabled', 'preferOverOspfRoutesEnabled', ] + body_params = ['name', 'subnet', 'nextHopIp', 'managementNextHop', 'advertiseViaOspfEnabled', 'preferOverOspfRoutesEnabled', ] 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/wireless.py b/meraki/api/wireless.py index 4ec9a821..01df3912 100644 --- a/meraki/api/wireless.py +++ b/meraki/api/wireless.py @@ -738,6 +738,7 @@ def getNetworkWirelessClientConnectivityEvents(self, networkId: str, clientId: s - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 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. + - sortOrder (string): Sorted order of entries. Order options are 'ascending' and 'descending'. Default is 'ascending'. - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 31 days from today. - 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. @@ -750,6 +751,9 @@ def getNetworkWirelessClientConnectivityEvents(self, networkId: str, clientId: s kwargs.update(locals()) + if 'sortOrder' in kwargs: + options = ['ascending', 'descending'] + assert kwargs['sortOrder'] in options, f'''"sortOrder" cannot be "{kwargs['sortOrder']}", & must be set to one of: {options}''' if 'band' in kwargs: options = ['2.4', '5', '6'] assert kwargs['band'] in options, f'''"band" cannot be "{kwargs['band']}", & must be set to one of: {options}''' @@ -765,7 +769,7 @@ def getNetworkWirelessClientConnectivityEvents(self, networkId: str, clientId: s clientId = urllib.parse.quote(str(clientId), safe='') resource = f'/networks/{networkId}/wireless/clients/{clientId}/connectivityEvents' - query_params = ['perPage', 'startingAfter', 'endingBefore', 't0', 't1', 'timespan', 'types', 'band', 'ssidNumber', 'includedSeverities', 'deviceSerial', ] + query_params = ['perPage', 'startingAfter', 'endingBefore', 'sortOrder', 't0', 't1', 'timespan', 'types', 'band', 'ssidNumber', 'includedSeverities', 'deviceSerial', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = ['types', 'includedSeverities', ] @@ -1441,6 +1445,8 @@ def updateNetworkWirelessRfProfile(self, networkId: str, rfProfileId: str, **kwa - networkId (string): Network ID - rfProfileId (string): Rf profile ID - name (string): The name of the new profile. Must be unique. + - isIndoorDefault (boolean): Set this profile as the default indoor rf profile. If the profile ID is one of 'indoor' or 'outdoor', then a new profile will be created from the respective ID and set as the default + - isOutdoorDefault (boolean): Set this profile as the default outdoor rf profile. If the profile ID is one of 'indoor' or 'outdoor', then a new profile will be created from the respective ID and set as the default - clientBalancingEnabled (boolean): Steers client to best available access point. Can be either true or false. - minBitrateType (string): Minimum bitrate can be set to either 'band' or 'ssid'. - bandSelectionType (string): Band selection can be set to either 'ssid' or 'ap'. @@ -1470,7 +1476,7 @@ def updateNetworkWirelessRfProfile(self, networkId: str, rfProfileId: str, **kwa rfProfileId = urllib.parse.quote(str(rfProfileId), safe='') resource = f'/networks/{networkId}/wireless/rfProfiles/{rfProfileId}' - body_params = ['name', 'clientBalancingEnabled', 'minBitrateType', 'bandSelectionType', 'apBandSettings', 'twoFourGhzSettings', 'fiveGhzSettings', 'sixGhzSettings', 'transmission', 'perSsidSettings', 'flexRadios', ] + body_params = ['name', 'isIndoorDefault', 'isOutdoorDefault', 'clientBalancingEnabled', 'minBitrateType', 'bandSelectionType', 'apBandSettings', 'twoFourGhzSettings', 'fiveGhzSettings', 'sixGhzSettings', 'transmission', 'perSsidSettings', 'flexRadios', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} return self._session.put(metadata, resource, payload)