diff --git a/meraki/__init__.py b/meraki/__init__.py index d66b46b1..b6a344f8 100644 --- a/meraki/__init__.py +++ b/meraki/__init__.py @@ -43,7 +43,7 @@ ) from meraki.rest_session import * -__version__ = '1.51.0' +__version__ = '1.52.0' class DashboardAPI(object): diff --git a/meraki/aio/api/devices.py b/meraki/aio/api/devices.py index 4df9309f..f712caa2 100644 --- a/meraki/aio/api/devices.py +++ b/meraki/aio/api/devices.py @@ -252,6 +252,53 @@ def getDeviceLiveToolsCableTest(self, serial: str, id: str): + def createDeviceLiveToolsLedsBlink(self, serial: str, duration: int, **kwargs): + """ + **Enqueue a job to blink LEDs on a device** + https://developer.cisco.com/meraki/api-v1/#!create-device-live-tools-leds-blink + + - serial (string): Serial + - duration (integer): The duration in seconds to blink LEDs. + - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['devices', 'liveTools', 'leds', 'blink'], + 'operation': 'createDeviceLiveToolsLedsBlink' + } + serial = urllib.parse.quote(str(serial), safe='') + resource = f'/devices/{serial}/liveTools/leds/blink' + + body_params = ['duration', 'callback', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.post(metadata, resource, payload) + + + + def getDeviceLiveToolsLedsBlink(self, serial: str, ledsBlinkId: str): + """ + **Return a blink LEDs job** + https://developer.cisco.com/meraki/api-v1/#!get-device-live-tools-leds-blink + + - serial (string): Serial + - ledsBlinkId (string): Leds blink ID + """ + + metadata = { + 'tags': ['devices', 'liveTools', 'leds', 'blink'], + 'operation': 'getDeviceLiveToolsLedsBlink' + } + serial = urllib.parse.quote(str(serial), safe='') + ledsBlinkId = urllib.parse.quote(str(ledsBlinkId), safe='') + resource = f'/devices/{serial}/liveTools/leds/blink/{ledsBlinkId}' + + return self._session.get(metadata, resource) + + + def createDeviceLiveToolsPing(self, serial: str, target: str, **kwargs): """ **Enqueue a job to ping a target host from the device** diff --git a/meraki/aio/api/networks.py b/meraki/aio/api/networks.py index ff33c069..af3507b5 100644 --- a/meraki/aio/api/networks.py +++ b/meraki/aio/api/networks.py @@ -1201,6 +1201,131 @@ def createNetworkFloorPlan(self, networkId: str, name: str, imageContents: str, + def batchNetworkFloorPlansAutoLocateJobs(self, networkId: str, jobs: list): + """ + **Schedule auto locate jobs for one or more floor plans in a network** + https://developer.cisco.com/meraki/api-v1/#!batch-network-floor-plans-auto-locate-jobs + + - networkId (string): Network ID + - jobs (array): The list of auto locate jobs to be scheduled. Up to 100 jobs can be provided in a request. + """ + + kwargs = locals() + + metadata = { + 'tags': ['networks', 'configure', 'floorPlans', 'autoLocate', 'jobs'], + 'operation': 'batchNetworkFloorPlansAutoLocateJobs' + } + networkId = urllib.parse.quote(str(networkId), safe='') + resource = f'/networks/{networkId}/floorPlans/autoLocate/jobs/batch' + + body_params = ['jobs', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.post(metadata, resource, payload) + + + + def cancelNetworkFloorPlansAutoLocateJob(self, networkId: str, jobId: str): + """ + **Cancel a scheduled or running auto locate job** + https://developer.cisco.com/meraki/api-v1/#!cancel-network-floor-plans-auto-locate-job + + - networkId (string): Network ID + - jobId (string): Job ID + """ + + metadata = { + 'tags': ['networks', 'configure', 'floorPlans', 'autoLocate', 'jobs'], + 'operation': 'cancelNetworkFloorPlansAutoLocateJob' + } + networkId = urllib.parse.quote(str(networkId), safe='') + jobId = urllib.parse.quote(str(jobId), safe='') + resource = f'/networks/{networkId}/floorPlans/autoLocate/jobs/{jobId}/cancel' + + return self._session.post(metadata, resource) + + + + def publishNetworkFloorPlansAutoLocateJob(self, networkId: str, jobId: str, **kwargs): + """ + **Update the status of a finished auto locate job to be published, and update device locations** + https://developer.cisco.com/meraki/api-v1/#!publish-network-floor-plans-auto-locate-job + + - networkId (string): Network ID + - jobId (string): Job ID + - devices (array): The list of devices to publish positions for + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['networks', 'configure', 'floorPlans', 'autoLocate', 'jobs'], + 'operation': 'publishNetworkFloorPlansAutoLocateJob' + } + networkId = urllib.parse.quote(str(networkId), safe='') + jobId = urllib.parse.quote(str(jobId), safe='') + resource = f'/networks/{networkId}/floorPlans/autoLocate/jobs/{jobId}/publish' + + body_params = ['devices', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.post(metadata, resource, payload) + + + + def recalculateNetworkFloorPlansAutoLocateJob(self, networkId: str, jobId: str, **kwargs): + """ + **Trigger auto locate recalculation for a job, and optionally set anchors** + https://developer.cisco.com/meraki/api-v1/#!recalculate-network-floor-plans-auto-locate-job + + - networkId (string): Network ID + - jobId (string): Job ID + - devices (array): The list of devices to update anchor positions for + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['networks', 'configure', 'floorPlans', 'autoLocate', 'jobs'], + 'operation': 'recalculateNetworkFloorPlansAutoLocateJob' + } + networkId = urllib.parse.quote(str(networkId), safe='') + jobId = urllib.parse.quote(str(jobId), safe='') + resource = f'/networks/{networkId}/floorPlans/autoLocate/jobs/{jobId}/recalculate' + + body_params = ['devices', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.post(metadata, resource, payload) + + + + def batchNetworkFloorPlansDevicesUpdate(self, networkId: str, assignments: list): + """ + **Update floorplan assignments for a batch of devices** + https://developer.cisco.com/meraki/api-v1/#!batch-network-floor-plans-devices-update + + - networkId (string): Network ID + - assignments (array): List of floorplan assignments to update. Up to 100 floor plan assignments can be provided in a request. + """ + + kwargs = locals() + + metadata = { + 'tags': ['networks', 'configure', 'floorPlans', 'devices'], + 'operation': 'batchNetworkFloorPlansDevicesUpdate' + } + networkId = urllib.parse.quote(str(networkId), safe='') + resource = f'/networks/{networkId}/floorPlans/devices/batchUpdate' + + body_params = ['assignments', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.post(metadata, resource, payload) + + + def getNetworkFloorPlan(self, networkId: str, floorPlanId: str): """ **Find a floor plan by ID** diff --git a/meraki/aio/api/organizations.py b/meraki/aio/api/organizations.py index 38ab2ed8..914ded51 100644 --- a/meraki/aio/api/organizations.py +++ b/meraki/aio/api/organizations.py @@ -1908,7 +1908,7 @@ def getOrganizationDevicesAvailabilities(self, organizationId: str, total_pages= - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - networkIds (array): Optional parameter to filter device availabilities by network ID. This filter uses multiple exact matches. - - productTypes (array): Optional parameter to filter device availabilities by device product types. This filter uses multiple exact matches. Valid types are wireless, appliance, switch, camera, cellularGateway, sensor, and wirelessController + - productTypes (array): Optional parameter to filter device availabilities by device product types. This filter uses multiple exact matches. Valid types are wireless, appliance, switch, camera, cellularGateway, sensor, wirelessController, and campusGateway - serials (array): Optional parameter to filter device availabilities by device serial numbers. This filter uses multiple exact matches. - tags (array): An optional parameter to filter devices by tags. The filtering is case-sensitive. If tags are included, 'tagsFilterType' should also be included (see below). This filter uses multiple exact matches. - tagsFilterType (string): An optional parameter of value 'withAnyTags' or 'withAllTags' to indicate whether to return devices which contain ANY or ALL of the included tags. If no type is included, 'withAnyTags' will be selected. @@ -2500,6 +2500,80 @@ def getOrganizationFirmwareUpgradesByDevice(self, organizationId: str, total_pag + def getOrganizationFloorPlansAutoLocateDevices(self, organizationId: str, total_pages=1, direction='next', **kwargs): + """ + **List auto locate details for each device in your organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-floor-plans-auto-locate-devices + + - 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 + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. 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. + - networkIds (array): Optional parameter to filter devices by one or more network IDs + - floorPlanIds (array): Optional parameter to filter devices by one or more floorplan IDs + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['organizations', 'configure', 'floorPlans', 'autoLocate', 'devices'], + 'operation': 'getOrganizationFloorPlansAutoLocateDevices' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/floorPlans/autoLocate/devices' + + query_params = ['perPage', 'startingAfter', 'endingBefore', 'networkIds', 'floorPlanIds', ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = ['networkIds', 'floorPlanIds', ] + 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 getOrganizationFloorPlansAutoLocateStatuses(self, organizationId: str, total_pages=1, direction='next', **kwargs): + """ + **List the status of auto locate for each floorplan in your organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-floor-plans-auto-locate-statuses + + - 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 + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. 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. + - networkIds (array): Optional parameter to filter floorplans by one or more network IDs + - floorPlanIds (array): Optional parameter to filter floorplans by one or more floorplan IDs + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['organizations', 'configure', 'floorPlans', 'autoLocate', 'statuses'], + 'operation': 'getOrganizationFloorPlansAutoLocateStatuses' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/floorPlans/autoLocate/statuses' + + query_params = ['perPage', 'startingAfter', 'endingBefore', 'networkIds', 'floorPlanIds', ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = ['networkIds', 'floorPlanIds', ] + 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 claimIntoOrganizationInventory(self, organizationId: str, **kwargs): """ **Claim a list of devices, licenses, and/or orders into an organization inventory** diff --git a/meraki/aio/api/switch.py b/meraki/aio/api/switch.py index 2e6a69bc..711f58f7 100644 --- a/meraki/aio/api/switch.py +++ b/meraki/aio/api/switch.py @@ -2596,3 +2596,46 @@ def getOrganizationSwitchPortsOverview(self, organizationId: str, **kwargs): return self._session.get(metadata, resource, params) + + + def getOrganizationSwitchPortsStatusesBySwitch(self, organizationId: str, total_pages=1, direction='next', **kwargs): + """ + **List the switchports in an organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-statuses-by-switch + + - 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 + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 20. Default is 10. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - configurationUpdatedAfter (string): Optional parameter to filter items to switches where the configuration has been updated after the given timestamp. + - mac (string): Optional parameter to filter items to switches with MAC addresses that contain the search term or are an exact match. + - macs (array): Optional parameter to filter items to switches that have one of the provided MAC addresses. + - name (string): Optional parameter to filter items to switches with names that contain the search term or are an exact match. + - networkIds (array): Optional parameter to filter items to switches in one of the provided networks. + - portProfileIds (array): Optional parameter to filter items to switches that contain switchports belonging to one of the specified port profiles. + - serial (string): Optional parameter to filter items to switches with serial number that contains the search term or are an exact match. + - serials (array): Optional parameter to filter items to switches that have one of the provided serials. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['switch', 'monitor', 'ports', 'statuses', 'bySwitch'], + 'operation': 'getOrganizationSwitchPortsStatusesBySwitch' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/switch/ports/statuses/bySwitch' + + query_params = ['perPage', 'startingAfter', 'endingBefore', 'configurationUpdatedAfter', 'mac', 'macs', 'name', 'networkIds', 'portProfileIds', 'serial', 'serials', ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = ['macs', 'networkIds', 'portProfileIds', 'serials', ] + 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/aio/api/wireless.py b/meraki/aio/api/wireless.py index c363b29b..844a197a 100644 --- a/meraki/aio/api/wireless.py +++ b/meraki/aio/api/wireless.py @@ -1665,6 +1665,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): - number (string): Number - name (string): The name of the SSID - enabled (boolean): Whether or not the SSID is enabled + - localAuth (boolean): Extended local auth flag for Enterprise NAC - authMode (string): The association control method for the SSID ('open', 'open-enhanced', 'psk', 'open-with-radius', 'open-with-nac', '8021x-meraki', '8021x-nac', '8021x-radius', '8021x-google', '8021x-entra', '8021x-localradius', 'ipsk-with-radius', 'ipsk-without-radius' or 'ipsk-with-nac') - enterpriseAdminAccess (string): Whether or not an SSID is accessible by 'enterprise' administrators ('access disabled' or 'access enabled') - encryptionMode (string): The psk encryption mode for the SSID ('wep' or 'wpa'). This param is only valid if the authMode is 'psk' @@ -1759,7 +1760,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): number = urllib.parse.quote(str(number), safe='') resource = f'/networks/{networkId}/wireless/ssids/{number}' - body_params = ['name', 'enabled', 'authMode', 'enterpriseAdminAccess', 'encryptionMode', 'psk', 'wpaEncryptionMode', 'dot11w', 'dot11r', 'splashPage', 'splashGuestSponsorDomains', 'oauth', 'localRadius', 'ldap', 'activeDirectory', 'radiusServers', 'radiusProxyEnabled', 'radiusTestingEnabled', 'radiusCalledStationId', 'radiusAuthenticationNasId', 'radiusServerTimeout', 'radiusServerAttemptsLimit', 'radiusFallbackEnabled', 'radiusCoaEnabled', 'radiusFailoverPolicy', 'radiusLoadBalancingPolicy', 'radiusAccountingEnabled', 'radiusAccountingServers', 'radiusAccountingInterimInterval', 'radiusAttributeForGroupPolicies', 'ipAssignmentMode', 'useVlanTagging', 'concentratorNetworkId', 'secondaryConcentratorNetworkId', 'disassociateClientsOnVpnFailover', 'vlanId', 'defaultVlanId', 'apTagsAndVlanIds', 'walledGardenEnabled', 'walledGardenRanges', 'gre', 'radiusOverride', 'radiusGuestVlanEnabled', 'radiusGuestVlanId', 'minBitrate', 'bandSelection', 'perClientBandwidthLimitUp', 'perClientBandwidthLimitDown', 'perSsidBandwidthLimitUp', 'perSsidBandwidthLimitDown', 'lanIsolationEnabled', 'visible', 'availableOnAllAps', 'availabilityTags', 'mandatoryDhcpEnabled', 'adultContentFilteringEnabled', 'dnsRewrite', 'speedBurst', 'namedVlans', ] + body_params = ['name', 'enabled', 'localAuth', 'authMode', 'enterpriseAdminAccess', 'encryptionMode', 'psk', 'wpaEncryptionMode', 'dot11w', 'dot11r', 'splashPage', 'splashGuestSponsorDomains', 'oauth', 'localRadius', 'ldap', 'activeDirectory', 'radiusServers', 'radiusProxyEnabled', 'radiusTestingEnabled', 'radiusCalledStationId', 'radiusAuthenticationNasId', 'radiusServerTimeout', 'radiusServerAttemptsLimit', 'radiusFallbackEnabled', 'radiusCoaEnabled', 'radiusFailoverPolicy', 'radiusLoadBalancingPolicy', 'radiusAccountingEnabled', 'radiusAccountingServers', 'radiusAccountingInterimInterval', 'radiusAttributeForGroupPolicies', 'ipAssignmentMode', 'useVlanTagging', 'concentratorNetworkId', 'secondaryConcentratorNetworkId', 'disassociateClientsOnVpnFailover', 'vlanId', 'defaultVlanId', 'apTagsAndVlanIds', 'walledGardenEnabled', 'walledGardenRanges', 'gre', 'radiusOverride', 'radiusGuestVlanEnabled', 'radiusGuestVlanId', 'minBitrate', 'bandSelection', 'perClientBandwidthLimitUp', 'perClientBandwidthLimitDown', 'perSsidBandwidthLimitUp', 'perSsidBandwidthLimitDown', 'lanIsolationEnabled', 'visible', 'availableOnAllAps', 'availabilityTags', 'mandatoryDhcpEnabled', 'adultContentFilteringEnabled', 'dnsRewrite', 'speedBurst', 'namedVlans', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} return self._session.put(metadata, resource, payload) @@ -2936,6 +2937,31 @@ def getOrganizationWirelessDevicesWirelessControllersByDevice(self, organization + def recalculateOrganizationWirelessRadioAutoRfChannels(self, organizationId: str, networkIds: list): + """ + **Recalculates automatically assigned channels for every AP within specified the specified network(s)** + https://developer.cisco.com/meraki/api-v1/#!recalculate-organization-wireless-radio-auto-rf-channels + + - organizationId (string): Organization ID + - networkIds (array): A list of network ids (limit: 15). + """ + + kwargs = locals() + + metadata = { + 'tags': ['wireless', 'configure', 'radio', 'autoRf', 'channels'], + 'operation': 'recalculateOrganizationWirelessRadioAutoRfChannels' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/wireless/radio/autoRf/channels/recalculate' + + body_params = ['networkIds', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.post(metadata, resource, payload) + + + def getOrganizationWirelessRfProfilesAssignmentsByDevice(self, organizationId: str, total_pages=1, direction='next', **kwargs): """ **List the RF profiles of an organization by device** diff --git a/meraki/api/batch/devices.py b/meraki/api/batch/devices.py index ad601256..259ecb61 100644 --- a/meraki/api/batch/devices.py +++ b/meraki/api/batch/devices.py @@ -46,6 +46,38 @@ def updateDevice(self, serial: str, **kwargs): + def createDeviceLiveToolsLedsBlink(self, serial: str, duration: int, **kwargs): + """ + **Enqueue a job to blink LEDs on a device. This endpoint has a rate limit of one request every 10 seconds.** + https://developer.cisco.com/meraki/api-v1/#!create-device-live-tools-leds-blink + + - serial (string): Serial + - duration (integer): The duration in seconds to blink LEDs. + - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['devices', 'liveTools', 'leds', 'blink'], + 'operation': 'createDeviceLiveToolsLedsBlink' + } + resource = f'/devices/{serial}/liveTools/leds/blink' + + body_params = ['duration', 'callback', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "blink", + "body": payload + } + return action + + + + + + def createDeviceLiveToolsThroughputTest(self, serial: str, **kwargs): """ **Enqueue a job to test a device throughput, the test will run for 10 secs to test throughput. This endpoint has a rate limit of one request every five seconds per device.** diff --git a/meraki/api/batch/networks.py b/meraki/api/batch/networks.py index 5de349f9..d0a08705 100644 --- a/meraki/api/batch/networks.py +++ b/meraki/api/batch/networks.py @@ -367,6 +367,158 @@ def deleteNetworkFirmwareUpgradesStagedGroup(self, networkId: str, groupId: str) + def batchNetworkFloorPlansAutoLocateJobs(self, networkId: str, jobs: list): + """ + **Schedule auto locate jobs for one or more floor plans in a network** + https://developer.cisco.com/meraki/api-v1/#!batch-network-floor-plans-auto-locate-jobs + + - networkId (string): Network ID + - jobs (array): The list of auto locate jobs to be scheduled. Up to 100 jobs can be provided in a request. + """ + + kwargs = locals() + + metadata = { + 'tags': ['networks', 'configure', 'floorPlans', 'autoLocate', 'jobs'], + 'operation': 'batchNetworkFloorPlansAutoLocateJobs' + } + resource = f'/networks/{networkId}/floorPlans/autoLocate/jobs/batch' + + body_params = ['jobs', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "batch_create", + "body": payload + } + return action + + + + + + + def cancelNetworkFloorPlansAutoLocateJob(self, networkId: str, jobId: str): + """ + **Cancel a scheduled or running auto locate job** + https://developer.cisco.com/meraki/api-v1/#!cancel-network-floor-plans-auto-locate-job + + - networkId (string): Network ID + - jobId (string): Job ID + """ + + metadata = { + 'tags': ['networks', 'configure', 'floorPlans', 'autoLocate', 'jobs'], + 'operation': 'cancelNetworkFloorPlansAutoLocateJob' + } + resource = f'/networks/{networkId}/floorPlans/autoLocate/jobs/{jobId}/cancel' + + action = { + "resource": resource, + "operation": "cancel", + } + return action + + + + + + + def publishNetworkFloorPlansAutoLocateJob(self, networkId: str, jobId: str, **kwargs): + """ + **Update the status of a finished auto locate job to be published, and update device locations** + https://developer.cisco.com/meraki/api-v1/#!publish-network-floor-plans-auto-locate-job + + - networkId (string): Network ID + - jobId (string): Job ID + - devices (array): The list of devices to publish positions for + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['networks', 'configure', 'floorPlans', 'autoLocate', 'jobs'], + 'operation': 'publishNetworkFloorPlansAutoLocateJob' + } + resource = f'/networks/{networkId}/floorPlans/autoLocate/jobs/{jobId}/publish' + + body_params = ['devices', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "publish", + "body": payload + } + return action + + + + + + + def recalculateNetworkFloorPlansAutoLocateJob(self, networkId: str, jobId: str, **kwargs): + """ + **Trigger auto locate recalculation for a job, and optionally set anchors** + https://developer.cisco.com/meraki/api-v1/#!recalculate-network-floor-plans-auto-locate-job + + - networkId (string): Network ID + - jobId (string): Job ID + - devices (array): The list of devices to update anchor positions for + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['networks', 'configure', 'floorPlans', 'autoLocate', 'jobs'], + 'operation': 'recalculateNetworkFloorPlansAutoLocateJob' + } + resource = f'/networks/{networkId}/floorPlans/autoLocate/jobs/{jobId}/recalculate' + + body_params = ['devices', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "recalculate", + "body": payload + } + return action + + + + + + + def batchNetworkFloorPlansDevicesUpdate(self, networkId: str, assignments: list): + """ + **Update floorplan assignments for a batch of devices** + https://developer.cisco.com/meraki/api-v1/#!batch-network-floor-plans-devices-update + + - networkId (string): Network ID + - assignments (array): List of floorplan assignments to update. Up to 100 floor plan assignments can be provided in a request. + """ + + kwargs = locals() + + metadata = { + 'tags': ['networks', 'configure', 'floorPlans', 'devices'], + 'operation': 'batchNetworkFloorPlansDevicesUpdate' + } + resource = f'/networks/{networkId}/floorPlans/devices/batchUpdate' + + body_params = ['assignments', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "batch_update", + "body": payload + } + return action + + + + + + def updateNetworkFloorPlan(self, networkId: str, floorPlanId: str, **kwargs): """ **Update a floor plan's geolocation and other meta data** diff --git a/meraki/api/batch/wireless.py b/meraki/api/batch/wireless.py index 2b8fc727..012e1847 100644 --- a/meraki/api/batch/wireless.py +++ b/meraki/api/batch/wireless.py @@ -698,6 +698,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): - number (string): Number - name (string): The name of the SSID - enabled (boolean): Whether or not the SSID is enabled + - localAuth (boolean): Extended local auth flag for Enterprise NAC - authMode (string): The association control method for the SSID ('open', 'open-enhanced', 'psk', 'open-with-radius', 'open-with-nac', '8021x-meraki', '8021x-nac', '8021x-radius', '8021x-google', '8021x-entra', '8021x-localradius', 'ipsk-with-radius', 'ipsk-without-radius' or 'ipsk-with-nac') - enterpriseAdminAccess (string): Whether or not an SSID is accessible by 'enterprise' administrators ('access disabled' or 'access enabled') - encryptionMode (string): The psk encryption mode for the SSID ('wep' or 'wpa'). This param is only valid if the authMode is 'psk' @@ -790,7 +791,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): } resource = f'/networks/{networkId}/wireless/ssids/{number}' - body_params = ['name', 'enabled', 'authMode', 'enterpriseAdminAccess', 'encryptionMode', 'psk', 'wpaEncryptionMode', 'dot11w', 'dot11r', 'splashPage', 'splashGuestSponsorDomains', 'oauth', 'localRadius', 'ldap', 'activeDirectory', 'radiusServers', 'radiusProxyEnabled', 'radiusTestingEnabled', 'radiusCalledStationId', 'radiusAuthenticationNasId', 'radiusServerTimeout', 'radiusServerAttemptsLimit', 'radiusFallbackEnabled', 'radiusCoaEnabled', 'radiusFailoverPolicy', 'radiusLoadBalancingPolicy', 'radiusAccountingEnabled', 'radiusAccountingServers', 'radiusAccountingInterimInterval', 'radiusAttributeForGroupPolicies', 'ipAssignmentMode', 'useVlanTagging', 'concentratorNetworkId', 'secondaryConcentratorNetworkId', 'disassociateClientsOnVpnFailover', 'vlanId', 'defaultVlanId', 'apTagsAndVlanIds', 'walledGardenEnabled', 'walledGardenRanges', 'gre', 'radiusOverride', 'radiusGuestVlanEnabled', 'radiusGuestVlanId', 'minBitrate', 'bandSelection', 'perClientBandwidthLimitUp', 'perClientBandwidthLimitDown', 'perSsidBandwidthLimitUp', 'perSsidBandwidthLimitDown', 'lanIsolationEnabled', 'visible', 'availableOnAllAps', 'availabilityTags', 'mandatoryDhcpEnabled', 'adultContentFilteringEnabled', 'dnsRewrite', 'speedBurst', 'namedVlans', ] + body_params = ['name', 'enabled', 'localAuth', 'authMode', 'enterpriseAdminAccess', 'encryptionMode', 'psk', 'wpaEncryptionMode', 'dot11w', 'dot11r', 'splashPage', 'splashGuestSponsorDomains', 'oauth', 'localRadius', 'ldap', 'activeDirectory', 'radiusServers', 'radiusProxyEnabled', 'radiusTestingEnabled', 'radiusCalledStationId', 'radiusAuthenticationNasId', 'radiusServerTimeout', 'radiusServerAttemptsLimit', 'radiusFallbackEnabled', 'radiusCoaEnabled', 'radiusFailoverPolicy', 'radiusLoadBalancingPolicy', 'radiusAccountingEnabled', 'radiusAccountingServers', 'radiusAccountingInterimInterval', 'radiusAttributeForGroupPolicies', 'ipAssignmentMode', 'useVlanTagging', 'concentratorNetworkId', 'secondaryConcentratorNetworkId', 'disassociateClientsOnVpnFailover', 'vlanId', 'defaultVlanId', 'apTagsAndVlanIds', 'walledGardenEnabled', 'walledGardenRanges', 'gre', 'radiusOverride', 'radiusGuestVlanEnabled', 'radiusGuestVlanId', 'minBitrate', 'bandSelection', 'perClientBandwidthLimitUp', 'perClientBandwidthLimitDown', 'perSsidBandwidthLimitUp', 'perSsidBandwidthLimitDown', 'lanIsolationEnabled', 'visible', 'availableOnAllAps', 'availabilityTags', 'mandatoryDhcpEnabled', 'adultContentFilteringEnabled', 'dnsRewrite', 'speedBurst', 'namedVlans', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { "resource": resource, @@ -1269,3 +1270,34 @@ def updateNetworkWirelessSsidVpn(self, networkId: str, number: str, **kwargs): + + + def recalculateOrganizationWirelessRadioAutoRfChannels(self, organizationId: str, networkIds: list): + """ + **Recalculates automatically assigned channels for every AP within specified the specified network(s). Note: This could cause a brief loss in connectivity for wireless clients.** + https://developer.cisco.com/meraki/api-v1/#!recalculate-organization-wireless-radio-auto-rf-channels + + - organizationId (string): Organization ID + - networkIds (array): A list of network ids (limit: 15). + """ + + kwargs = locals() + + metadata = { + 'tags': ['wireless', 'configure', 'radio', 'autoRf', 'channels'], + 'operation': 'recalculateOrganizationWirelessRadioAutoRfChannels' + } + resource = f'/organizations/{organizationId}/wireless/radio/autoRf/channels/recalculate' + + body_params = ['networkIds', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "update", + "body": payload + } + return action + + + + diff --git a/meraki/api/devices.py b/meraki/api/devices.py index d9bf9c54..a632ec44 100644 --- a/meraki/api/devices.py +++ b/meraki/api/devices.py @@ -252,6 +252,53 @@ def getDeviceLiveToolsCableTest(self, serial: str, id: str): + def createDeviceLiveToolsLedsBlink(self, serial: str, duration: int, **kwargs): + """ + **Enqueue a job to blink LEDs on a device** + https://developer.cisco.com/meraki/api-v1/#!create-device-live-tools-leds-blink + + - serial (string): Serial + - duration (integer): The duration in seconds to blink LEDs. + - callback (object): Details for the callback. Please include either an httpServerId OR url and sharedSecret + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['devices', 'liveTools', 'leds', 'blink'], + 'operation': 'createDeviceLiveToolsLedsBlink' + } + serial = urllib.parse.quote(str(serial), safe='') + resource = f'/devices/{serial}/liveTools/leds/blink' + + body_params = ['duration', 'callback', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.post(metadata, resource, payload) + + + + def getDeviceLiveToolsLedsBlink(self, serial: str, ledsBlinkId: str): + """ + **Return a blink LEDs job** + https://developer.cisco.com/meraki/api-v1/#!get-device-live-tools-leds-blink + + - serial (string): Serial + - ledsBlinkId (string): Leds blink ID + """ + + metadata = { + 'tags': ['devices', 'liveTools', 'leds', 'blink'], + 'operation': 'getDeviceLiveToolsLedsBlink' + } + serial = urllib.parse.quote(str(serial), safe='') + ledsBlinkId = urllib.parse.quote(str(ledsBlinkId), safe='') + resource = f'/devices/{serial}/liveTools/leds/blink/{ledsBlinkId}' + + return self._session.get(metadata, resource) + + + def createDeviceLiveToolsPing(self, serial: str, target: str, **kwargs): """ **Enqueue a job to ping a target host from the device** diff --git a/meraki/api/networks.py b/meraki/api/networks.py index a6ac741c..9747ba60 100644 --- a/meraki/api/networks.py +++ b/meraki/api/networks.py @@ -1201,6 +1201,131 @@ def createNetworkFloorPlan(self, networkId: str, name: str, imageContents: str, + def batchNetworkFloorPlansAutoLocateJobs(self, networkId: str, jobs: list): + """ + **Schedule auto locate jobs for one or more floor plans in a network** + https://developer.cisco.com/meraki/api-v1/#!batch-network-floor-plans-auto-locate-jobs + + - networkId (string): Network ID + - jobs (array): The list of auto locate jobs to be scheduled. Up to 100 jobs can be provided in a request. + """ + + kwargs = locals() + + metadata = { + 'tags': ['networks', 'configure', 'floorPlans', 'autoLocate', 'jobs'], + 'operation': 'batchNetworkFloorPlansAutoLocateJobs' + } + networkId = urllib.parse.quote(str(networkId), safe='') + resource = f'/networks/{networkId}/floorPlans/autoLocate/jobs/batch' + + body_params = ['jobs', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.post(metadata, resource, payload) + + + + def cancelNetworkFloorPlansAutoLocateJob(self, networkId: str, jobId: str): + """ + **Cancel a scheduled or running auto locate job** + https://developer.cisco.com/meraki/api-v1/#!cancel-network-floor-plans-auto-locate-job + + - networkId (string): Network ID + - jobId (string): Job ID + """ + + metadata = { + 'tags': ['networks', 'configure', 'floorPlans', 'autoLocate', 'jobs'], + 'operation': 'cancelNetworkFloorPlansAutoLocateJob' + } + networkId = urllib.parse.quote(str(networkId), safe='') + jobId = urllib.parse.quote(str(jobId), safe='') + resource = f'/networks/{networkId}/floorPlans/autoLocate/jobs/{jobId}/cancel' + + return self._session.post(metadata, resource) + + + + def publishNetworkFloorPlansAutoLocateJob(self, networkId: str, jobId: str, **kwargs): + """ + **Update the status of a finished auto locate job to be published, and update device locations** + https://developer.cisco.com/meraki/api-v1/#!publish-network-floor-plans-auto-locate-job + + - networkId (string): Network ID + - jobId (string): Job ID + - devices (array): The list of devices to publish positions for + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['networks', 'configure', 'floorPlans', 'autoLocate', 'jobs'], + 'operation': 'publishNetworkFloorPlansAutoLocateJob' + } + networkId = urllib.parse.quote(str(networkId), safe='') + jobId = urllib.parse.quote(str(jobId), safe='') + resource = f'/networks/{networkId}/floorPlans/autoLocate/jobs/{jobId}/publish' + + body_params = ['devices', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.post(metadata, resource, payload) + + + + def recalculateNetworkFloorPlansAutoLocateJob(self, networkId: str, jobId: str, **kwargs): + """ + **Trigger auto locate recalculation for a job, and optionally set anchors** + https://developer.cisco.com/meraki/api-v1/#!recalculate-network-floor-plans-auto-locate-job + + - networkId (string): Network ID + - jobId (string): Job ID + - devices (array): The list of devices to update anchor positions for + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['networks', 'configure', 'floorPlans', 'autoLocate', 'jobs'], + 'operation': 'recalculateNetworkFloorPlansAutoLocateJob' + } + networkId = urllib.parse.quote(str(networkId), safe='') + jobId = urllib.parse.quote(str(jobId), safe='') + resource = f'/networks/{networkId}/floorPlans/autoLocate/jobs/{jobId}/recalculate' + + body_params = ['devices', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.post(metadata, resource, payload) + + + + def batchNetworkFloorPlansDevicesUpdate(self, networkId: str, assignments: list): + """ + **Update floorplan assignments for a batch of devices** + https://developer.cisco.com/meraki/api-v1/#!batch-network-floor-plans-devices-update + + - networkId (string): Network ID + - assignments (array): List of floorplan assignments to update. Up to 100 floor plan assignments can be provided in a request. + """ + + kwargs = locals() + + metadata = { + 'tags': ['networks', 'configure', 'floorPlans', 'devices'], + 'operation': 'batchNetworkFloorPlansDevicesUpdate' + } + networkId = urllib.parse.quote(str(networkId), safe='') + resource = f'/networks/{networkId}/floorPlans/devices/batchUpdate' + + body_params = ['assignments', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.post(metadata, resource, payload) + + + def getNetworkFloorPlan(self, networkId: str, floorPlanId: str): """ **Find a floor plan by ID** diff --git a/meraki/api/organizations.py b/meraki/api/organizations.py index c7dcf36b..35b6a9bf 100644 --- a/meraki/api/organizations.py +++ b/meraki/api/organizations.py @@ -1908,7 +1908,7 @@ def getOrganizationDevicesAvailabilities(self, organizationId: str, total_pages= - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - networkIds (array): Optional parameter to filter device availabilities by network ID. This filter uses multiple exact matches. - - productTypes (array): Optional parameter to filter device availabilities by device product types. This filter uses multiple exact matches. Valid types are wireless, appliance, switch, camera, cellularGateway, sensor, and wirelessController + - productTypes (array): Optional parameter to filter device availabilities by device product types. This filter uses multiple exact matches. Valid types are wireless, appliance, switch, camera, cellularGateway, sensor, wirelessController, and campusGateway - serials (array): Optional parameter to filter device availabilities by device serial numbers. This filter uses multiple exact matches. - tags (array): An optional parameter to filter devices by tags. The filtering is case-sensitive. If tags are included, 'tagsFilterType' should also be included (see below). This filter uses multiple exact matches. - tagsFilterType (string): An optional parameter of value 'withAnyTags' or 'withAllTags' to indicate whether to return devices which contain ANY or ALL of the included tags. If no type is included, 'withAnyTags' will be selected. @@ -2500,6 +2500,80 @@ def getOrganizationFirmwareUpgradesByDevice(self, organizationId: str, total_pag + def getOrganizationFloorPlansAutoLocateDevices(self, organizationId: str, total_pages=1, direction='next', **kwargs): + """ + **List auto locate details for each device in your organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-floor-plans-auto-locate-devices + + - 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 + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. 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. + - networkIds (array): Optional parameter to filter devices by one or more network IDs + - floorPlanIds (array): Optional parameter to filter devices by one or more floorplan IDs + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['organizations', 'configure', 'floorPlans', 'autoLocate', 'devices'], + 'operation': 'getOrganizationFloorPlansAutoLocateDevices' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/floorPlans/autoLocate/devices' + + query_params = ['perPage', 'startingAfter', 'endingBefore', 'networkIds', 'floorPlanIds', ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = ['networkIds', 'floorPlanIds', ] + 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 getOrganizationFloorPlansAutoLocateStatuses(self, organizationId: str, total_pages=1, direction='next', **kwargs): + """ + **List the status of auto locate for each floorplan in your organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-floor-plans-auto-locate-statuses + + - 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 + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 10000. 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. + - networkIds (array): Optional parameter to filter floorplans by one or more network IDs + - floorPlanIds (array): Optional parameter to filter floorplans by one or more floorplan IDs + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['organizations', 'configure', 'floorPlans', 'autoLocate', 'statuses'], + 'operation': 'getOrganizationFloorPlansAutoLocateStatuses' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/floorPlans/autoLocate/statuses' + + query_params = ['perPage', 'startingAfter', 'endingBefore', 'networkIds', 'floorPlanIds', ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = ['networkIds', 'floorPlanIds', ] + 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 claimIntoOrganizationInventory(self, organizationId: str, **kwargs): """ **Claim a list of devices, licenses, and/or orders into an organization inventory** diff --git a/meraki/api/switch.py b/meraki/api/switch.py index dace7652..2aef3e44 100644 --- a/meraki/api/switch.py +++ b/meraki/api/switch.py @@ -2596,3 +2596,46 @@ def getOrganizationSwitchPortsOverview(self, organizationId: str, **kwargs): return self._session.get(metadata, resource, params) + + + def getOrganizationSwitchPortsStatusesBySwitch(self, organizationId: str, total_pages=1, direction='next', **kwargs): + """ + **List the switchports in an organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-switch-ports-statuses-by-switch + + - 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 + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 20. Default is 10. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - configurationUpdatedAfter (string): Optional parameter to filter items to switches where the configuration has been updated after the given timestamp. + - mac (string): Optional parameter to filter items to switches with MAC addresses that contain the search term or are an exact match. + - macs (array): Optional parameter to filter items to switches that have one of the provided MAC addresses. + - name (string): Optional parameter to filter items to switches with names that contain the search term or are an exact match. + - networkIds (array): Optional parameter to filter items to switches in one of the provided networks. + - portProfileIds (array): Optional parameter to filter items to switches that contain switchports belonging to one of the specified port profiles. + - serial (string): Optional parameter to filter items to switches with serial number that contains the search term or are an exact match. + - serials (array): Optional parameter to filter items to switches that have one of the provided serials. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['switch', 'monitor', 'ports', 'statuses', 'bySwitch'], + 'operation': 'getOrganizationSwitchPortsStatusesBySwitch' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/switch/ports/statuses/bySwitch' + + query_params = ['perPage', 'startingAfter', 'endingBefore', 'configurationUpdatedAfter', 'mac', 'macs', 'name', 'networkIds', 'portProfileIds', 'serial', 'serials', ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = ['macs', 'networkIds', 'portProfileIds', 'serials', ] + 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/wireless.py b/meraki/api/wireless.py index b5ef749a..0f122c0e 100644 --- a/meraki/api/wireless.py +++ b/meraki/api/wireless.py @@ -1665,6 +1665,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): - number (string): Number - name (string): The name of the SSID - enabled (boolean): Whether or not the SSID is enabled + - localAuth (boolean): Extended local auth flag for Enterprise NAC - authMode (string): The association control method for the SSID ('open', 'open-enhanced', 'psk', 'open-with-radius', 'open-with-nac', '8021x-meraki', '8021x-nac', '8021x-radius', '8021x-google', '8021x-entra', '8021x-localradius', 'ipsk-with-radius', 'ipsk-without-radius' or 'ipsk-with-nac') - enterpriseAdminAccess (string): Whether or not an SSID is accessible by 'enterprise' administrators ('access disabled' or 'access enabled') - encryptionMode (string): The psk encryption mode for the SSID ('wep' or 'wpa'). This param is only valid if the authMode is 'psk' @@ -1759,7 +1760,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): number = urllib.parse.quote(str(number), safe='') resource = f'/networks/{networkId}/wireless/ssids/{number}' - body_params = ['name', 'enabled', 'authMode', 'enterpriseAdminAccess', 'encryptionMode', 'psk', 'wpaEncryptionMode', 'dot11w', 'dot11r', 'splashPage', 'splashGuestSponsorDomains', 'oauth', 'localRadius', 'ldap', 'activeDirectory', 'radiusServers', 'radiusProxyEnabled', 'radiusTestingEnabled', 'radiusCalledStationId', 'radiusAuthenticationNasId', 'radiusServerTimeout', 'radiusServerAttemptsLimit', 'radiusFallbackEnabled', 'radiusCoaEnabled', 'radiusFailoverPolicy', 'radiusLoadBalancingPolicy', 'radiusAccountingEnabled', 'radiusAccountingServers', 'radiusAccountingInterimInterval', 'radiusAttributeForGroupPolicies', 'ipAssignmentMode', 'useVlanTagging', 'concentratorNetworkId', 'secondaryConcentratorNetworkId', 'disassociateClientsOnVpnFailover', 'vlanId', 'defaultVlanId', 'apTagsAndVlanIds', 'walledGardenEnabled', 'walledGardenRanges', 'gre', 'radiusOverride', 'radiusGuestVlanEnabled', 'radiusGuestVlanId', 'minBitrate', 'bandSelection', 'perClientBandwidthLimitUp', 'perClientBandwidthLimitDown', 'perSsidBandwidthLimitUp', 'perSsidBandwidthLimitDown', 'lanIsolationEnabled', 'visible', 'availableOnAllAps', 'availabilityTags', 'mandatoryDhcpEnabled', 'adultContentFilteringEnabled', 'dnsRewrite', 'speedBurst', 'namedVlans', ] + body_params = ['name', 'enabled', 'localAuth', 'authMode', 'enterpriseAdminAccess', 'encryptionMode', 'psk', 'wpaEncryptionMode', 'dot11w', 'dot11r', 'splashPage', 'splashGuestSponsorDomains', 'oauth', 'localRadius', 'ldap', 'activeDirectory', 'radiusServers', 'radiusProxyEnabled', 'radiusTestingEnabled', 'radiusCalledStationId', 'radiusAuthenticationNasId', 'radiusServerTimeout', 'radiusServerAttemptsLimit', 'radiusFallbackEnabled', 'radiusCoaEnabled', 'radiusFailoverPolicy', 'radiusLoadBalancingPolicy', 'radiusAccountingEnabled', 'radiusAccountingServers', 'radiusAccountingInterimInterval', 'radiusAttributeForGroupPolicies', 'ipAssignmentMode', 'useVlanTagging', 'concentratorNetworkId', 'secondaryConcentratorNetworkId', 'disassociateClientsOnVpnFailover', 'vlanId', 'defaultVlanId', 'apTagsAndVlanIds', 'walledGardenEnabled', 'walledGardenRanges', 'gre', 'radiusOverride', 'radiusGuestVlanEnabled', 'radiusGuestVlanId', 'minBitrate', 'bandSelection', 'perClientBandwidthLimitUp', 'perClientBandwidthLimitDown', 'perSsidBandwidthLimitUp', 'perSsidBandwidthLimitDown', 'lanIsolationEnabled', 'visible', 'availableOnAllAps', 'availabilityTags', 'mandatoryDhcpEnabled', 'adultContentFilteringEnabled', 'dnsRewrite', 'speedBurst', 'namedVlans', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} return self._session.put(metadata, resource, payload) @@ -2936,6 +2937,31 @@ def getOrganizationWirelessDevicesWirelessControllersByDevice(self, organization + def recalculateOrganizationWirelessRadioAutoRfChannels(self, organizationId: str, networkIds: list): + """ + **Recalculates automatically assigned channels for every AP within specified the specified network(s)** + https://developer.cisco.com/meraki/api-v1/#!recalculate-organization-wireless-radio-auto-rf-channels + + - organizationId (string): Organization ID + - networkIds (array): A list of network ids (limit: 15). + """ + + kwargs = locals() + + metadata = { + 'tags': ['wireless', 'configure', 'radio', 'autoRf', 'channels'], + 'operation': 'recalculateOrganizationWirelessRadioAutoRfChannels' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/wireless/radio/autoRf/channels/recalculate' + + body_params = ['networkIds', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.post(metadata, resource, payload) + + + def getOrganizationWirelessRfProfilesAssignmentsByDevice(self, organizationId: str, total_pages=1, direction='next', **kwargs): """ **List the RF profiles of an organization by device**