From 918341d7b972e14483a8feb39e95517900a211bd Mon Sep 17 00:00:00 2001 From: "John M. Kuchta" Date: Mon, 11 Sep 2023 10:34:05 -0400 Subject: [PATCH] Automatically regenerated library. (#225) Co-authored-by: GitHub Action --- meraki/__init__.py | 2 +- meraki/aio/api/appliance.py | 62 +++++++++ meraki/aio/api/camera.py | 159 +++++++++++++++++++++++ meraki/aio/api/networks.py | 189 ++++++++++++++++++++++++++- meraki/aio/api/organizations.py | 35 ++++- meraki/aio/api/sensor.py | 2 +- meraki/aio/api/switch.py | 3 +- meraki/aio/api/wireless.py | 219 ++++++++++++++++++++++++++++++-- meraki/api/appliance.py | 62 +++++++++ meraki/api/batch/appliance.py | 32 +++++ meraki/api/batch/networks.py | 63 ++++++++- meraki/api/batch/switch.py | 3 +- meraki/api/batch/wireless.py | 193 +++++++++++++++++++++++++++- meraki/api/camera.py | 159 +++++++++++++++++++++++ meraki/api/networks.py | 189 ++++++++++++++++++++++++++- meraki/api/organizations.py | 35 ++++- meraki/api/sensor.py | 2 +- meraki/api/switch.py | 3 +- meraki/api/wireless.py | 219 ++++++++++++++++++++++++++++++-- 19 files changed, 1592 insertions(+), 39 deletions(-) diff --git a/meraki/__init__.py b/meraki/__init__.py index d42ebb4..77f25e1 100644 --- a/meraki/__init__.py +++ b/meraki/__init__.py @@ -45,7 +45,7 @@ USE_ITERATOR_FOR_GET_PAGES, ) -__version__ = '1.36.0' +__version__ = '1.37.1' class DashboardAPI(object): diff --git a/meraki/aio/api/appliance.py b/meraki/aio/api/appliance.py index d0ccc0d..134c7ff 100644 --- a/meraki/aio/api/appliance.py +++ b/meraki/aio/api/appliance.py @@ -1900,6 +1900,32 @@ def updateNetworkApplianceTrafficShapingUplinkSelection(self, networkId: str, ** + def updateNetworkApplianceTrafficShapingVpnExclusions(self, networkId: str, **kwargs): + """ + **Update VPN exclusion rules for an MX network.** + https://developer.cisco.com/meraki/api-v1/#!update-network-appliance-traffic-shaping-vpn-exclusions + + - networkId (string): Network ID + - custom (array): Custom VPN exclusion rules. Pass an empty array to clear existing rules. + - majorApplications (array): Major Application based VPN exclusion rules. Pass an empty array to clear existing rules. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['appliance', 'configure', 'trafficShaping', 'vpnExclusions'], + 'operation': 'updateNetworkApplianceTrafficShapingVpnExclusions' + } + networkId = urllib.parse.quote(str(networkId), safe='') + resource = f'/networks/{networkId}/appliance/trafficShaping/vpnExclusions' + + body_params = ['custom', 'majorApplications', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.put(metadata, resource, payload) + + + def getNetworkApplianceUplinksUsageHistory(self, networkId: str, **kwargs): """ **Get the sent and received bytes for each uplink of a network.** @@ -2372,6 +2398,42 @@ def updateOrganizationApplianceSecurityIntrusion(self, organizationId: str, allo + def getOrganizationApplianceTrafficShapingVpnExclusionsByNetwork(self, organizationId: str, total_pages=1, direction='next', **kwargs): + """ + **Display VPN exclusion rules for MX networks.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-traffic-shaping-vpn-exclusions-by-network + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 50. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - networkIds (array): Optional parameter to filter the results by network IDs + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['appliance', 'configure', 'trafficShaping', 'vpnExclusions', 'byNetwork'], + 'operation': 'getOrganizationApplianceTrafficShapingVpnExclusionsByNetwork' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/appliance/trafficShaping/vpnExclusions/byNetwork' + + query_params = ['perPage', 'startingAfter', 'endingBefore', 'networkIds', ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = ['networkIds', ] + 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 getOrganizationApplianceUplinkStatuses(self, organizationId: str, total_pages=1, direction='next', **kwargs): """ **List the uplink status of every Meraki MX and Z series appliances in the organization** diff --git a/meraki/aio/api/camera.py b/meraki/aio/api/camera.py index 54f6f26..415a6a2 100644 --- a/meraki/aio/api/camera.py +++ b/meraki/aio/api/camera.py @@ -860,3 +860,162 @@ def updateOrganizationCameraOnboardingStatuses(self, organizationId: str, **kwar return self._session.put(metadata, resource, payload) + + + def getOrganizationCameraPermissions(self, organizationId: str): + """ + **List the permissions scopes for this organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-camera-permissions + + - organizationId (string): Organization ID + """ + + metadata = { + 'tags': ['camera', 'configure', 'permissions'], + 'operation': 'getOrganizationCameraPermissions' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/camera/permissions' + + return self._session.get(metadata, resource) + + + + def getOrganizationCameraPermission(self, organizationId: str, permissionScopeId: str): + """ + **Retrieve a single permission scope** + https://developer.cisco.com/meraki/api-v1/#!get-organization-camera-permission + + - organizationId (string): Organization ID + - permissionScopeId (string): Permission scope ID + """ + + metadata = { + 'tags': ['camera', 'configure', 'permissions'], + 'operation': 'getOrganizationCameraPermission' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + permissionScopeId = urllib.parse.quote(str(permissionScopeId), safe='') + resource = f'/organizations/{organizationId}/camera/permissions/{permissionScopeId}' + + return self._session.get(metadata, resource) + + + + def getOrganizationCameraRoles(self, organizationId: str): + """ + **List all the roles in this organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-camera-roles + + - organizationId (string): Organization ID + """ + + metadata = { + 'tags': ['camera', 'configure', 'roles'], + 'operation': 'getOrganizationCameraRoles' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/camera/roles' + + return self._session.get(metadata, resource) + + + + def createOrganizationCameraRole(self, organizationId: str, name: str, **kwargs): + """ + **Creates new role for this organization.** + https://developer.cisco.com/meraki/api-v1/#!create-organization-camera-role + + - organizationId (string): Organization ID + - name (string): The name of the new role. Must be unique. This parameter is required. + - appliedOnDevices (array): Device tag on which this specified permission is applied. + - appliedOnNetworks (array): Network tag on which this specified permission is applied. + - appliedOrgWide (array): Permissions to be applied org wide. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['camera', 'configure', 'roles'], + 'operation': 'createOrganizationCameraRole' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/camera/roles' + + body_params = ['name', 'appliedOnDevices', 'appliedOnNetworks', 'appliedOrgWide', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.post(metadata, resource, payload) + + + + def getOrganizationCameraRole(self, organizationId: str, roleId: str): + """ + **Retrieve a single role.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-camera-role + + - organizationId (string): Organization ID + - roleId (string): Role ID + """ + + metadata = { + 'tags': ['camera', 'configure', 'roles'], + 'operation': 'getOrganizationCameraRole' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + roleId = urllib.parse.quote(str(roleId), safe='') + resource = f'/organizations/{organizationId}/camera/roles/{roleId}' + + return self._session.get(metadata, resource) + + + + def deleteOrganizationCameraRole(self, organizationId: str, roleId: str): + """ + **Delete an existing role for this organization.** + https://developer.cisco.com/meraki/api-v1/#!delete-organization-camera-role + + - organizationId (string): Organization ID + - roleId (string): Role ID + """ + + metadata = { + 'tags': ['camera', 'configure', 'roles'], + 'operation': 'deleteOrganizationCameraRole' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + roleId = urllib.parse.quote(str(roleId), safe='') + resource = f'/organizations/{organizationId}/camera/roles/{roleId}' + + return self._session.delete(metadata, resource) + + + + def updateOrganizationCameraRole(self, organizationId: str, roleId: str, **kwargs): + """ + **Update an existing role in this organization.** + https://developer.cisco.com/meraki/api-v1/#!update-organization-camera-role + + - organizationId (string): Organization ID + - roleId (string): Role ID + - name (string): The name of the new role. Must be unique. + - appliedOnDevices (array): Device tag on which this specified permission is applied. + - appliedOnNetworks (array): Network tag on which this specified permission is applied. + - appliedOrgWide (array): Permissions to be applied org wide. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['camera', 'configure', 'roles'], + 'operation': 'updateOrganizationCameraRole' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + roleId = urllib.parse.quote(str(roleId), safe='') + resource = f'/organizations/{organizationId}/camera/roles/{roleId}' + + body_params = ['name', 'appliedOnDevices', 'appliedOnNetworks', 'appliedOrgWide', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.put(metadata, resource, payload) + diff --git a/meraki/aio/api/networks.py b/meraki/aio/api/networks.py index d3ce930..f5f976f 100644 --- a/meraki/aio/api/networks.py +++ b/meraki/aio/api/networks.py @@ -258,6 +258,7 @@ def getNetworkClients(self, networkId: str, total_pages=1, direction='next', **k - pskGroup (string): Filters clients based on partial or full match for the iPSK name field. - description (string): Filters clients based on a partial or full match for the description field. - vlan (string): Filters clients based on the full match for the VLAN field. + - namedVlan (string): Filters clients based on the partial or full match for the named VLAN field. - recentDeviceConnections (array): Filters clients based on recent connection type. Can be one of 'Wired' or 'Wireless'. """ @@ -270,7 +271,7 @@ def getNetworkClients(self, networkId: str, total_pages=1, direction='next', **k networkId = urllib.parse.quote(str(networkId), safe='') resource = f'/networks/{networkId}/clients' - query_params = ['t0', 'timespan', 'perPage', 'startingAfter', 'endingBefore', 'statuses', 'ip', 'ip6', 'ip6Local', 'mac', 'os', 'pskGroup', 'description', 'vlan', 'recentDeviceConnections', ] + query_params = ['t0', 'timespan', 'perPage', 'startingAfter', 'endingBefore', 'statuses', 'ip', 'ip6', 'ip6Local', 'mac', 'os', 'pskGroup', 'description', 'vlan', 'namedVlan', 'recentDeviceConnections', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = ['statuses', 'recentDeviceConnections', ] @@ -2008,6 +2009,7 @@ def updateNetworkSettings(self, networkId: str, **kwargs): - remoteStatusPageEnabled (boolean): Enables / disables access to the device status page (http://[device's LAN IP]). Optional. Can only be set if localStatusPageEnabled is set to true - localStatusPage (object): A hash of Local Status page(s)' authentication options applied to the Network. - securePort (object): A hash of SecureConnect options applied to the Network. + - namedVlans (object): A hash of Named VLANs options applied to the Network. """ kwargs.update(locals()) @@ -2019,7 +2021,7 @@ def updateNetworkSettings(self, networkId: str, **kwargs): networkId = urllib.parse.quote(str(networkId), safe='') resource = f'/networks/{networkId}/settings' - body_params = ['localStatusPageEnabled', 'remoteStatusPageEnabled', 'localStatusPage', 'securePort', ] + body_params = ['localStatusPageEnabled', 'remoteStatusPageEnabled', 'localStatusPage', 'securePort', 'namedVlans', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} return self._session.put(metadata, resource, payload) @@ -2334,6 +2336,189 @@ def unbindNetwork(self, networkId: str, **kwargs): + def getNetworkVlanProfiles(self, networkId: str): + """ + **List VLAN profiles for a network** + https://developer.cisco.com/meraki/api-v1/#!get-network-vlan-profiles + + - networkId (string): Network ID + """ + + metadata = { + 'tags': ['networks', 'configure', 'vlanProfiles'], + 'operation': 'getNetworkVlanProfiles' + } + networkId = urllib.parse.quote(str(networkId), safe='') + resource = f'/networks/{networkId}/vlanProfiles' + + return self._session.get(metadata, resource) + + + + def createNetworkVlanProfile(self, networkId: str, name: str, vlanNames: list, vlanGroups: list, iname: str): + """ + **Create a VLAN profile for a network** + https://developer.cisco.com/meraki/api-v1/#!create-network-vlan-profile + + - networkId (string): Network ID + - name (string): Name of the profile, string length must be from 1 to 255 characters + - vlanNames (array): An array of named VLANs + - vlanGroups (array): An array of VLAN groups + - iname (string): IName of the profile + """ + + kwargs = locals() + + metadata = { + 'tags': ['networks', 'configure', 'vlanProfiles'], + 'operation': 'createNetworkVlanProfile' + } + networkId = urllib.parse.quote(str(networkId), safe='') + resource = f'/networks/{networkId}/vlanProfiles' + + body_params = ['name', 'vlanNames', 'vlanGroups', 'iname', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.post(metadata, resource, payload) + + + + def getNetworkVlanProfilesAssignmentsByDevice(self, networkId: str, total_pages=1, direction='next', **kwargs): + """ + **Get the assigned VLAN Profiles for devices in a network** + https://developer.cisco.com/meraki/api-v1/#!get-network-vlan-profiles-assignments-by-device + + - networkId (string): Network 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 - 1000. Default is 1000. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - serials (array): Optional parameter to filter devices by serials. All devices returned belong to serial numbers that are an exact match. + - productTypes (array): Optional parameter to filter devices by product types. + - stackIds (array): Optional parameter to filter devices by Switch Stack ids. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['networks', 'configure', 'vlanProfiles', 'assignments', 'byDevice'], + 'operation': 'getNetworkVlanProfilesAssignmentsByDevice' + } + networkId = urllib.parse.quote(str(networkId), safe='') + resource = f'/networks/{networkId}/vlanProfiles/assignments/byDevice' + + query_params = ['perPage', 'startingAfter', 'endingBefore', 'serials', 'productTypes', 'stackIds', ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = ['serials', 'productTypes', 'stackIds', ] + 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 reassignNetworkVlanProfilesAssignments(self, networkId: str, serials: list, stackIds: list, **kwargs): + """ + **Update the assigned VLAN Profile for devices in a network** + https://developer.cisco.com/meraki/api-v1/#!reassign-network-vlan-profiles-assignments + + - networkId (string): Network ID + - serials (array): Array of Device Serials + - stackIds (array): Array of Switch Stack IDs + - vlanProfile (object): The VLAN Profile + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['networks', 'configure', 'vlanProfiles', 'assignments'], + 'operation': 'reassignNetworkVlanProfilesAssignments' + } + networkId = urllib.parse.quote(str(networkId), safe='') + resource = f'/networks/{networkId}/vlanProfiles/assignments/reassign' + + body_params = ['vlanProfile', 'serials', 'stackIds', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.post(metadata, resource, payload) + + + + def getNetworkVlanProfile(self, networkId: str, iname: str): + """ + **Get an existing VLAN profile of a network** + https://developer.cisco.com/meraki/api-v1/#!get-network-vlan-profile + + - networkId (string): Network ID + - iname (string): Iname + """ + + metadata = { + 'tags': ['networks', 'configure', 'vlanProfiles'], + 'operation': 'getNetworkVlanProfile' + } + networkId = urllib.parse.quote(str(networkId), safe='') + iname = urllib.parse.quote(str(iname), safe='') + resource = f'/networks/{networkId}/vlanProfiles/{iname}' + + return self._session.get(metadata, resource) + + + + def updateNetworkVlanProfile(self, networkId: str, iname: str, name: str, vlanNames: list, vlanGroups: list): + """ + **Update an existing VLAN profile of a network** + https://developer.cisco.com/meraki/api-v1/#!update-network-vlan-profile + + - networkId (string): Network ID + - iname (string): Iname + - name (string): Name of the profile, string length must be from 1 to 255 characters + - vlanNames (array): An array of named VLANs + - vlanGroups (array): An array of VLAN groups + """ + + kwargs = locals() + + metadata = { + 'tags': ['networks', 'configure', 'vlanProfiles'], + 'operation': 'updateNetworkVlanProfile' + } + networkId = urllib.parse.quote(str(networkId), safe='') + iname = urllib.parse.quote(str(iname), safe='') + resource = f'/networks/{networkId}/vlanProfiles/{iname}' + + body_params = ['name', 'vlanNames', 'vlanGroups', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.put(metadata, resource, payload) + + + + def deleteNetworkVlanProfile(self, networkId: str, iname: str): + """ + **Delete a VLAN profile of a network** + https://developer.cisco.com/meraki/api-v1/#!delete-network-vlan-profile + + - networkId (string): Network ID + - iname (string): Iname + """ + + metadata = { + 'tags': ['networks', 'configure', 'vlanProfiles'], + 'operation': 'deleteNetworkVlanProfile' + } + networkId = urllib.parse.quote(str(networkId), safe='') + iname = urllib.parse.quote(str(iname), safe='') + resource = f'/networks/{networkId}/vlanProfiles/{iname}' + + return self._session.delete(metadata, resource) + + + def getNetworkWebhooksHttpServers(self, networkId: str): """ **List the HTTP servers for a network** diff --git a/meraki/aio/api/organizations.py b/meraki/aio/api/organizations.py index 60607fb..bfd55fa 100644 --- a/meraki/aio/api/organizations.py +++ b/meraki/aio/api/organizations.py @@ -1620,7 +1620,7 @@ def getOrganizationDevicesAvailabilitiesChangeHistory(self, organizationId: str, def getOrganizationDevicesPowerModulesStatusesByDevice(self, organizationId: str, total_pages=1, direction='next', **kwargs): """ - **List the power status information for devices in an organization** + **List the most recent status information for power modules in rackmount MX and MS devices that support them** https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-power-modules-statuses-by-device - organizationId (string): Organization ID @@ -3563,6 +3563,39 @@ def getOrganizationUplinksStatuses(self, organizationId: str, total_pages=1, dir + def getOrganizationUplinksLossAndLatency(self, organizationId: str, **kwargs): + """ + **Return the uplink loss and latency for every MX in the organization from at latest 2 minutes ago** + https://developer.cisco.com/meraki/api-v1/#!get-organization-uplinks-loss-and-latency + + - organizationId (string): Organization ID + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 60 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 5 minutes after t0. The latest possible time that t1 can be is 2 minutes into the past. + - 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 5 minutes. The default is 5 minutes. + - uplink (string): Optional filter for a specific WAN uplink. Valid uplinks are wan1, wan2, wan3, cellular. Default will return all uplinks. + - ip (string): Optional filter for a specific destination IP. Default will return all destination IPs. + """ + + kwargs.update(locals()) + + if 'uplink' in kwargs: + options = ['cellular', 'wan1', 'wan2', 'wan3'] + assert kwargs['uplink'] in options, f'''"uplink" cannot be "{kwargs['uplink']}", & must be set to one of: {options}''' + + metadata = { + 'tags': ['organizations', 'monitor', 'uplinksLossAndLatency'], + 'operation': 'getOrganizationUplinksLossAndLatency' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/uplinksLossAndLatency' + + query_params = ['t0', 't1', 'timespan', 'uplink', 'ip', ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + return self._session.get(metadata, resource, params) + + + def getOrganizationWebhooksAlertTypes(self, organizationId: str, **kwargs): """ **Return a list of alert types to be used with managing webhook alerts** diff --git a/meraki/aio/api/sensor.py b/meraki/aio/api/sensor.py index 890ddd3..7796a18 100644 --- a/meraki/aio/api/sensor.py +++ b/meraki/aio/api/sensor.py @@ -355,7 +355,7 @@ def getOrganizationSensorReadingsLatest(self, organizationId: str, total_pages=1 - 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 - 100. Default is 100. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - networkIds (array): Optional parameter to filter readings by network. diff --git a/meraki/aio/api/switch.py b/meraki/aio/api/switch.py index d351afd..209ee46 100644 --- a/meraki/aio/api/switch.py +++ b/meraki/aio/api/switch.py @@ -1732,6 +1732,7 @@ def updateNetworkSwitchSettings(self, networkId: str, **kwargs): - useCombinedPower (boolean): The use Combined Power as the default behavior of secondary power supplies on supported devices. - powerExceptions (array): Exceptions on a per switch basis to "useCombinedPower" - uplinkClientSampling (object): Uplink client sampling + - macBlocklist (object): MAC blocklist """ kwargs.update(locals()) @@ -1743,7 +1744,7 @@ def updateNetworkSwitchSettings(self, networkId: str, **kwargs): networkId = urllib.parse.quote(str(networkId), safe='') resource = f'/networks/{networkId}/switch/settings' - body_params = ['vlan', 'useCombinedPower', 'powerExceptions', 'uplinkClientSampling', ] + body_params = ['vlan', 'useCombinedPower', 'powerExceptions', 'uplinkClientSampling', 'macBlocklist', ] 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 48cdecc..d2fde13 100644 --- a/meraki/aio/api/wireless.py +++ b/meraki/aio/api/wireless.py @@ -8,27 +8,25 @@ def __init__(self, session): - def updateDeviceWirelessBluetoothSettings(self, serial: str, **kwargs): + def updateDeviceWirelessAlternateManagementInterfaceIpv6(self, serial: str, **kwargs): """ - **Update the bluetooth settings for a wireless device** - https://developer.cisco.com/meraki/api-v1/#!update-device-wireless-bluetooth-settings + **Update alternate management interface IPv6 address** + https://developer.cisco.com/meraki/api-v1/#!update-device-wireless-alternate-management-interface-ipv-6 - serial (string): Serial - - uuid (string): Desired UUID of the beacon. If the value is set to null it will reset to Dashboard's automatically generated value. - - major (integer): Desired major value of the beacon. If the value is set to null it will reset to Dashboard's automatically generated value. - - minor (integer): Desired minor value of the beacon. If the value is set to null it will reset to Dashboard's automatically generated value. + - addresses (array): configured alternate management interface addresses """ kwargs.update(locals()) metadata = { - 'tags': ['wireless', 'configure', 'bluetooth', 'settings'], - 'operation': 'updateDeviceWirelessBluetoothSettings' + 'tags': ['wireless', 'configure', 'alternateManagementInterface', 'ipv6'], + 'operation': 'updateDeviceWirelessAlternateManagementInterfaceIpv6' } serial = urllib.parse.quote(str(serial), safe='') - resource = f'/devices/{serial}/wireless/bluetooth/settings' + resource = f'/devices/{serial}/wireless/alternateManagementInterface/ipv6' - body_params = ['uuid', 'major', 'minor', ] + body_params = ['addresses', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} return self._session.put(metadata, resource, payload) @@ -54,6 +52,33 @@ def getDeviceWirelessBluetoothSettings(self, serial: str): + def updateDeviceWirelessBluetoothSettings(self, serial: str, **kwargs): + """ + **Update the bluetooth settings for a wireless device** + https://developer.cisco.com/meraki/api-v1/#!update-device-wireless-bluetooth-settings + + - serial (string): Serial + - uuid (string): Desired UUID of the beacon. If the value is set to null it will reset to Dashboard's automatically generated value. + - major (integer): Desired major value of the beacon. If the value is set to null it will reset to Dashboard's automatically generated value. + - minor (integer): Desired minor value of the beacon. If the value is set to null it will reset to Dashboard's automatically generated value. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'configure', 'bluetooth', 'settings'], + 'operation': 'updateDeviceWirelessBluetoothSettings' + } + serial = urllib.parse.quote(str(serial), safe='') + resource = f'/devices/{serial}/wireless/bluetooth/settings' + + body_params = ['uuid', 'major', 'minor', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.put(metadata, resource, payload) + + + def getDeviceWirelessConnectionStats(self, serial: str, **kwargs): """ **Aggregated connectivity info for a given AP on this network** @@ -808,6 +833,174 @@ def getNetworkWirelessDevicesLatencyStats(self, networkId: str, **kwargs): + def getNetworkWirelessEthernetPortsProfiles(self, networkId: str): + """ + **List the AP port profiles for this network** + https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-ethernet-ports-profiles + + - networkId (string): Network ID + """ + + metadata = { + 'tags': ['wireless', 'configure', 'ethernet', 'ports', 'profiles'], + 'operation': 'getNetworkWirelessEthernetPortsProfiles' + } + networkId = urllib.parse.quote(str(networkId), safe='') + resource = f'/networks/{networkId}/wireless/ethernet/ports/profiles' + + return self._session.get(metadata, resource) + + + + def createNetworkWirelessEthernetPortsProfile(self, networkId: str, name: str, ports: list, **kwargs): + """ + **Create an AP port profile** + https://developer.cisco.com/meraki/api-v1/#!create-network-wireless-ethernet-ports-profile + + - networkId (string): Network ID + - name (string): AP port profile name + - ports (array): AP ports configuration + - usbPorts (array): AP usb ports configuration + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'configure', 'ethernet', 'ports', 'profiles'], + 'operation': 'createNetworkWirelessEthernetPortsProfile' + } + networkId = urllib.parse.quote(str(networkId), safe='') + resource = f'/networks/{networkId}/wireless/ethernet/ports/profiles' + + body_params = ['name', 'ports', 'usbPorts', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.post(metadata, resource, payload) + + + + def assignNetworkWirelessEthernetPortsProfiles(self, networkId: str, serials: list, profileId: str): + """ + **Assign AP port profile to list of APs** + https://developer.cisco.com/meraki/api-v1/#!assign-network-wireless-ethernet-ports-profiles + + - networkId (string): Network ID + - serials (array): List of AP serials + - profileId (string): AP profile ID + """ + + kwargs = locals() + + metadata = { + 'tags': ['wireless', 'configure', 'ethernet', 'ports', 'profiles'], + 'operation': 'assignNetworkWirelessEthernetPortsProfiles' + } + networkId = urllib.parse.quote(str(networkId), safe='') + resource = f'/networks/{networkId}/wireless/ethernet/ports/profiles/assign' + + body_params = ['serials', 'profileId', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.post(metadata, resource, payload) + + + + def setNetworkWirelessEthernetPortsProfilesDefault(self, networkId: str, profileId: str): + """ + **Set the AP port profile to be default for this network** + https://developer.cisco.com/meraki/api-v1/#!set-network-wireless-ethernet-ports-profiles-default + + - networkId (string): Network ID + - profileId (string): AP profile ID + """ + + kwargs = locals() + + metadata = { + 'tags': ['wireless', 'configure', 'ethernet', 'ports', 'profiles'], + 'operation': 'setNetworkWirelessEthernetPortsProfilesDefault' + } + networkId = urllib.parse.quote(str(networkId), safe='') + resource = f'/networks/{networkId}/wireless/ethernet/ports/profiles/setDefault' + + body_params = ['profileId', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.post(metadata, resource, payload) + + + + def getNetworkWirelessEthernetPortsProfile(self, networkId: str, profileId: str): + """ + **Show the AP port profile by ID for this network** + https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-ethernet-ports-profile + + - networkId (string): Network ID + - profileId (string): Profile ID + """ + + metadata = { + 'tags': ['wireless', 'configure', 'ethernet', 'ports', 'profiles'], + 'operation': 'getNetworkWirelessEthernetPortsProfile' + } + networkId = urllib.parse.quote(str(networkId), safe='') + profileId = urllib.parse.quote(str(profileId), safe='') + resource = f'/networks/{networkId}/wireless/ethernet/ports/profiles/{profileId}' + + return self._session.get(metadata, resource) + + + + def updateNetworkWirelessEthernetPortsProfile(self, networkId: str, profileId: str, **kwargs): + """ + **Update the AP port profile by ID for this network** + https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-ethernet-ports-profile + + - networkId (string): Network ID + - profileId (string): Profile ID + - name (string): AP port profile name + - ports (array): AP ports configuration + - usbPorts (array): AP usb ports configuration + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'configure', 'ethernet', 'ports', 'profiles'], + 'operation': 'updateNetworkWirelessEthernetPortsProfile' + } + networkId = urllib.parse.quote(str(networkId), safe='') + profileId = urllib.parse.quote(str(profileId), safe='') + resource = f'/networks/{networkId}/wireless/ethernet/ports/profiles/{profileId}' + + body_params = ['name', 'ports', 'usbPorts', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.put(metadata, resource, payload) + + + + def deleteNetworkWirelessEthernetPortsProfile(self, networkId: str, profileId: str): + """ + **Delete an AP port profile** + https://developer.cisco.com/meraki/api-v1/#!delete-network-wireless-ethernet-ports-profile + + - networkId (string): Network ID + - profileId (string): Profile ID + """ + + metadata = { + 'tags': ['wireless', 'configure', 'ethernet', 'ports', 'profiles'], + 'operation': 'deleteNetworkWirelessEthernetPortsProfile' + } + networkId = urllib.parse.quote(str(networkId), safe='') + profileId = urllib.parse.quote(str(profileId), safe='') + resource = f'/networks/{networkId}/wireless/ethernet/ports/profiles/{profileId}' + + return self._session.delete(metadata, resource) + + + def getNetworkWirelessFailedConnections(self, networkId: str, **kwargs): """ **List of all failed client connection events on this network in a given time range** @@ -1135,6 +1328,7 @@ def updateNetworkWirelessSettings(self, networkId: str, **kwargs): - locationAnalyticsEnabled (boolean): Toggle for enabling or disabling location analytics for your network - upgradeStrategy (string): The upgrade strategy to apply to the network. Must be one of 'minimizeUpgradeTime' or 'minimizeClientDowntime'. Requires firmware version MR 26.8 or higher' - ledLightsOn (boolean): Toggle for enabling or disabling LED lights on all APs in the network (making them run dark) + - namedVlans (object): Named VLAN settings for wireless networks. """ kwargs.update(locals()) @@ -1150,7 +1344,7 @@ def updateNetworkWirelessSettings(self, networkId: str, **kwargs): networkId = urllib.parse.quote(str(networkId), safe='') resource = f'/networks/{networkId}/wireless/settings' - body_params = ['meshingEnabled', 'ipv6BridgeEnabled', 'locationAnalyticsEnabled', 'upgradeStrategy', 'ledLightsOn', ] + body_params = ['meshingEnabled', 'ipv6BridgeEnabled', 'locationAnalyticsEnabled', 'upgradeStrategy', 'ledLightsOn', 'namedVlans', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} return self._session.put(metadata, resource, payload) @@ -1300,6 +1494,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): - adultContentFilteringEnabled (boolean): Boolean indicating whether or not adult content will be blocked - dnsRewrite (object): DNS servers rewrite settings - speedBurst (object): The SpeedBurst setting for this SSID' + - namedVlans (object): Named VLAN settings. """ kwargs.update(locals()) @@ -1337,7 +1532,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', ] + 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', ] 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/appliance.py b/meraki/api/appliance.py index 0702666..16c0b0c 100644 --- a/meraki/api/appliance.py +++ b/meraki/api/appliance.py @@ -1900,6 +1900,32 @@ def updateNetworkApplianceTrafficShapingUplinkSelection(self, networkId: str, ** + def updateNetworkApplianceTrafficShapingVpnExclusions(self, networkId: str, **kwargs): + """ + **Update VPN exclusion rules for an MX network.** + https://developer.cisco.com/meraki/api-v1/#!update-network-appliance-traffic-shaping-vpn-exclusions + + - networkId (string): Network ID + - custom (array): Custom VPN exclusion rules. Pass an empty array to clear existing rules. + - majorApplications (array): Major Application based VPN exclusion rules. Pass an empty array to clear existing rules. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['appliance', 'configure', 'trafficShaping', 'vpnExclusions'], + 'operation': 'updateNetworkApplianceTrafficShapingVpnExclusions' + } + networkId = urllib.parse.quote(str(networkId), safe='') + resource = f'/networks/{networkId}/appliance/trafficShaping/vpnExclusions' + + body_params = ['custom', 'majorApplications', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.put(metadata, resource, payload) + + + def getNetworkApplianceUplinksUsageHistory(self, networkId: str, **kwargs): """ **Get the sent and received bytes for each uplink of a network.** @@ -2372,6 +2398,42 @@ def updateOrganizationApplianceSecurityIntrusion(self, organizationId: str, allo + def getOrganizationApplianceTrafficShapingVpnExclusionsByNetwork(self, organizationId: str, total_pages=1, direction='next', **kwargs): + """ + **Display VPN exclusion rules for MX networks.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-appliance-traffic-shaping-vpn-exclusions-by-network + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 50. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - networkIds (array): Optional parameter to filter the results by network IDs + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['appliance', 'configure', 'trafficShaping', 'vpnExclusions', 'byNetwork'], + 'operation': 'getOrganizationApplianceTrafficShapingVpnExclusionsByNetwork' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/appliance/trafficShaping/vpnExclusions/byNetwork' + + query_params = ['perPage', 'startingAfter', 'endingBefore', 'networkIds', ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = ['networkIds', ] + 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 getOrganizationApplianceUplinkStatuses(self, organizationId: str, total_pages=1, direction='next', **kwargs): """ **List the uplink status of every Meraki MX and Z series appliances in the organization** diff --git a/meraki/api/batch/appliance.py b/meraki/api/batch/appliance.py index 7bd86c4..7b7f685 100644 --- a/meraki/api/batch/appliance.py +++ b/meraki/api/batch/appliance.py @@ -710,6 +710,38 @@ def updateNetworkApplianceTrafficShapingUplinkSelection(self, networkId: str, ** + def updateNetworkApplianceTrafficShapingVpnExclusions(self, networkId: str, **kwargs): + """ + **Update VPN exclusion rules for an MX network.** + https://developer.cisco.com/meraki/api-v1/#!update-network-appliance-traffic-shaping-vpn-exclusions + + - networkId (string): Network ID + - custom (array): Custom VPN exclusion rules. Pass an empty array to clear existing rules. + - majorApplications (array): Major Application based VPN exclusion rules. Pass an empty array to clear existing rules. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['appliance', 'configure', 'trafficShaping', 'vpnExclusions'], + 'operation': 'updateNetworkApplianceTrafficShapingVpnExclusions' + } + resource = f'/networks/{networkId}/appliance/trafficShaping/vpnExclusions' + + body_params = ['custom', 'majorApplications', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "update", + "body": payload + } + return action + + + + + + def createNetworkApplianceVlan(self, networkId: str, id: str, name: str, **kwargs): """ **Add a VLAN** diff --git a/meraki/api/batch/networks.py b/meraki/api/batch/networks.py index 28b86b3..5812574 100644 --- a/meraki/api/batch/networks.py +++ b/meraki/api/batch/networks.py @@ -759,6 +759,7 @@ def updateNetworkSettings(self, networkId: str, **kwargs): - remoteStatusPageEnabled (boolean): Enables / disables access to the device status page (http://[device's LAN IP]). Optional. Can only be set if localStatusPageEnabled is set to true - localStatusPage (object): A hash of Local Status page(s)' authentication options applied to the Network. - securePort (object): A hash of SecureConnect options applied to the Network. + - namedVlans (object): A hash of Named VLANs options applied to the Network. """ kwargs.update(locals()) @@ -769,7 +770,7 @@ def updateNetworkSettings(self, networkId: str, **kwargs): } resource = f'/networks/{networkId}/settings' - body_params = ['localStatusPageEnabled', 'remoteStatusPageEnabled', 'localStatusPage', 'securePort', ] + body_params = ['localStatusPageEnabled', 'remoteStatusPageEnabled', 'localStatusPage', 'securePort', 'namedVlans', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { "resource": resource, @@ -839,6 +840,66 @@ def unbindNetwork(self, networkId: str, **kwargs): + def createNetworkVlanProfile(self, networkId: str, name: str, vlanNames: list, vlanGroups: list, iname: str): + """ + **Create a VLAN profile for a network** + https://developer.cisco.com/meraki/api-v1/#!create-network-vlan-profile + + - networkId (string): Network ID + - name (string): Name of the profile, string length must be from 1 to 255 characters + - vlanNames (array): An array of named VLANs + - vlanGroups (array): An array of VLAN groups + - iname (string): IName of the profile + """ + + kwargs = locals() + + metadata = { + 'tags': ['networks', 'configure', 'vlanProfiles'], + 'operation': 'createNetworkVlanProfile' + } + resource = f'/networks/{networkId}/vlanProfiles' + + body_params = ['name', 'vlanNames', 'vlanGroups', 'iname', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "create", + "body": payload + } + return action + + + + + + + def deleteNetworkVlanProfile(self, networkId: str, iname: str): + """ + **Delete a VLAN profile of a network** + https://developer.cisco.com/meraki/api-v1/#!delete-network-vlan-profile + + - networkId (string): Network ID + - iname (string): Iname + """ + + metadata = { + 'tags': ['networks', 'configure', 'vlanProfiles'], + 'operation': 'deleteNetworkVlanProfile' + } + resource = f'/networks/{networkId}/vlanProfiles/{iname}' + + action = { + "resource": resource, + "operation": "destroy", + } + return action + + + + + + def createNetworkWebhooksPayloadTemplate(self, networkId: str, name: str, **kwargs): """ **Create a webhook payload template for a network** diff --git a/meraki/api/batch/switch.py b/meraki/api/batch/switch.py index e307f98..64d1103 100644 --- a/meraki/api/batch/switch.py +++ b/meraki/api/batch/switch.py @@ -1207,6 +1207,7 @@ def updateNetworkSwitchSettings(self, networkId: str, **kwargs): - useCombinedPower (boolean): The use Combined Power as the default behavior of secondary power supplies on supported devices. - powerExceptions (array): Exceptions on a per switch basis to "useCombinedPower" - uplinkClientSampling (object): Uplink client sampling + - macBlocklist (object): MAC blocklist """ kwargs.update(locals()) @@ -1217,7 +1218,7 @@ def updateNetworkSwitchSettings(self, networkId: str, **kwargs): } resource = f'/networks/{networkId}/switch/settings' - body_params = ['vlan', 'useCombinedPower', 'powerExceptions', 'uplinkClientSampling', ] + body_params = ['vlan', 'useCombinedPower', 'powerExceptions', 'uplinkClientSampling', 'macBlocklist', ] 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 ef83e62..b1b9714 100644 --- a/meraki/api/batch/wireless.py +++ b/meraki/api/batch/wireless.py @@ -7,6 +7,37 @@ def __init__(self): + def updateDeviceWirelessAlternateManagementInterfaceIpv6(self, serial: str, **kwargs): + """ + **Update alternate management interface IPv6 address** + https://developer.cisco.com/meraki/api-v1/#!update-device-wireless-alternate-management-interface-ipv-6 + + - serial (string): Serial + - addresses (array): configured alternate management interface addresses + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'configure', 'alternateManagementInterface', 'ipv6'], + 'operation': 'updateDeviceWirelessAlternateManagementInterfaceIpv6' + } + resource = f'/devices/{serial}/wireless/alternateManagementInterface/ipv6' + + body_params = ['addresses', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "update", + "body": payload + } + return action + + + + + + def updateDeviceWirelessBluetoothSettings(self, serial: str, **kwargs): """ **Update the bluetooth settings for a wireless device** @@ -139,6 +170,162 @@ def updateNetworkWirelessBilling(self, networkId: str, **kwargs): + def createNetworkWirelessEthernetPortsProfile(self, networkId: str, name: str, ports: list, **kwargs): + """ + **Create an AP port profile** + https://developer.cisco.com/meraki/api-v1/#!create-network-wireless-ethernet-ports-profile + + - networkId (string): Network ID + - name (string): AP port profile name + - ports (array): AP ports configuration + - usbPorts (array): AP usb ports configuration + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'configure', 'ethernet', 'ports', 'profiles'], + 'operation': 'createNetworkWirelessEthernetPortsProfile' + } + resource = f'/networks/{networkId}/wireless/ethernet/ports/profiles' + + body_params = ['name', 'ports', 'usbPorts', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "create", + "body": payload + } + return action + + + + + + + def assignNetworkWirelessEthernetPortsProfiles(self, networkId: str, serials: list, profileId: str): + """ + **Assign AP port profile to list of APs** + https://developer.cisco.com/meraki/api-v1/#!assign-network-wireless-ethernet-ports-profiles + + - networkId (string): Network ID + - serials (array): List of AP serials + - profileId (string): AP profile ID + """ + + kwargs = locals() + + metadata = { + 'tags': ['wireless', 'configure', 'ethernet', 'ports', 'profiles'], + 'operation': 'assignNetworkWirelessEthernetPortsProfiles' + } + resource = f'/networks/{networkId}/wireless/ethernet/ports/profiles/assign' + + body_params = ['serials', 'profileId', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "create", + "body": payload + } + return action + + + + + + + def setNetworkWirelessEthernetPortsProfilesDefault(self, networkId: str, profileId: str): + """ + **Set the AP port profile to be default for this network** + https://developer.cisco.com/meraki/api-v1/#!set-network-wireless-ethernet-ports-profiles-default + + - networkId (string): Network ID + - profileId (string): AP profile ID + """ + + kwargs = locals() + + metadata = { + 'tags': ['wireless', 'configure', 'ethernet', 'ports', 'profiles'], + 'operation': 'setNetworkWirelessEthernetPortsProfilesDefault' + } + resource = f'/networks/{networkId}/wireless/ethernet/ports/profiles/setDefault' + + body_params = ['profileId', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "create", + "body": payload + } + return action + + + + + + + def updateNetworkWirelessEthernetPortsProfile(self, networkId: str, profileId: str, **kwargs): + """ + **Update the AP port profile by ID for this network** + https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-ethernet-ports-profile + + - networkId (string): Network ID + - profileId (string): Profile ID + - name (string): AP port profile name + - ports (array): AP ports configuration + - usbPorts (array): AP usb ports configuration + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'configure', 'ethernet', 'ports', 'profiles'], + 'operation': 'updateNetworkWirelessEthernetPortsProfile' + } + resource = f'/networks/{networkId}/wireless/ethernet/ports/profiles/{profileId}' + + body_params = ['name', 'ports', 'usbPorts', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "update", + "body": payload + } + return action + + + + + + + def deleteNetworkWirelessEthernetPortsProfile(self, networkId: str, profileId: str): + """ + **Delete an AP port profile** + https://developer.cisco.com/meraki/api-v1/#!delete-network-wireless-ethernet-ports-profile + + - networkId (string): Network ID + - profileId (string): Profile ID + """ + + metadata = { + 'tags': ['wireless', 'configure', 'ethernet', 'ports', 'profiles'], + 'operation': 'deleteNetworkWirelessEthernetPortsProfile' + } + resource = f'/networks/{networkId}/wireless/ethernet/ports/profiles/{profileId}' + + action = { + "resource": resource, + "operation": "destroy", + } + return action + + + + + + def createNetworkWirelessRfProfile(self, networkId: str, name: str, bandSelectionType: str, **kwargs): """ **Creates new RF profile for this network** @@ -273,6 +460,7 @@ def updateNetworkWirelessSettings(self, networkId: str, **kwargs): - locationAnalyticsEnabled (boolean): Toggle for enabling or disabling location analytics for your network - upgradeStrategy (string): The upgrade strategy to apply to the network. Must be one of 'minimizeUpgradeTime' or 'minimizeClientDowntime'. Requires firmware version MR 26.8 or higher' - ledLightsOn (boolean): Toggle for enabling or disabling LED lights on all APs in the network (making them run dark) + - namedVlans (object): Named VLAN settings for wireless networks. """ kwargs.update(locals()) @@ -287,7 +475,7 @@ def updateNetworkWirelessSettings(self, networkId: str, **kwargs): } resource = f'/networks/{networkId}/wireless/settings' - body_params = ['meshingEnabled', 'ipv6BridgeEnabled', 'locationAnalyticsEnabled', 'upgradeStrategy', 'ledLightsOn', ] + body_params = ['meshingEnabled', 'ipv6BridgeEnabled', 'locationAnalyticsEnabled', 'upgradeStrategy', 'ledLightsOn', 'namedVlans', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { "resource": resource, @@ -366,6 +554,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): - adultContentFilteringEnabled (boolean): Boolean indicating whether or not adult content will be blocked - dnsRewrite (object): DNS servers rewrite settings - speedBurst (object): The SpeedBurst setting for this SSID' + - namedVlans (object): Named VLAN settings. """ kwargs.update(locals()) @@ -401,7 +590,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', ] + 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', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { "resource": resource, diff --git a/meraki/api/camera.py b/meraki/api/camera.py index 111a0ee..ce7d199 100644 --- a/meraki/api/camera.py +++ b/meraki/api/camera.py @@ -860,3 +860,162 @@ def updateOrganizationCameraOnboardingStatuses(self, organizationId: str, **kwar return self._session.put(metadata, resource, payload) + + + def getOrganizationCameraPermissions(self, organizationId: str): + """ + **List the permissions scopes for this organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-camera-permissions + + - organizationId (string): Organization ID + """ + + metadata = { + 'tags': ['camera', 'configure', 'permissions'], + 'operation': 'getOrganizationCameraPermissions' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/camera/permissions' + + return self._session.get(metadata, resource) + + + + def getOrganizationCameraPermission(self, organizationId: str, permissionScopeId: str): + """ + **Retrieve a single permission scope** + https://developer.cisco.com/meraki/api-v1/#!get-organization-camera-permission + + - organizationId (string): Organization ID + - permissionScopeId (string): Permission scope ID + """ + + metadata = { + 'tags': ['camera', 'configure', 'permissions'], + 'operation': 'getOrganizationCameraPermission' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + permissionScopeId = urllib.parse.quote(str(permissionScopeId), safe='') + resource = f'/organizations/{organizationId}/camera/permissions/{permissionScopeId}' + + return self._session.get(metadata, resource) + + + + def getOrganizationCameraRoles(self, organizationId: str): + """ + **List all the roles in this organization** + https://developer.cisco.com/meraki/api-v1/#!get-organization-camera-roles + + - organizationId (string): Organization ID + """ + + metadata = { + 'tags': ['camera', 'configure', 'roles'], + 'operation': 'getOrganizationCameraRoles' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/camera/roles' + + return self._session.get(metadata, resource) + + + + def createOrganizationCameraRole(self, organizationId: str, name: str, **kwargs): + """ + **Creates new role for this organization.** + https://developer.cisco.com/meraki/api-v1/#!create-organization-camera-role + + - organizationId (string): Organization ID + - name (string): The name of the new role. Must be unique. This parameter is required. + - appliedOnDevices (array): Device tag on which this specified permission is applied. + - appliedOnNetworks (array): Network tag on which this specified permission is applied. + - appliedOrgWide (array): Permissions to be applied org wide. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['camera', 'configure', 'roles'], + 'operation': 'createOrganizationCameraRole' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/camera/roles' + + body_params = ['name', 'appliedOnDevices', 'appliedOnNetworks', 'appliedOrgWide', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.post(metadata, resource, payload) + + + + def getOrganizationCameraRole(self, organizationId: str, roleId: str): + """ + **Retrieve a single role.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-camera-role + + - organizationId (string): Organization ID + - roleId (string): Role ID + """ + + metadata = { + 'tags': ['camera', 'configure', 'roles'], + 'operation': 'getOrganizationCameraRole' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + roleId = urllib.parse.quote(str(roleId), safe='') + resource = f'/organizations/{organizationId}/camera/roles/{roleId}' + + return self._session.get(metadata, resource) + + + + def deleteOrganizationCameraRole(self, organizationId: str, roleId: str): + """ + **Delete an existing role for this organization.** + https://developer.cisco.com/meraki/api-v1/#!delete-organization-camera-role + + - organizationId (string): Organization ID + - roleId (string): Role ID + """ + + metadata = { + 'tags': ['camera', 'configure', 'roles'], + 'operation': 'deleteOrganizationCameraRole' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + roleId = urllib.parse.quote(str(roleId), safe='') + resource = f'/organizations/{organizationId}/camera/roles/{roleId}' + + return self._session.delete(metadata, resource) + + + + def updateOrganizationCameraRole(self, organizationId: str, roleId: str, **kwargs): + """ + **Update an existing role in this organization.** + https://developer.cisco.com/meraki/api-v1/#!update-organization-camera-role + + - organizationId (string): Organization ID + - roleId (string): Role ID + - name (string): The name of the new role. Must be unique. + - appliedOnDevices (array): Device tag on which this specified permission is applied. + - appliedOnNetworks (array): Network tag on which this specified permission is applied. + - appliedOrgWide (array): Permissions to be applied org wide. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['camera', 'configure', 'roles'], + 'operation': 'updateOrganizationCameraRole' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + roleId = urllib.parse.quote(str(roleId), safe='') + resource = f'/organizations/{organizationId}/camera/roles/{roleId}' + + body_params = ['name', 'appliedOnDevices', 'appliedOnNetworks', 'appliedOrgWide', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.put(metadata, resource, payload) + diff --git a/meraki/api/networks.py b/meraki/api/networks.py index 026aee8..efccb7a 100644 --- a/meraki/api/networks.py +++ b/meraki/api/networks.py @@ -258,6 +258,7 @@ def getNetworkClients(self, networkId: str, total_pages=1, direction='next', **k - pskGroup (string): Filters clients based on partial or full match for the iPSK name field. - description (string): Filters clients based on a partial or full match for the description field. - vlan (string): Filters clients based on the full match for the VLAN field. + - namedVlan (string): Filters clients based on the partial or full match for the named VLAN field. - recentDeviceConnections (array): Filters clients based on recent connection type. Can be one of 'Wired' or 'Wireless'. """ @@ -270,7 +271,7 @@ def getNetworkClients(self, networkId: str, total_pages=1, direction='next', **k networkId = urllib.parse.quote(str(networkId), safe='') resource = f'/networks/{networkId}/clients' - query_params = ['t0', 'timespan', 'perPage', 'startingAfter', 'endingBefore', 'statuses', 'ip', 'ip6', 'ip6Local', 'mac', 'os', 'pskGroup', 'description', 'vlan', 'recentDeviceConnections', ] + query_params = ['t0', 'timespan', 'perPage', 'startingAfter', 'endingBefore', 'statuses', 'ip', 'ip6', 'ip6Local', 'mac', 'os', 'pskGroup', 'description', 'vlan', 'namedVlan', 'recentDeviceConnections', ] params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} array_params = ['statuses', 'recentDeviceConnections', ] @@ -2008,6 +2009,7 @@ def updateNetworkSettings(self, networkId: str, **kwargs): - remoteStatusPageEnabled (boolean): Enables / disables access to the device status page (http://[device's LAN IP]). Optional. Can only be set if localStatusPageEnabled is set to true - localStatusPage (object): A hash of Local Status page(s)' authentication options applied to the Network. - securePort (object): A hash of SecureConnect options applied to the Network. + - namedVlans (object): A hash of Named VLANs options applied to the Network. """ kwargs.update(locals()) @@ -2019,7 +2021,7 @@ def updateNetworkSettings(self, networkId: str, **kwargs): networkId = urllib.parse.quote(str(networkId), safe='') resource = f'/networks/{networkId}/settings' - body_params = ['localStatusPageEnabled', 'remoteStatusPageEnabled', 'localStatusPage', 'securePort', ] + body_params = ['localStatusPageEnabled', 'remoteStatusPageEnabled', 'localStatusPage', 'securePort', 'namedVlans', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} return self._session.put(metadata, resource, payload) @@ -2334,6 +2336,189 @@ def unbindNetwork(self, networkId: str, **kwargs): + def getNetworkVlanProfiles(self, networkId: str): + """ + **List VLAN profiles for a network** + https://developer.cisco.com/meraki/api-v1/#!get-network-vlan-profiles + + - networkId (string): Network ID + """ + + metadata = { + 'tags': ['networks', 'configure', 'vlanProfiles'], + 'operation': 'getNetworkVlanProfiles' + } + networkId = urllib.parse.quote(str(networkId), safe='') + resource = f'/networks/{networkId}/vlanProfiles' + + return self._session.get(metadata, resource) + + + + def createNetworkVlanProfile(self, networkId: str, name: str, vlanNames: list, vlanGroups: list, iname: str): + """ + **Create a VLAN profile for a network** + https://developer.cisco.com/meraki/api-v1/#!create-network-vlan-profile + + - networkId (string): Network ID + - name (string): Name of the profile, string length must be from 1 to 255 characters + - vlanNames (array): An array of named VLANs + - vlanGroups (array): An array of VLAN groups + - iname (string): IName of the profile + """ + + kwargs = locals() + + metadata = { + 'tags': ['networks', 'configure', 'vlanProfiles'], + 'operation': 'createNetworkVlanProfile' + } + networkId = urllib.parse.quote(str(networkId), safe='') + resource = f'/networks/{networkId}/vlanProfiles' + + body_params = ['name', 'vlanNames', 'vlanGroups', 'iname', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.post(metadata, resource, payload) + + + + def getNetworkVlanProfilesAssignmentsByDevice(self, networkId: str, total_pages=1, direction='next', **kwargs): + """ + **Get the assigned VLAN Profiles for devices in a network** + https://developer.cisco.com/meraki/api-v1/#!get-network-vlan-profiles-assignments-by-device + + - networkId (string): Network 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 - 1000. Default is 1000. + - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. + - serials (array): Optional parameter to filter devices by serials. All devices returned belong to serial numbers that are an exact match. + - productTypes (array): Optional parameter to filter devices by product types. + - stackIds (array): Optional parameter to filter devices by Switch Stack ids. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['networks', 'configure', 'vlanProfiles', 'assignments', 'byDevice'], + 'operation': 'getNetworkVlanProfilesAssignmentsByDevice' + } + networkId = urllib.parse.quote(str(networkId), safe='') + resource = f'/networks/{networkId}/vlanProfiles/assignments/byDevice' + + query_params = ['perPage', 'startingAfter', 'endingBefore', 'serials', 'productTypes', 'stackIds', ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = ['serials', 'productTypes', 'stackIds', ] + 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 reassignNetworkVlanProfilesAssignments(self, networkId: str, serials: list, stackIds: list, **kwargs): + """ + **Update the assigned VLAN Profile for devices in a network** + https://developer.cisco.com/meraki/api-v1/#!reassign-network-vlan-profiles-assignments + + - networkId (string): Network ID + - serials (array): Array of Device Serials + - stackIds (array): Array of Switch Stack IDs + - vlanProfile (object): The VLAN Profile + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['networks', 'configure', 'vlanProfiles', 'assignments'], + 'operation': 'reassignNetworkVlanProfilesAssignments' + } + networkId = urllib.parse.quote(str(networkId), safe='') + resource = f'/networks/{networkId}/vlanProfiles/assignments/reassign' + + body_params = ['vlanProfile', 'serials', 'stackIds', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.post(metadata, resource, payload) + + + + def getNetworkVlanProfile(self, networkId: str, iname: str): + """ + **Get an existing VLAN profile of a network** + https://developer.cisco.com/meraki/api-v1/#!get-network-vlan-profile + + - networkId (string): Network ID + - iname (string): Iname + """ + + metadata = { + 'tags': ['networks', 'configure', 'vlanProfiles'], + 'operation': 'getNetworkVlanProfile' + } + networkId = urllib.parse.quote(str(networkId), safe='') + iname = urllib.parse.quote(str(iname), safe='') + resource = f'/networks/{networkId}/vlanProfiles/{iname}' + + return self._session.get(metadata, resource) + + + + def updateNetworkVlanProfile(self, networkId: str, iname: str, name: str, vlanNames: list, vlanGroups: list): + """ + **Update an existing VLAN profile of a network** + https://developer.cisco.com/meraki/api-v1/#!update-network-vlan-profile + + - networkId (string): Network ID + - iname (string): Iname + - name (string): Name of the profile, string length must be from 1 to 255 characters + - vlanNames (array): An array of named VLANs + - vlanGroups (array): An array of VLAN groups + """ + + kwargs = locals() + + metadata = { + 'tags': ['networks', 'configure', 'vlanProfiles'], + 'operation': 'updateNetworkVlanProfile' + } + networkId = urllib.parse.quote(str(networkId), safe='') + iname = urllib.parse.quote(str(iname), safe='') + resource = f'/networks/{networkId}/vlanProfiles/{iname}' + + body_params = ['name', 'vlanNames', 'vlanGroups', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.put(metadata, resource, payload) + + + + def deleteNetworkVlanProfile(self, networkId: str, iname: str): + """ + **Delete a VLAN profile of a network** + https://developer.cisco.com/meraki/api-v1/#!delete-network-vlan-profile + + - networkId (string): Network ID + - iname (string): Iname + """ + + metadata = { + 'tags': ['networks', 'configure', 'vlanProfiles'], + 'operation': 'deleteNetworkVlanProfile' + } + networkId = urllib.parse.quote(str(networkId), safe='') + iname = urllib.parse.quote(str(iname), safe='') + resource = f'/networks/{networkId}/vlanProfiles/{iname}' + + return self._session.delete(metadata, resource) + + + def getNetworkWebhooksHttpServers(self, networkId: str): """ **List the HTTP servers for a network** diff --git a/meraki/api/organizations.py b/meraki/api/organizations.py index 6d801fa..8cb38fd 100644 --- a/meraki/api/organizations.py +++ b/meraki/api/organizations.py @@ -1620,7 +1620,7 @@ def getOrganizationDevicesAvailabilitiesChangeHistory(self, organizationId: str, def getOrganizationDevicesPowerModulesStatusesByDevice(self, organizationId: str, total_pages=1, direction='next', **kwargs): """ - **List the power status information for devices in an organization** + **List the most recent status information for power modules in rackmount MX and MS devices that support them** https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-power-modules-statuses-by-device - organizationId (string): Organization ID @@ -3563,6 +3563,39 @@ def getOrganizationUplinksStatuses(self, organizationId: str, total_pages=1, dir + def getOrganizationUplinksLossAndLatency(self, organizationId: str, **kwargs): + """ + **Return the uplink loss and latency for every MX in the organization from at latest 2 minutes ago** + https://developer.cisco.com/meraki/api-v1/#!get-organization-uplinks-loss-and-latency + + - organizationId (string): Organization ID + - t0 (string): The beginning of the timespan for the data. The maximum lookback period is 60 days from today. + - t1 (string): The end of the timespan for the data. t1 can be a maximum of 5 minutes after t0. The latest possible time that t1 can be is 2 minutes into the past. + - 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 5 minutes. The default is 5 minutes. + - uplink (string): Optional filter for a specific WAN uplink. Valid uplinks are wan1, wan2, wan3, cellular. Default will return all uplinks. + - ip (string): Optional filter for a specific destination IP. Default will return all destination IPs. + """ + + kwargs.update(locals()) + + if 'uplink' in kwargs: + options = ['cellular', 'wan1', 'wan2', 'wan3'] + assert kwargs['uplink'] in options, f'''"uplink" cannot be "{kwargs['uplink']}", & must be set to one of: {options}''' + + metadata = { + 'tags': ['organizations', 'monitor', 'uplinksLossAndLatency'], + 'operation': 'getOrganizationUplinksLossAndLatency' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/uplinksLossAndLatency' + + query_params = ['t0', 't1', 'timespan', 'uplink', 'ip', ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + return self._session.get(metadata, resource, params) + + + def getOrganizationWebhooksAlertTypes(self, organizationId: str, **kwargs): """ **Return a list of alert types to be used with managing webhook alerts** diff --git a/meraki/api/sensor.py b/meraki/api/sensor.py index 7268181..4f56c3d 100644 --- a/meraki/api/sensor.py +++ b/meraki/api/sensor.py @@ -355,7 +355,7 @@ def getOrganizationSensorReadingsLatest(self, organizationId: str, total_pages=1 - 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 - 100. Default is 100. + - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - networkIds (array): Optional parameter to filter readings by network. diff --git a/meraki/api/switch.py b/meraki/api/switch.py index 19c2fad..ba6e036 100644 --- a/meraki/api/switch.py +++ b/meraki/api/switch.py @@ -1732,6 +1732,7 @@ def updateNetworkSwitchSettings(self, networkId: str, **kwargs): - useCombinedPower (boolean): The use Combined Power as the default behavior of secondary power supplies on supported devices. - powerExceptions (array): Exceptions on a per switch basis to "useCombinedPower" - uplinkClientSampling (object): Uplink client sampling + - macBlocklist (object): MAC blocklist """ kwargs.update(locals()) @@ -1743,7 +1744,7 @@ def updateNetworkSwitchSettings(self, networkId: str, **kwargs): networkId = urllib.parse.quote(str(networkId), safe='') resource = f'/networks/{networkId}/switch/settings' - body_params = ['vlan', 'useCombinedPower', 'powerExceptions', 'uplinkClientSampling', ] + body_params = ['vlan', 'useCombinedPower', 'powerExceptions', 'uplinkClientSampling', 'macBlocklist', ] 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 c149143..4c245ae 100644 --- a/meraki/api/wireless.py +++ b/meraki/api/wireless.py @@ -8,27 +8,25 @@ def __init__(self, session): - def updateDeviceWirelessBluetoothSettings(self, serial: str, **kwargs): + def updateDeviceWirelessAlternateManagementInterfaceIpv6(self, serial: str, **kwargs): """ - **Update the bluetooth settings for a wireless device** - https://developer.cisco.com/meraki/api-v1/#!update-device-wireless-bluetooth-settings + **Update alternate management interface IPv6 address** + https://developer.cisco.com/meraki/api-v1/#!update-device-wireless-alternate-management-interface-ipv-6 - serial (string): Serial - - uuid (string): Desired UUID of the beacon. If the value is set to null it will reset to Dashboard's automatically generated value. - - major (integer): Desired major value of the beacon. If the value is set to null it will reset to Dashboard's automatically generated value. - - minor (integer): Desired minor value of the beacon. If the value is set to null it will reset to Dashboard's automatically generated value. + - addresses (array): configured alternate management interface addresses """ kwargs.update(locals()) metadata = { - 'tags': ['wireless', 'configure', 'bluetooth', 'settings'], - 'operation': 'updateDeviceWirelessBluetoothSettings' + 'tags': ['wireless', 'configure', 'alternateManagementInterface', 'ipv6'], + 'operation': 'updateDeviceWirelessAlternateManagementInterfaceIpv6' } serial = urllib.parse.quote(str(serial), safe='') - resource = f'/devices/{serial}/wireless/bluetooth/settings' + resource = f'/devices/{serial}/wireless/alternateManagementInterface/ipv6' - body_params = ['uuid', 'major', 'minor', ] + body_params = ['addresses', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} return self._session.put(metadata, resource, payload) @@ -54,6 +52,33 @@ def getDeviceWirelessBluetoothSettings(self, serial: str): + def updateDeviceWirelessBluetoothSettings(self, serial: str, **kwargs): + """ + **Update the bluetooth settings for a wireless device** + https://developer.cisco.com/meraki/api-v1/#!update-device-wireless-bluetooth-settings + + - serial (string): Serial + - uuid (string): Desired UUID of the beacon. If the value is set to null it will reset to Dashboard's automatically generated value. + - major (integer): Desired major value of the beacon. If the value is set to null it will reset to Dashboard's automatically generated value. + - minor (integer): Desired minor value of the beacon. If the value is set to null it will reset to Dashboard's automatically generated value. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'configure', 'bluetooth', 'settings'], + 'operation': 'updateDeviceWirelessBluetoothSettings' + } + serial = urllib.parse.quote(str(serial), safe='') + resource = f'/devices/{serial}/wireless/bluetooth/settings' + + body_params = ['uuid', 'major', 'minor', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.put(metadata, resource, payload) + + + def getDeviceWirelessConnectionStats(self, serial: str, **kwargs): """ **Aggregated connectivity info for a given AP on this network** @@ -808,6 +833,174 @@ def getNetworkWirelessDevicesLatencyStats(self, networkId: str, **kwargs): + def getNetworkWirelessEthernetPortsProfiles(self, networkId: str): + """ + **List the AP port profiles for this network** + https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-ethernet-ports-profiles + + - networkId (string): Network ID + """ + + metadata = { + 'tags': ['wireless', 'configure', 'ethernet', 'ports', 'profiles'], + 'operation': 'getNetworkWirelessEthernetPortsProfiles' + } + networkId = urllib.parse.quote(str(networkId), safe='') + resource = f'/networks/{networkId}/wireless/ethernet/ports/profiles' + + return self._session.get(metadata, resource) + + + + def createNetworkWirelessEthernetPortsProfile(self, networkId: str, name: str, ports: list, **kwargs): + """ + **Create an AP port profile** + https://developer.cisco.com/meraki/api-v1/#!create-network-wireless-ethernet-ports-profile + + - networkId (string): Network ID + - name (string): AP port profile name + - ports (array): AP ports configuration + - usbPorts (array): AP usb ports configuration + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'configure', 'ethernet', 'ports', 'profiles'], + 'operation': 'createNetworkWirelessEthernetPortsProfile' + } + networkId = urllib.parse.quote(str(networkId), safe='') + resource = f'/networks/{networkId}/wireless/ethernet/ports/profiles' + + body_params = ['name', 'ports', 'usbPorts', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.post(metadata, resource, payload) + + + + def assignNetworkWirelessEthernetPortsProfiles(self, networkId: str, serials: list, profileId: str): + """ + **Assign AP port profile to list of APs** + https://developer.cisco.com/meraki/api-v1/#!assign-network-wireless-ethernet-ports-profiles + + - networkId (string): Network ID + - serials (array): List of AP serials + - profileId (string): AP profile ID + """ + + kwargs = locals() + + metadata = { + 'tags': ['wireless', 'configure', 'ethernet', 'ports', 'profiles'], + 'operation': 'assignNetworkWirelessEthernetPortsProfiles' + } + networkId = urllib.parse.quote(str(networkId), safe='') + resource = f'/networks/{networkId}/wireless/ethernet/ports/profiles/assign' + + body_params = ['serials', 'profileId', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.post(metadata, resource, payload) + + + + def setNetworkWirelessEthernetPortsProfilesDefault(self, networkId: str, profileId: str): + """ + **Set the AP port profile to be default for this network** + https://developer.cisco.com/meraki/api-v1/#!set-network-wireless-ethernet-ports-profiles-default + + - networkId (string): Network ID + - profileId (string): AP profile ID + """ + + kwargs = locals() + + metadata = { + 'tags': ['wireless', 'configure', 'ethernet', 'ports', 'profiles'], + 'operation': 'setNetworkWirelessEthernetPortsProfilesDefault' + } + networkId = urllib.parse.quote(str(networkId), safe='') + resource = f'/networks/{networkId}/wireless/ethernet/ports/profiles/setDefault' + + body_params = ['profileId', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.post(metadata, resource, payload) + + + + def getNetworkWirelessEthernetPortsProfile(self, networkId: str, profileId: str): + """ + **Show the AP port profile by ID for this network** + https://developer.cisco.com/meraki/api-v1/#!get-network-wireless-ethernet-ports-profile + + - networkId (string): Network ID + - profileId (string): Profile ID + """ + + metadata = { + 'tags': ['wireless', 'configure', 'ethernet', 'ports', 'profiles'], + 'operation': 'getNetworkWirelessEthernetPortsProfile' + } + networkId = urllib.parse.quote(str(networkId), safe='') + profileId = urllib.parse.quote(str(profileId), safe='') + resource = f'/networks/{networkId}/wireless/ethernet/ports/profiles/{profileId}' + + return self._session.get(metadata, resource) + + + + def updateNetworkWirelessEthernetPortsProfile(self, networkId: str, profileId: str, **kwargs): + """ + **Update the AP port profile by ID for this network** + https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-ethernet-ports-profile + + - networkId (string): Network ID + - profileId (string): Profile ID + - name (string): AP port profile name + - ports (array): AP ports configuration + - usbPorts (array): AP usb ports configuration + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'configure', 'ethernet', 'ports', 'profiles'], + 'operation': 'updateNetworkWirelessEthernetPortsProfile' + } + networkId = urllib.parse.quote(str(networkId), safe='') + profileId = urllib.parse.quote(str(profileId), safe='') + resource = f'/networks/{networkId}/wireless/ethernet/ports/profiles/{profileId}' + + body_params = ['name', 'ports', 'usbPorts', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.put(metadata, resource, payload) + + + + def deleteNetworkWirelessEthernetPortsProfile(self, networkId: str, profileId: str): + """ + **Delete an AP port profile** + https://developer.cisco.com/meraki/api-v1/#!delete-network-wireless-ethernet-ports-profile + + - networkId (string): Network ID + - profileId (string): Profile ID + """ + + metadata = { + 'tags': ['wireless', 'configure', 'ethernet', 'ports', 'profiles'], + 'operation': 'deleteNetworkWirelessEthernetPortsProfile' + } + networkId = urllib.parse.quote(str(networkId), safe='') + profileId = urllib.parse.quote(str(profileId), safe='') + resource = f'/networks/{networkId}/wireless/ethernet/ports/profiles/{profileId}' + + return self._session.delete(metadata, resource) + + + def getNetworkWirelessFailedConnections(self, networkId: str, **kwargs): """ **List of all failed client connection events on this network in a given time range** @@ -1135,6 +1328,7 @@ def updateNetworkWirelessSettings(self, networkId: str, **kwargs): - locationAnalyticsEnabled (boolean): Toggle for enabling or disabling location analytics for your network - upgradeStrategy (string): The upgrade strategy to apply to the network. Must be one of 'minimizeUpgradeTime' or 'minimizeClientDowntime'. Requires firmware version MR 26.8 or higher' - ledLightsOn (boolean): Toggle for enabling or disabling LED lights on all APs in the network (making them run dark) + - namedVlans (object): Named VLAN settings for wireless networks. """ kwargs.update(locals()) @@ -1150,7 +1344,7 @@ def updateNetworkWirelessSettings(self, networkId: str, **kwargs): networkId = urllib.parse.quote(str(networkId), safe='') resource = f'/networks/{networkId}/wireless/settings' - body_params = ['meshingEnabled', 'ipv6BridgeEnabled', 'locationAnalyticsEnabled', 'upgradeStrategy', 'ledLightsOn', ] + body_params = ['meshingEnabled', 'ipv6BridgeEnabled', 'locationAnalyticsEnabled', 'upgradeStrategy', 'ledLightsOn', 'namedVlans', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} return self._session.put(metadata, resource, payload) @@ -1300,6 +1494,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): - adultContentFilteringEnabled (boolean): Boolean indicating whether or not adult content will be blocked - dnsRewrite (object): DNS servers rewrite settings - speedBurst (object): The SpeedBurst setting for this SSID' + - namedVlans (object): Named VLAN settings. """ kwargs.update(locals()) @@ -1337,7 +1532,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', ] + 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', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} return self._session.put(metadata, resource, payload)