diff --git a/meraki/__init__.py b/meraki/__init__.py index b3eb2a62..2e24db57 100644 --- a/meraki/__init__.py +++ b/meraki/__init__.py @@ -43,8 +43,8 @@ ) from meraki.rest_session import * -__version__ = '2.0.2' -__api_version__ = '1.57.0' +__version__ = '2.0.3' +__api_version__ = '1.58.0' class DashboardAPI(object): diff --git a/meraki/aio/api/campusGateway.py b/meraki/aio/api/campusGateway.py new file mode 100644 index 00000000..1687ac90 --- /dev/null +++ b/meraki/aio/api/campusGateway.py @@ -0,0 +1,108 @@ +import urllib + + +class AsyncCampusGateway: + def __init__(self, session): + super().__init__() + self._session = session + + + + def createNetworkCampusGatewayCluster(self, networkId: str, name: str, uplinks: list, tunnels: list, nameservers: dict, portChannels: list, **kwargs): + """ + **Create a cluster and add campus gateways to it** + https://developer.cisco.com/meraki/api-v1/#!create-network-campus-gateway-cluster + + - networkId (string): Network ID + - name (string): Name of the new cluster + - uplinks (array): Uplink interface settings of the cluster + - tunnels (array): Tunnel interface settings of the cluster: Reuse uplink or specify tunnel interface + - nameservers (object): Nameservers of the cluster + - portChannels (array): Port channel settings of the cluster + - devices (array): Devices to be added to the cluster + - notes (string): Notes about cluster with max size of 511 characters allowed + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['campusGateway', 'configure', 'clusters'], + 'operation': 'createNetworkCampusGatewayCluster' + } + networkId = urllib.parse.quote(str(networkId), safe='') + resource = f'/networks/{networkId}/campusGateway/clusters' + + body_params = ['name', 'uplinks', 'tunnels', 'nameservers', 'portChannels', 'devices', 'notes', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.post(metadata, resource, payload) + + + + def updateNetworkCampusGatewayCluster(self, networkId: str, clusterId: str, **kwargs): + """ + **Update a cluster and add/remove campus gateways to/from it** + https://developer.cisco.com/meraki/api-v1/#!update-network-campus-gateway-cluster + + - networkId (string): Network ID + - clusterId (string): Cluster ID + - name (string): Name of the cluster + - uplinks (array): Uplink interface settings of the cluster + - tunnels (array): Tunnel interface settings of the cluster: Reuse uplink or specify tunnel interface + - nameservers (object): Nameservers of the cluster + - portChannels (array): Port channel settings of the cluster + - devices (array): Devices in the cluster + - notes (string): Notes about cluster with max size of 511 characters allowed + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['campusGateway', 'configure', 'clusters'], + 'operation': 'updateNetworkCampusGatewayCluster' + } + networkId = urllib.parse.quote(str(networkId), safe='') + clusterId = urllib.parse.quote(str(clusterId), safe='') + resource = f'/networks/{networkId}/campusGateway/clusters/{clusterId}' + + body_params = ['name', 'uplinks', 'tunnels', 'nameservers', 'portChannels', 'devices', 'notes', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.put(metadata, resource, payload) + + + + def getOrganizationCampusGatewayDevicesUplinksLocalOverridesByDevice(self, organizationId: str, total_pages=1, direction='next', **kwargs): + """ + **Uplink overrides configured locally on Campus Gateway devices in an organization.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-campus-gateway-devices-uplinks-local-overrides-by-device + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - serials (array): A list of serial numbers. The returned devices will be filtered to only include these serials. + - 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. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['campusGateway', 'configure', 'devices', 'uplinks', 'localOverrides', 'byDevice'], + 'operation': 'getOrganizationCampusGatewayDevicesUplinksLocalOverridesByDevice' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/campusGateway/devices/uplinks/localOverrides/byDevice' + + query_params = ['serials', 'perPage', 'startingAfter', 'endingBefore', ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = ['serials', ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f'{k.strip()}[]'] = kwargs[f'{k}'] + params.pop(k.strip()) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + diff --git a/meraki/aio/api/networks.py b/meraki/aio/api/networks.py index 82687a0c..f126367b 100644 --- a/meraki/aio/api/networks.py +++ b/meraki/aio/api/networks.py @@ -650,6 +650,7 @@ def claimNetworkDevices(self, networkId: str, serials: list, **kwargs): - networkId (string): Network ID - serials (array): A list of serials of devices to claim - addAtomically (boolean): Whether to claim devices atomically. If true, all devices will be claimed or none will be claimed. Default is true. + - detailsByDevice (array): Optional details for claimed devices (currently only used for Catalyst devices) """ kwargs.update(locals()) @@ -661,7 +662,7 @@ def claimNetworkDevices(self, networkId: str, serials: list, **kwargs): networkId = urllib.parse.quote(str(networkId), safe='') resource = f'/networks/{networkId}/devices/claim' - body_params = ['serials', ] + body_params = ['serials', 'detailsByDevice', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} return self._session.post(metadata, resource, payload) @@ -731,7 +732,7 @@ def getNetworkEvents(self, networkId: str, total_pages=1, direction='prev', even - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" or "prev" (default) page - event_log_end_time (string): ISO8601 Zulu/UTC time, to use in conjunction with startingAfter, to retrieve events within a time window - - productType (string): The product type to fetch events for. This parameter is required for networks with multiple device types. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, wirelessController, and secureConnect + - productType (string): The product type to fetch events for. This parameter is required for networks with multiple device types. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, wirelessController, campusGateway, and secureConnect - includedEventTypes (array): A list of event types. The returned events will be filtered to only include events with these types. - excludedEventTypes (array): A list of event types. The returned events will be filtered to exclude events with these types. - deviceMac (string): The MAC address of the Meraki device which the list of events will be filtered with @@ -753,7 +754,7 @@ def getNetworkEvents(self, networkId: str, total_pages=1, direction='prev', even kwargs.update(locals()) if 'productType' in kwargs: - options = ['appliance', 'camera', 'cellularGateway', 'secureConnect', 'switch', 'systemsManager', 'wireless', 'wirelessController'] + options = ['appliance', 'camera', 'campusGateway', 'cellularGateway', 'secureConnect', 'switch', 'systemsManager', 'wireless', 'wirelessController'] assert kwargs['productType'] in options, f'''"productType" cannot be "{kwargs['productType']}", & must be set to one of: {options}''' metadata = { diff --git a/meraki/aio/api/organizations.py b/meraki/aio/api/organizations.py index dd53bbc5..dfefd5d0 100644 --- a/meraki/aio/api/organizations.py +++ b/meraki/aio/api/organizations.py @@ -1398,7 +1398,7 @@ def getOrganizationBrandingPolicies(self, organizationId: str): - def createOrganizationBrandingPolicy(self, organizationId: str, **kwargs): + def createOrganizationBrandingPolicy(self, organizationId: str, name: str, **kwargs): """ **Add a new branding policy to an organization** https://developer.cisco.com/meraki/api-v1/#!create-organization-branding-policy @@ -1497,7 +1497,7 @@ def getOrganizationBrandingPolicy(self, organizationId: str, brandingPolicyId: s - def updateOrganizationBrandingPolicy(self, organizationId: str, brandingPolicyId: str, **kwargs): + def updateOrganizationBrandingPolicy(self, organizationId: str, brandingPolicyId: str, name: str, **kwargs): """ **Update a branding policy** https://developer.cisco.com/meraki/api-v1/#!update-organization-branding-policy @@ -1856,7 +1856,7 @@ def getOrganizationDevices(self, organizationId: str, total_pages=1, direction=' - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - configurationUpdatedAfter (string): Filter results by whether or not the device's configuration has been updated after the given timestamp - networkIds (array): Optional parameter to filter devices by network. - - productTypes (array): Optional parameter to filter devices by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, wirelessController, and secureConnect. + - productTypes (array): Optional parameter to filter devices by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, wirelessController, campusGateway, and secureConnect. - tags (array): Optional parameter to filter devices by tags. - tagsFilterType (string): Optional parameter of value 'withAnyTags' or 'withAllTags' to indicate whether to return networks which contain ANY or ALL of the included tags. If no type is included, 'withAnyTags' will be selected. - name (string): Optional parameter to filter devices by name. All returned devices will have a name that contains the search term or is an exact match. @@ -2197,6 +2197,35 @@ def createOrganizationDevicesPacketCaptureCapture(self, organizationId: str, ser + def bulkOrganizationDevicesPacketCaptureCapturesCreate(self, organizationId: str, devices: list, name: str, **kwargs): + """ + **Perform a packet capture on multiple devices and store in Meraki Cloud.** + https://developer.cisco.com/meraki/api-v1/#!bulk-organization-devices-packet-capture-captures-create + + - organizationId (string): Organization ID + - devices (array): Device details (maximum of 20 devices allowed) + - name (string): Name of packet capture file + - notes (string): Reason for capture + - duration (integer): Duration of the capture in seconds + - filterExpression (string): Filter expression for the capture + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['organizations', 'configure', 'devices', 'packetCapture', 'captures'], + 'operation': 'bulkOrganizationDevicesPacketCaptureCapturesCreate' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/devices/packetCapture/captures/bulkCreate' + + body_params = ['devices', 'notes', 'duration', 'filterExpression', 'name', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.post(metadata, resource, payload) + + + def bulkOrganizationDevicesPacketCaptureCapturesDelete(self, organizationId: str, captureIds: list): """ **BulkDelete packet captures from cloud** @@ -2541,7 +2570,7 @@ def getOrganizationDevicesStatuses(self, organizationId: str, total_pages=1, dir - networkIds (array): Optional parameter to filter devices by network ids. - serials (array): Optional parameter to filter devices by serials. - statuses (array): Optional parameter to filter devices by statuses. Valid statuses are ["online", "alerting", "offline", "dormant"]. - - productTypes (array): An optional parameter to filter device statuses by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, wirelessController, and secureConnect. + - productTypes (array): An optional parameter to filter device statuses by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, wirelessController, campusGateway, and secureConnect. - models (array): Optional parameter to filter devices by models. - tags (array): An optional parameter to filter devices by tags. The filtering is case-sensitive. If tags are included, 'tagsFilterType' should also be included (see below). - tagsFilterType (string): An optional parameter of value 'withAnyTags' or 'withAllTags' to indicate whether to return devices which contain ANY or ALL of the included tags. If no type is included, 'withAnyTags' will be selected. @@ -2579,7 +2608,7 @@ def getOrganizationDevicesStatusesOverview(self, organizationId: str, **kwargs): https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-statuses-overview - organizationId (string): Organization ID - - productTypes (array): An optional parameter to filter device statuses by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, wirelessController, and secureConnect. + - productTypes (array): An optional parameter to filter device statuses by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, wirelessController, campusGateway, and secureConnect. - networkIds (array): An optional parameter to filter device statuses by network. """ @@ -2622,7 +2651,7 @@ def getOrganizationDevicesSystemMemoryUsageHistoryByInterval(self, organizationI - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 1200, 3600, 14400. The default is 300. Interval is calculated if time params are provided. - networkIds (array): Optional parameter to filter the result set by the included set of network IDs - serials (array): Optional parameter to filter device availabilities history by device serial numbers - - productTypes (array): Optional parameter to filter device statuses by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, wirelessController, and secureConnect. + - productTypes (array): Optional parameter to filter device statuses by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, wirelessController, campusGateway, and secureConnect. """ kwargs.update(locals()) @@ -3142,7 +3171,7 @@ def getOrganizationInventoryDevices(self, organizationId: str, total_pages=1, di - orderNumbers (array): Search for devices in inventory based on order numbers. - tags (array): Filter devices by tags. The filtering is case-sensitive. If tags are included, 'tagsFilterType' should also be included (see below). - tagsFilterType (string): To use with 'tags' parameter, to filter devices which contain ANY or ALL given tags. Accepted values are 'withAnyTags' or 'withAllTags', default is 'withAnyTags'. - - productTypes (array): Filter devices by product type. Accepted values are appliance, camera, cellularGateway, secureConnect, sensor, switch, systemsManager, wireless, and wirelessController. + - productTypes (array): Filter devices by product type. Accepted values are appliance, camera, campusGateway, cellularGateway, secureConnect, sensor, switch, systemsManager, wireless, and wirelessController. """ kwargs.update(locals()) @@ -4921,7 +4950,7 @@ def getOrganizationWebhooksAlertTypes(self, organizationId: str, **kwargs): kwargs.update(locals()) if 'productType' in kwargs: - options = ['appliance', 'camera', 'cellularGateway', 'health', 'platform', 'sensor', 'sm', 'switch', 'wireless'] + options = ['appliance', 'camera', 'cellularGateway', 'platform', 'sensor', 'sm', 'switch', 'wireless'] assert kwargs['productType'] in options, f'''"productType" cannot be "{kwargs['productType']}", & must be set to one of: {options}''' metadata = { diff --git a/meraki/aio/api/spaces.py b/meraki/aio/api/spaces.py new file mode 100644 index 00000000..19bb0a16 --- /dev/null +++ b/meraki/aio/api/spaces.py @@ -0,0 +1,27 @@ +import urllib + + +class AsyncSpaces: + def __init__(self, session): + super().__init__() + self._session = session + + + + def removeOrganizationSpacesIntegration(self, organizationId: str): + """ + **Remove the Spaces integration from Meraki** + https://developer.cisco.com/meraki/api-v1/#!remove-organization-spaces-integration + + - organizationId (string): Organization ID + """ + + metadata = { + 'tags': ['organizations', 'configure', 'spaces', 'integration'], + 'operation': 'removeOrganizationSpacesIntegration' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/spaces/integration/remove' + + return self._session.post(metadata, resource) + diff --git a/meraki/aio/api/switch.py b/meraki/aio/api/switch.py index baf56be4..324edca6 100644 --- a/meraki/aio/api/switch.py +++ b/meraki/aio/api/switch.py @@ -149,6 +149,8 @@ def updateDeviceSwitchPort(self, serial: str, portId: str, **kwargs): - accessPolicyType (string): The type of the access policy of the switch port. Only applicable to access ports. Can be one of 'Open', 'Custom access policy', 'MAC allow list' or 'Sticky MAC allow list'. - accessPolicyNumber (integer): The number of a custom access policy to configure on the switch port. Only applicable when 'accessPolicyType' is 'Custom access policy'. - macAllowList (array): Only devices with MAC addresses specified in this list will have access to this port. Up to 20 MAC addresses can be defined. Only applicable when 'accessPolicyType' is 'MAC allow list'. + - macWhitelistLimit (integer): The maximum number of MAC addresses for regular MAC allow list. Only applicable when 'accessPolicyType' is 'MAC allow list'. + Note: Config only supported on verions greater than ms18 only for classic switches. - stickyMacAllowList (array): The initial list of MAC addresses for sticky Mac allow list. Only applicable when 'accessPolicyType' is 'Sticky MAC allow list'. - stickyMacAllowListLimit (integer): The maximum number of MAC addresses for sticky MAC allow list. Only applicable when 'accessPolicyType' is 'Sticky MAC allow list'. - stormControlEnabled (boolean): The storm control status of the switch port. @@ -183,7 +185,7 @@ def updateDeviceSwitchPort(self, serial: str, portId: str, **kwargs): portId = urllib.parse.quote(str(portId), safe='') resource = f'/devices/{serial}/switch/ports/{portId}' - body_params = ['name', 'tags', 'enabled', 'poeEnabled', 'type', 'vlan', 'voiceVlan', 'allowedVlans', 'isolationEnabled', 'rstpEnabled', 'stpGuard', 'linkNegotiation', 'portScheduleId', 'udld', 'accessPolicyType', 'accessPolicyNumber', 'macAllowList', 'stickyMacAllowList', 'stickyMacAllowListLimit', 'stormControlEnabled', 'adaptivePolicyGroupId', 'peerSgtCapable', 'flexibleStackingEnabled', 'daiTrusted', 'profile', 'dot3az', ] + body_params = ['name', 'tags', 'enabled', 'poeEnabled', 'type', 'vlan', 'voiceVlan', 'allowedVlans', 'isolationEnabled', 'rstpEnabled', 'stpGuard', 'linkNegotiation', 'portScheduleId', 'udld', 'accessPolicyType', 'accessPolicyNumber', 'macAllowList', 'macWhitelistLimit', 'stickyMacAllowList', 'stickyMacAllowListLimit', 'stormControlEnabled', 'adaptivePolicyGroupId', 'peerSgtCapable', 'flexibleStackingEnabled', 'daiTrusted', 'profile', 'dot3az', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} return self._session.put(metadata, resource, payload) @@ -225,7 +227,7 @@ def createDeviceSwitchRoutingInterface(self, serial: str, name: str, **kwargs): https://developer.cisco.com/meraki/api-v1/#!create-device-switch-routing-interface - serial (string): Serial - - name (string): A friendly name or description for the interface or VLAN. + - name (string): A friendly name or description for the interface or VLAN (max length 128 characters). - subnet (string): The network that this L3 interface is on, in CIDR notation (ex. 10.1.1.0/24). - interfaceIp (string): The IP address that will be used for Layer 3 routing on this VLAN or subnet. This cannot be the same as the device management IP. - multicastRouting (string): Enable multicast support if, multicast routing between VLANs is required. Options are: 'disabled', 'enabled' or 'IGMP snooping querier'. Default is 'disabled'. @@ -283,7 +285,7 @@ def updateDeviceSwitchRoutingInterface(self, serial: str, interfaceId: str, **kw - serial (string): Serial - interfaceId (string): Interface ID - - name (string): A friendly name or description for the interface or VLAN. + - name (string): A friendly name or description for the interface or VLAN (max length 128 characters). - subnet (string): The network that this L3 interface is on, in CIDR notation (ex. 10.1.1.0/24). - interfaceIp (string): The IP address that will be used for Layer 3 routing on this VLAN or subnet. This cannot be the same as the device management IP. - multicastRouting (string): Enable multicast support if, multicast routing between VLANs is required. Options are: 'disabled', 'enabled' or 'IGMP snooping querier'. Default is 'disabled'. @@ -644,7 +646,7 @@ def createNetworkSwitchAccessPolicy(self, networkId: str, name: str, radiusServe https://developer.cisco.com/meraki/api-v1/#!create-network-switch-access-policy - networkId (string): Network ID - - name (string): Name of the access policy + - name (string): Name of the access policy(max length 255) - radiusServers (array): List of RADIUS servers to require connecting devices to authenticate against before granting network access - radiusTestingEnabled (boolean): If enabled, Meraki devices will periodically send access-request messages to these RADIUS servers - radiusCoaSupportEnabled (boolean): Change of authentication for RADIUS re-authentication and disconnection @@ -714,7 +716,7 @@ def updateNetworkSwitchAccessPolicy(self, networkId: str, accessPolicyNumber: st - networkId (string): Network ID - accessPolicyNumber (string): Access policy number - - name (string): Name of the access policy + - name (string): Name of the access policy(max length 255) - radiusServers (array): List of RADIUS servers to require connecting devices to authenticate against before granting network access - radius (object): Object for RADIUS Settings - guestPortBouncing (boolean): If enabled, Meraki devices will periodically send access-request messages to these RADIUS servers @@ -1940,7 +1942,7 @@ def createNetworkSwitchStackRoutingInterface(self, networkId: str, switchStackId - networkId (string): Network ID - switchStackId (string): Switch stack ID - - name (string): A friendly name or description for the interface or VLAN. + - name (string): A friendly name or description for the interface or VLAN (max length 128 characters). - subnet (string): The network that this L3 interface is on, in CIDR notation (ex. 10.1.1.0/24). - interfaceIp (string): The IP address that will be used for Layer 3 routing on this VLAN or subnet. This cannot be the same as the device management IP. - multicastRouting (string): Enable multicast support if, multicast routing between VLANs is required. Options are: 'disabled', 'enabled' or 'IGMP snooping querier'. Default is 'disabled'. @@ -2002,7 +2004,7 @@ def updateNetworkSwitchStackRoutingInterface(self, networkId: str, switchStackId - networkId (string): Network ID - switchStackId (string): Switch stack ID - interfaceId (string): Interface ID - - name (string): A friendly name or description for the interface or VLAN. + - name (string): A friendly name or description for the interface or VLAN (max length 128 characters). - subnet (string): The network that this L3 interface is on, in CIDR notation (ex. 10.1.1.0/24). - interfaceIp (string): The IP address that will be used for Layer 3 routing on this VLAN or subnet. This cannot be the same as the device management IP. - multicastRouting (string): Enable multicast support if, multicast routing between VLANs is required. Options are: 'disabled', 'enabled' or 'IGMP snooping querier'. Default is 'disabled'. @@ -2454,6 +2456,8 @@ def updateOrganizationConfigTemplateSwitchProfilePort(self, organizationId: str, - accessPolicyType (string): The type of the access policy of the switch template port. Only applicable to access ports. Can be one of 'Open', 'Custom access policy', 'MAC allow list' or 'Sticky MAC allow list'. - accessPolicyNumber (integer): The number of a custom access policy to configure on the switch template port. Only applicable when 'accessPolicyType' is 'Custom access policy'. - macAllowList (array): Only devices with MAC addresses specified in this list will have access to this port. Up to 20 MAC addresses can be defined. Only applicable when 'accessPolicyType' is 'MAC allow list'. + - macWhitelistLimit (integer): The maximum number of MAC addresses for regular MAC allow list. Only applicable when 'accessPolicyType' is 'MAC allow list'. + Note: Config only supported on verions greater than ms18 only for classic switches. - stickyMacAllowList (array): The initial list of MAC addresses for sticky Mac allow list. Only applicable when 'accessPolicyType' is 'Sticky MAC allow list'. - stickyMacAllowListLimit (integer): The maximum number of MAC addresses for sticky MAC allow list. Only applicable when 'accessPolicyType' is 'Sticky MAC allow list'. - stormControlEnabled (boolean): The storm control status of the switch template port. @@ -2488,7 +2492,7 @@ def updateOrganizationConfigTemplateSwitchProfilePort(self, organizationId: str, portId = urllib.parse.quote(str(portId), safe='') resource = f'/organizations/{organizationId}/configTemplates/{configTemplateId}/switch/profiles/{profileId}/ports/{portId}' - body_params = ['name', 'tags', 'enabled', 'poeEnabled', 'type', 'vlan', 'voiceVlan', 'allowedVlans', 'isolationEnabled', 'rstpEnabled', 'stpGuard', 'linkNegotiation', 'portScheduleId', 'udld', 'accessPolicyType', 'accessPolicyNumber', 'macAllowList', 'stickyMacAllowList', 'stickyMacAllowListLimit', 'stormControlEnabled', 'flexibleStackingEnabled', 'daiTrusted', 'profile', 'dot3az', ] + body_params = ['name', 'tags', 'enabled', 'poeEnabled', 'type', 'vlan', 'voiceVlan', 'allowedVlans', 'isolationEnabled', 'rstpEnabled', 'stpGuard', 'linkNegotiation', 'portScheduleId', 'udld', 'accessPolicyType', 'accessPolicyNumber', 'macAllowList', 'macWhitelistLimit', 'stickyMacAllowList', 'stickyMacAllowListLimit', 'stormControlEnabled', 'flexibleStackingEnabled', 'daiTrusted', 'profile', 'dot3az', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} return self._session.put(metadata, resource, payload) diff --git a/meraki/aio/api/wireless.py b/meraki/aio/api/wireless.py index a643ffa3..75b0bb8f 100644 --- a/meraki/aio/api/wireless.py +++ b/meraki/aio/api/wireless.py @@ -1349,6 +1349,32 @@ def getNetworkWirelessLatencyStats(self, networkId: str, **kwargs): + def updateNetworkWirelessLocationScanning(self, networkId: str, **kwargs): + """ + **Change scanning API settings** + https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-location-scanning + + - networkId (string): Network ID + - enabled (boolean): Collect location and scanning analytics + - api (object): Enable push API for scanning events, analytics must be enabled + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'configure', 'location', 'scanning'], + 'operation': 'updateNetworkWirelessLocationScanning' + } + networkId = urllib.parse.quote(str(networkId), safe='') + resource = f'/networks/{networkId}/wireless/location/scanning' + + body_params = ['enabled', 'api', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.put(metadata, resource, payload) + + + def getNetworkWirelessMeshStatuses(self, networkId: str, total_pages=1, direction='next', **kwargs): """ **List wireless mesh statuses for repeaters** @@ -1727,6 +1753,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): - visible (boolean): Boolean indicating whether APs should advertise or hide this SSID. APs will only broadcast this SSID if set to true - availableOnAllAps (boolean): Boolean indicating whether all APs should broadcast the SSID or if it should be restricted to APs matching any availability tags. Can only be false if the SSID has availability tags. - availabilityTags (array): Accepts a list of tags for this SSID. If availableOnAllAps is false, then the SSID will only be broadcast by APs with tags matching any of the tags in this list. + - adaptivePolicyGroupId (string): Adaptive policy group ID this SSID is assigned to. - mandatoryDhcpEnabled (boolean): If true, Mandatory DHCP will enforce that clients connecting to this SSID must use the IP address assigned by the DHCP server. Clients who use a static IP address won't be able to associate. - adultContentFilteringEnabled (boolean): Boolean indicating whether or not adult content will be blocked - dnsRewrite (object): DNS servers rewrite settings @@ -1769,7 +1796,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', 'localAuth', 'authMode', 'enterpriseAdminAccess', 'encryptionMode', 'psk', 'wpaEncryptionMode', 'dot11w', 'dot11r', 'splashPage', 'splashGuestSponsorDomains', 'oauth', 'localRadius', 'ldap', 'activeDirectory', 'radiusServers', 'radiusProxyEnabled', 'radiusTestingEnabled', 'radiusCalledStationId', 'radiusAuthenticationNasId', 'radiusServerTimeout', 'radiusServerAttemptsLimit', 'radiusFallbackEnabled', 'radiusRadsec', 'radiusCoaEnabled', 'radiusFailoverPolicy', 'radiusLoadBalancingPolicy', 'radiusAccountingEnabled', 'radiusAccountingServers', 'radiusAccountingInterimInterval', 'radiusAttributeForGroupPolicies', 'ipAssignmentMode', 'useVlanTagging', 'concentratorNetworkId', 'secondaryConcentratorNetworkId', 'disassociateClientsOnVpnFailover', 'vlanId', 'defaultVlanId', 'apTagsAndVlanIds', 'walledGardenEnabled', 'walledGardenRanges', 'gre', 'radiusOverride', 'radiusGuestVlanEnabled', 'radiusGuestVlanId', 'minBitrate', 'bandSelection', 'perClientBandwidthLimitUp', 'perClientBandwidthLimitDown', 'perSsidBandwidthLimitUp', 'perSsidBandwidthLimitDown', 'lanIsolationEnabled', 'visible', 'availableOnAllAps', 'availabilityTags', 'mandatoryDhcpEnabled', 'adultContentFilteringEnabled', 'dnsRewrite', 'speedBurst', 'namedVlans', ] + body_params = ['name', 'enabled', 'localAuth', 'authMode', 'enterpriseAdminAccess', 'encryptionMode', 'psk', 'wpaEncryptionMode', 'dot11w', 'dot11r', 'splashPage', 'splashGuestSponsorDomains', 'oauth', 'localRadius', 'ldap', 'activeDirectory', 'radiusServers', 'radiusProxyEnabled', 'radiusTestingEnabled', 'radiusCalledStationId', 'radiusAuthenticationNasId', 'radiusServerTimeout', 'radiusServerAttemptsLimit', 'radiusFallbackEnabled', 'radiusRadsec', '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', 'adaptivePolicyGroupId', '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) @@ -2949,6 +2976,144 @@ def getOrganizationWirelessDevicesPowerModeHistory(self, organizationId: str, to + def getOrganizationWirelessDevicesRadsecCertificatesAuthorities(self, organizationId: str, **kwargs): + """ + **Query for details on the organization's RADSEC device Certificate Authority certificates (CAs)** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-radsec-certificates-authorities + + - organizationId (string): Organization ID + - certificateAuthorityIds (array): Optional parameter to filter CAs by one or more CA IDs. All returned CAs will have an ID that is an exact match. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'configure', 'devices', 'radsec', 'certificates', 'authorities'], + 'operation': 'getOrganizationWirelessDevicesRadsecCertificatesAuthorities' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/wireless/devices/radsec/certificates/authorities' + + query_params = ['certificateAuthorityIds', ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = ['certificateAuthorityIds', ] + 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(metadata, resource, params) + + + + def updateOrganizationWirelessDevicesRadsecCertificatesAuthorities(self, organizationId: str, **kwargs): + """ + **Update an organization's RADSEC device Certificate Authority (CA) state** + https://developer.cisco.com/meraki/api-v1/#!update-organization-wireless-devices-radsec-certificates-authorities + + - organizationId (string): Organization ID + - status (string): The "status" to update the Certificate Authority to. Only valid option is "trusted". + - certificateAuthorityId (string): The ID of the Certificate Authority to update. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'configure', 'devices', 'radsec', 'certificates', 'authorities'], + 'operation': 'updateOrganizationWirelessDevicesRadsecCertificatesAuthorities' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/wireless/devices/radsec/certificates/authorities' + + body_params = ['status', 'certificateAuthorityId', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.put(metadata, resource, payload) + + + + def createOrganizationWirelessDevicesRadsecCertificatesAuthority(self, organizationId: str): + """ + **Create an organization's RADSEC device Certificate Authority (CA)** + https://developer.cisco.com/meraki/api-v1/#!create-organization-wireless-devices-radsec-certificates-authority + + - organizationId (string): Organization ID + """ + + metadata = { + 'tags': ['wireless', 'configure', 'devices', 'radsec', 'certificates', 'authorities'], + 'operation': 'createOrganizationWirelessDevicesRadsecCertificatesAuthority' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/wireless/devices/radsec/certificates/authorities' + + return self._session.post(metadata, resource) + + + + def getOrganizationWirelessDevicesRadsecCertificatesAuthoritiesCrls(self, organizationId: str, **kwargs): + """ + **Query for certificate revocation list (CRL) for the organization's RADSEC device Certificate Authorities (CAs).** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-radsec-certificates-authorities-crls + + - organizationId (string): Organization ID + - certificateAuthorityIds (array): Optional parameter to filter CAs by one or more CA IDs. All returned CAs will have an ID that is an exact match. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'configure', 'devices', 'radsec', 'certificates', 'authorities', 'crls'], + 'operation': 'getOrganizationWirelessDevicesRadsecCertificatesAuthoritiesCrls' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/wireless/devices/radsec/certificates/authorities/crls' + + query_params = ['certificateAuthorityIds', ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = ['certificateAuthorityIds', ] + 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(metadata, resource, params) + + + + def getOrganizationWirelessDevicesRadsecCertificatesAuthoritiesCrlsDeltas(self, organizationId: str, **kwargs): + """ + **Query for all delta certificate revocation list (CRL) for the organization's RADSEC device Certificate Authority (CA) with the given id.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-radsec-certificates-authorities-crls-deltas + + - organizationId (string): Organization ID + - certificateAuthorityIds (array): Parameter to filter CAs by one or more CA IDs. All returned CAs will have an ID that is an exact match. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'configure', 'devices', 'radsec', 'certificates', 'authorities', 'crls', 'deltas'], + 'operation': 'getOrganizationWirelessDevicesRadsecCertificatesAuthoritiesCrlsDeltas' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/wireless/devices/radsec/certificates/authorities/crls/deltas' + + query_params = ['certificateAuthorityIds', ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = ['certificateAuthorityIds', ] + 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(metadata, resource, params) + + + def getOrganizationWirelessDevicesSystemCpuLoadHistory(self, organizationId: str, total_pages=1, direction='next', **kwargs): """ **Return the CPU Load history for a list of wireless devices in the organization.** @@ -3027,6 +3192,157 @@ def getOrganizationWirelessDevicesWirelessControllersByDevice(self, organization + def getOrganizationWirelessLocationScanningByNetwork(self, organizationId: str, total_pages=1, direction='next', **kwargs): + """ + **Return scanning API settings** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-location-scanning-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 - 250. 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 scanning settings by network ID. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'configure', 'location', 'scanning', 'byNetwork'], + 'operation': 'getOrganizationWirelessLocationScanningByNetwork' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/wireless/location/scanning/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 getOrganizationWirelessLocationScanningReceivers(self, organizationId: str, total_pages=1, direction='next', **kwargs): + """ + **Return scanning API receivers** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-location-scanning-receivers + + - 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 - 250. 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 scanning API receivers by network ID. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'configure', 'location', 'scanning', 'receivers'], + 'operation': 'getOrganizationWirelessLocationScanningReceivers' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/wireless/location/scanning/receivers' + + 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 createOrganizationWirelessLocationScanningReceiver(self, organizationId: str, network: dict, url: str, version: str, radio: dict, sharedSecret: str): + """ + **Add new receiver for scanning API** + https://developer.cisco.com/meraki/api-v1/#!create-organization-wireless-location-scanning-receiver + + - organizationId (string): Organization ID + - network (object): Add scanning API receiver for network + - url (string): Receiver Url + - version (string): Scanning API Version + - radio (object): Add scanning API Radio + - sharedSecret (string): Secret Value for Receiver + """ + + kwargs = locals() + + metadata = { + 'tags': ['wireless', 'configure', 'location', 'scanning', 'receivers'], + 'operation': 'createOrganizationWirelessLocationScanningReceiver' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/wireless/location/scanning/receivers' + + body_params = ['network', 'url', 'version', 'radio', 'sharedSecret', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.post(metadata, resource, payload) + + + + def updateOrganizationWirelessLocationScanningReceiver(self, organizationId: str, receiverId: str, **kwargs): + """ + **Change scanning API receiver settings** + https://developer.cisco.com/meraki/api-v1/#!update-organization-wireless-location-scanning-receiver + + - organizationId (string): Organization ID + - receiverId (string): Receiver ID + - url (string): Receiver Url + - version (string): Scanning API Version + - radio (object): Add scanning API Radio + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'configure', 'location', 'scanning', 'receivers'], + 'operation': 'updateOrganizationWirelessLocationScanningReceiver' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + receiverId = urllib.parse.quote(str(receiverId), safe='') + resource = f'/organizations/{organizationId}/wireless/location/scanning/receivers/{receiverId}' + + body_params = ['url', 'version', 'radio', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.put(metadata, resource, payload) + + + + def deleteOrganizationWirelessLocationScanningReceiver(self, organizationId: str, receiverId: str): + """ + **Delete a scanning API receiver** + https://developer.cisco.com/meraki/api-v1/#!delete-organization-wireless-location-scanning-receiver + + - organizationId (string): Organization ID + - receiverId (string): Receiver ID + """ + + metadata = { + 'tags': ['wireless', 'configure', 'location', 'scanning', 'receivers'], + 'operation': 'deleteOrganizationWirelessLocationScanningReceiver' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + receiverId = urllib.parse.quote(str(receiverId), safe='') + resource = f'/organizations/{organizationId}/wireless/location/scanning/receivers/{receiverId}' + + return self._session.delete(metadata, resource) + + + def recalculateOrganizationWirelessRadioAutoRfChannels(self, organizationId: str, networkIds: list): """ **Recalculates automatically assigned channels for every AP within specified the specified network(s)** @@ -3064,7 +3380,7 @@ def getOrganizationWirelessRfProfilesAssignmentsByDevice(self, organizationId: s - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - networkIds (array): Optional parameter to filter devices by network. - - productTypes (array): Optional parameter to filter devices by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, wirelessController, and secureConnect. + - productTypes (array): Optional parameter to filter devices by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, wirelessController, campusGateway, and secureConnect. - name (string): Optional parameter to filter RF profiles by device name. All returned devices will have a name that contains the search term or is an exact match. - mac (string): Optional parameter to filter RF profiles by device MAC address. All returned devices will have a MAC address that contains the search term or is an exact match. - serial (string): Optional parameter to filter RF profiles by device serial number. All returned devices will have a serial number that contains the search term or is an exact match. diff --git a/meraki/api/batch/campusGateway.py b/meraki/api/batch/campusGateway.py new file mode 100644 index 00000000..5500966e --- /dev/null +++ b/meraki/api/batch/campusGateway.py @@ -0,0 +1,82 @@ +import urllib + + +class ActionBatchCampusGateway(object): + def __init__(self): + super(ActionBatchCampusGateway, self).__init__() + + + + def createNetworkCampusGatewayCluster(self, networkId: str, name: str, uplinks: list, tunnels: list, nameservers: dict, portChannels: list, **kwargs): + """ + **Create a cluster and add campus gateways to it** + https://developer.cisco.com/meraki/api-v1/#!create-network-campus-gateway-cluster + + - networkId (string): Network ID + - name (string): Name of the new cluster + - uplinks (array): Uplink interface settings of the cluster + - tunnels (array): Tunnel interface settings of the cluster: Reuse uplink or specify tunnel interface + - nameservers (object): Nameservers of the cluster + - portChannels (array): Port channel settings of the cluster + - devices (array): Devices to be added to the cluster + - notes (string): Notes about cluster with max size of 511 characters allowed + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['campusGateway', 'configure', 'clusters'], + 'operation': 'createNetworkCampusGatewayCluster' + } + resource = f'/networks/{networkId}/campusGateway/clusters' + + body_params = ['name', 'uplinks', 'tunnels', 'nameservers', 'portChannels', 'devices', 'notes', ] + 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 updateNetworkCampusGatewayCluster(self, networkId: str, clusterId: str, **kwargs): + """ + **Update a cluster and add/remove campus gateways to/from it** + https://developer.cisco.com/meraki/api-v1/#!update-network-campus-gateway-cluster + + - networkId (string): Network ID + - clusterId (string): Cluster ID + - name (string): Name of the cluster + - uplinks (array): Uplink interface settings of the cluster + - tunnels (array): Tunnel interface settings of the cluster: Reuse uplink or specify tunnel interface + - nameservers (object): Nameservers of the cluster + - portChannels (array): Port channel settings of the cluster + - devices (array): Devices in the cluster + - notes (string): Notes about cluster with max size of 511 characters allowed + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['campusGateway', 'configure', 'clusters'], + 'operation': 'updateNetworkCampusGatewayCluster' + } + resource = f'/networks/{networkId}/campusGateway/clusters/{clusterId}' + + body_params = ['name', 'uplinks', 'tunnels', 'nameservers', 'portChannels', 'devices', 'notes', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + action = { + "resource": resource, + "operation": "update", + "body": payload + } + return action + + + + diff --git a/meraki/api/batch/networks.py b/meraki/api/batch/networks.py index 8dc1e4d3..90ab36c1 100644 --- a/meraki/api/batch/networks.py +++ b/meraki/api/batch/networks.py @@ -146,6 +146,7 @@ def claimNetworkDevices(self, networkId: str, serials: list, **kwargs): - networkId (string): Network ID - serials (array): A list of serials of devices to claim - addAtomically (boolean): Whether to claim devices atomically. If true, all devices will be claimed or none will be claimed. Default is true. + - detailsByDevice (array): Optional details for claimed devices (currently only used for Catalyst devices) """ kwargs.update(locals()) @@ -156,7 +157,7 @@ def claimNetworkDevices(self, networkId: str, serials: list, **kwargs): } resource = f'/networks/{networkId}/devices/claim' - body_params = ['serials', ] + body_params = ['serials', 'detailsByDevice', ] 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/organizations.py b/meraki/api/batch/organizations.py index 7834c6a7..cb6a9bd0 100644 --- a/meraki/api/batch/organizations.py +++ b/meraki/api/batch/organizations.py @@ -445,7 +445,7 @@ def deleteOrganizationAlertsProfile(self, organizationId: str, alertConfigId: st - def createOrganizationBrandingPolicy(self, organizationId: str, **kwargs): + def createOrganizationBrandingPolicy(self, organizationId: str, name: str, **kwargs): """ **Add a new branding policy to an organization** https://developer.cisco.com/meraki/api-v1/#!create-organization-branding-policy @@ -516,7 +516,7 @@ def updateOrganizationBrandingPoliciesPriorities(self, organizationId: str, **kw - def updateOrganizationBrandingPolicy(self, organizationId: str, brandingPolicyId: str, **kwargs): + def updateOrganizationBrandingPolicy(self, organizationId: str, brandingPolicyId: str, name: str, **kwargs): """ **Update a branding policy** https://developer.cisco.com/meraki/api-v1/#!update-organization-branding-policy diff --git a/meraki/api/batch/spaces.py b/meraki/api/batch/spaces.py new file mode 100644 index 00000000..68fa86eb --- /dev/null +++ b/meraki/api/batch/spaces.py @@ -0,0 +1,32 @@ +import urllib + + +class ActionBatchSpaces(object): + def __init__(self): + super(ActionBatchSpaces, self).__init__() + + + + def removeOrganizationSpacesIntegration(self, organizationId: str): + """ + **Remove the Spaces integration from Meraki** + https://developer.cisco.com/meraki/api-v1/#!remove-organization-spaces-integration + + - organizationId (string): Organization ID + """ + + metadata = { + 'tags': ['organizations', 'configure', 'spaces', 'integration'], + 'operation': 'removeOrganizationSpacesIntegration' + } + resource = f'/organizations/{organizationId}/spaces/integration/remove' + + action = { + "resource": resource, + "operation": "integration", + } + return action + + + + diff --git a/meraki/api/batch/switch.py b/meraki/api/batch/switch.py index 0b84487e..7e810321 100644 --- a/meraki/api/batch/switch.py +++ b/meraki/api/batch/switch.py @@ -62,6 +62,8 @@ def updateDeviceSwitchPort(self, serial: str, portId: str, **kwargs): - accessPolicyType (string): The type of the access policy of the switch port. Only applicable to access ports. Can be one of 'Open', 'Custom access policy', 'MAC allow list' or 'Sticky MAC allow list'. - accessPolicyNumber (integer): The number of a custom access policy to configure on the switch port. Only applicable when 'accessPolicyType' is 'Custom access policy'. - macAllowList (array): Only devices with MAC addresses specified in this list will have access to this port. Up to 20 MAC addresses can be defined. Only applicable when 'accessPolicyType' is 'MAC allow list'. + - macWhitelistLimit (integer): The maximum number of MAC addresses for regular MAC allow list. Only applicable when 'accessPolicyType' is 'MAC allow list'. + Note: Config only supported on verions greater than ms18 only for classic switches. - stickyMacAllowList (array): The initial list of MAC addresses for sticky Mac allow list. Only applicable when 'accessPolicyType' is 'Sticky MAC allow list'. - stickyMacAllowListLimit (integer): The maximum number of MAC addresses for sticky MAC allow list. Only applicable when 'accessPolicyType' is 'Sticky MAC allow list'. - stormControlEnabled (boolean): The storm control status of the switch port. @@ -94,7 +96,7 @@ def updateDeviceSwitchPort(self, serial: str, portId: str, **kwargs): } resource = f'/devices/{serial}/switch/ports/{portId}' - body_params = ['name', 'tags', 'enabled', 'poeEnabled', 'type', 'vlan', 'voiceVlan', 'allowedVlans', 'isolationEnabled', 'rstpEnabled', 'stpGuard', 'linkNegotiation', 'portScheduleId', 'udld', 'accessPolicyType', 'accessPolicyNumber', 'macAllowList', 'stickyMacAllowList', 'stickyMacAllowListLimit', 'stormControlEnabled', 'adaptivePolicyGroupId', 'peerSgtCapable', 'flexibleStackingEnabled', 'daiTrusted', 'profile', 'dot3az', ] + body_params = ['name', 'tags', 'enabled', 'poeEnabled', 'type', 'vlan', 'voiceVlan', 'allowedVlans', 'isolationEnabled', 'rstpEnabled', 'stpGuard', 'linkNegotiation', 'portScheduleId', 'udld', 'accessPolicyType', 'accessPolicyNumber', 'macAllowList', 'macWhitelistLimit', 'stickyMacAllowList', 'stickyMacAllowListLimit', 'stormControlEnabled', 'adaptivePolicyGroupId', 'peerSgtCapable', 'flexibleStackingEnabled', 'daiTrusted', 'profile', 'dot3az', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { "resource": resource, @@ -114,7 +116,7 @@ def createDeviceSwitchRoutingInterface(self, serial: str, name: str, **kwargs): https://developer.cisco.com/meraki/api-v1/#!create-device-switch-routing-interface - serial (string): Serial - - name (string): A friendly name or description for the interface or VLAN. + - name (string): A friendly name or description for the interface or VLAN (max length 128 characters). - subnet (string): The network that this L3 interface is on, in CIDR notation (ex. 10.1.1.0/24). - interfaceIp (string): The IP address that will be used for Layer 3 routing on this VLAN or subnet. This cannot be the same as the device management IP. - multicastRouting (string): Enable multicast support if, multicast routing between VLANs is required. Options are: 'disabled', 'enabled' or 'IGMP snooping querier'. Default is 'disabled'. @@ -157,7 +159,7 @@ def updateDeviceSwitchRoutingInterface(self, serial: str, interfaceId: str, **kw - serial (string): Serial - interfaceId (string): Interface ID - - name (string): A friendly name or description for the interface or VLAN. + - name (string): A friendly name or description for the interface or VLAN (max length 128 characters). - subnet (string): The network that this L3 interface is on, in CIDR notation (ex. 10.1.1.0/24). - interfaceIp (string): The IP address that will be used for Layer 3 routing on this VLAN or subnet. This cannot be the same as the device management IP. - multicastRouting (string): Enable multicast support if, multicast routing between VLANs is required. Options are: 'disabled', 'enabled' or 'IGMP snooping querier'. Default is 'disabled'. @@ -412,7 +414,7 @@ def createNetworkSwitchAccessPolicy(self, networkId: str, name: str, radiusServe https://developer.cisco.com/meraki/api-v1/#!create-network-switch-access-policy - networkId (string): Network ID - - name (string): Name of the access policy + - name (string): Name of the access policy(max length 255) - radiusServers (array): List of RADIUS servers to require connecting devices to authenticate against before granting network access - radiusTestingEnabled (boolean): If enabled, Meraki devices will periodically send access-request messages to these RADIUS servers - radiusCoaSupportEnabled (boolean): Change of authentication for RADIUS re-authentication and disconnection @@ -467,7 +469,7 @@ def updateNetworkSwitchAccessPolicy(self, networkId: str, accessPolicyNumber: st - networkId (string): Network ID - accessPolicyNumber (string): Access policy number - - name (string): Name of the access policy + - name (string): Name of the access policy(max length 255) - radiusServers (array): List of RADIUS servers to require connecting devices to authenticate against before granting network access - radius (object): Object for RADIUS Settings - guestPortBouncing (boolean): If enabled, Meraki devices will periodically send access-request messages to these RADIUS servers @@ -1239,7 +1241,7 @@ def createNetworkSwitchStackRoutingInterface(self, networkId: str, switchStackId - networkId (string): Network ID - switchStackId (string): Switch stack ID - - name (string): A friendly name or description for the interface or VLAN. + - name (string): A friendly name or description for the interface or VLAN (max length 128 characters). - subnet (string): The network that this L3 interface is on, in CIDR notation (ex. 10.1.1.0/24). - interfaceIp (string): The IP address that will be used for Layer 3 routing on this VLAN or subnet. This cannot be the same as the device management IP. - multicastRouting (string): Enable multicast support if, multicast routing between VLANs is required. Options are: 'disabled', 'enabled' or 'IGMP snooping querier'. Default is 'disabled'. @@ -1283,7 +1285,7 @@ def updateNetworkSwitchStackRoutingInterface(self, networkId: str, switchStackId - networkId (string): Network ID - switchStackId (string): Switch stack ID - interfaceId (string): Interface ID - - name (string): A friendly name or description for the interface or VLAN. + - name (string): A friendly name or description for the interface or VLAN (max length 128 characters). - subnet (string): The network that this L3 interface is on, in CIDR notation (ex. 10.1.1.0/24). - interfaceIp (string): The IP address that will be used for Layer 3 routing on this VLAN or subnet. This cannot be the same as the device management IP. - multicastRouting (string): Enable multicast support if, multicast routing between VLANs is required. Options are: 'disabled', 'enabled' or 'IGMP snooping querier'. Default is 'disabled'. @@ -1598,6 +1600,8 @@ def updateOrganizationConfigTemplateSwitchProfilePort(self, organizationId: str, - accessPolicyType (string): The type of the access policy of the switch template port. Only applicable to access ports. Can be one of 'Open', 'Custom access policy', 'MAC allow list' or 'Sticky MAC allow list'. - accessPolicyNumber (integer): The number of a custom access policy to configure on the switch template port. Only applicable when 'accessPolicyType' is 'Custom access policy'. - macAllowList (array): Only devices with MAC addresses specified in this list will have access to this port. Up to 20 MAC addresses can be defined. Only applicable when 'accessPolicyType' is 'MAC allow list'. + - macWhitelistLimit (integer): The maximum number of MAC addresses for regular MAC allow list. Only applicable when 'accessPolicyType' is 'MAC allow list'. + Note: Config only supported on verions greater than ms18 only for classic switches. - stickyMacAllowList (array): The initial list of MAC addresses for sticky Mac allow list. Only applicable when 'accessPolicyType' is 'Sticky MAC allow list'. - stickyMacAllowListLimit (integer): The maximum number of MAC addresses for sticky MAC allow list. Only applicable when 'accessPolicyType' is 'Sticky MAC allow list'. - stormControlEnabled (boolean): The storm control status of the switch template port. @@ -1628,7 +1632,7 @@ def updateOrganizationConfigTemplateSwitchProfilePort(self, organizationId: str, } resource = f'/organizations/{organizationId}/configTemplates/{configTemplateId}/switch/profiles/{profileId}/ports/{portId}' - body_params = ['name', 'tags', 'enabled', 'poeEnabled', 'type', 'vlan', 'voiceVlan', 'allowedVlans', 'isolationEnabled', 'rstpEnabled', 'stpGuard', 'linkNegotiation', 'portScheduleId', 'udld', 'accessPolicyType', 'accessPolicyNumber', 'macAllowList', 'stickyMacAllowList', 'stickyMacAllowListLimit', 'stormControlEnabled', 'flexibleStackingEnabled', 'daiTrusted', 'profile', 'dot3az', ] + body_params = ['name', 'tags', 'enabled', 'poeEnabled', 'type', 'vlan', 'voiceVlan', 'allowedVlans', 'isolationEnabled', 'rstpEnabled', 'stpGuard', 'linkNegotiation', 'portScheduleId', 'udld', 'accessPolicyType', 'accessPolicyNumber', 'macAllowList', 'macWhitelistLimit', 'stickyMacAllowList', 'stickyMacAllowListLimit', 'stormControlEnabled', 'flexibleStackingEnabled', 'daiTrusted', 'profile', 'dot3az', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { "resource": resource, diff --git a/meraki/api/batch/wireless.py b/meraki/api/batch/wireless.py index d8183def..77e391f0 100644 --- a/meraki/api/batch/wireless.py +++ b/meraki/api/batch/wireless.py @@ -532,6 +532,38 @@ def deleteNetworkWirelessEthernetPortsProfile(self, networkId: str, profileId: s + def updateNetworkWirelessLocationScanning(self, networkId: str, **kwargs): + """ + **Change scanning API settings** + https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-location-scanning + + - networkId (string): Network ID + - enabled (boolean): Collect location and scanning analytics + - api (object): Enable push API for scanning events, analytics must be enabled + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'configure', 'location', 'scanning'], + 'operation': 'updateNetworkWirelessLocationScanning' + } + resource = f'/networks/{networkId}/wireless/location/scanning' + + body_params = ['enabled', 'api', ] + 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 createNetworkWirelessRfProfile(self, networkId: str, name: str, bandSelectionType: str, **kwargs): """ **Creates new RF profile for this network** @@ -760,6 +792,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): - visible (boolean): Boolean indicating whether APs should advertise or hide this SSID. APs will only broadcast this SSID if set to true - availableOnAllAps (boolean): Boolean indicating whether all APs should broadcast the SSID or if it should be restricted to APs matching any availability tags. Can only be false if the SSID has availability tags. - availabilityTags (array): Accepts a list of tags for this SSID. If availableOnAllAps is false, then the SSID will only be broadcast by APs with tags matching any of the tags in this list. + - adaptivePolicyGroupId (string): Adaptive policy group ID this SSID is assigned to. - mandatoryDhcpEnabled (boolean): If true, Mandatory DHCP will enforce that clients connecting to this SSID must use the IP address assigned by the DHCP server. Clients who use a static IP address won't be able to associate. - adultContentFilteringEnabled (boolean): Boolean indicating whether or not adult content will be blocked - dnsRewrite (object): DNS servers rewrite settings @@ -800,7 +833,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): } resource = f'/networks/{networkId}/wireless/ssids/{number}' - body_params = ['name', 'enabled', 'localAuth', 'authMode', 'enterpriseAdminAccess', 'encryptionMode', 'psk', 'wpaEncryptionMode', 'dot11w', 'dot11r', 'splashPage', 'splashGuestSponsorDomains', 'oauth', 'localRadius', 'ldap', 'activeDirectory', 'radiusServers', 'radiusProxyEnabled', 'radiusTestingEnabled', 'radiusCalledStationId', 'radiusAuthenticationNasId', 'radiusServerTimeout', 'radiusServerAttemptsLimit', 'radiusFallbackEnabled', 'radiusRadsec', 'radiusCoaEnabled', 'radiusFailoverPolicy', 'radiusLoadBalancingPolicy', 'radiusAccountingEnabled', 'radiusAccountingServers', 'radiusAccountingInterimInterval', 'radiusAttributeForGroupPolicies', 'ipAssignmentMode', 'useVlanTagging', 'concentratorNetworkId', 'secondaryConcentratorNetworkId', 'disassociateClientsOnVpnFailover', 'vlanId', 'defaultVlanId', 'apTagsAndVlanIds', 'walledGardenEnabled', 'walledGardenRanges', 'gre', 'radiusOverride', 'radiusGuestVlanEnabled', 'radiusGuestVlanId', 'minBitrate', 'bandSelection', 'perClientBandwidthLimitUp', 'perClientBandwidthLimitDown', 'perSsidBandwidthLimitUp', 'perSsidBandwidthLimitDown', 'lanIsolationEnabled', 'visible', 'availableOnAllAps', 'availabilityTags', 'mandatoryDhcpEnabled', 'adultContentFilteringEnabled', 'dnsRewrite', 'speedBurst', 'namedVlans', ] + body_params = ['name', 'enabled', 'localAuth', 'authMode', 'enterpriseAdminAccess', 'encryptionMode', 'psk', 'wpaEncryptionMode', 'dot11w', 'dot11r', 'splashPage', 'splashGuestSponsorDomains', 'oauth', 'localRadius', 'ldap', 'activeDirectory', 'radiusServers', 'radiusProxyEnabled', 'radiusTestingEnabled', 'radiusCalledStationId', 'radiusAuthenticationNasId', 'radiusServerTimeout', 'radiusServerAttemptsLimit', 'radiusFallbackEnabled', 'radiusRadsec', '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', 'adaptivePolicyGroupId', 'mandatoryDhcpEnabled', 'adultContentFilteringEnabled', 'dnsRewrite', 'speedBurst', 'namedVlans', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} action = { "resource": resource, @@ -1282,6 +1315,101 @@ def updateNetworkWirelessSsidVpn(self, networkId: str, number: str, **kwargs): + def createOrganizationWirelessLocationScanningReceiver(self, organizationId: str, network: dict, url: str, version: str, radio: dict, sharedSecret: str): + """ + **Add new receiver for scanning API** + https://developer.cisco.com/meraki/api-v1/#!create-organization-wireless-location-scanning-receiver + + - organizationId (string): Organization ID + - network (object): Add scanning API receiver for network + - url (string): Receiver Url + - version (string): Scanning API Version + - radio (object): Add scanning API Radio + - sharedSecret (string): Secret Value for Receiver + """ + + kwargs = locals() + + metadata = { + 'tags': ['wireless', 'configure', 'location', 'scanning', 'receivers'], + 'operation': 'createOrganizationWirelessLocationScanningReceiver' + } + resource = f'/organizations/{organizationId}/wireless/location/scanning/receivers' + + body_params = ['network', 'url', 'version', 'radio', 'sharedSecret', ] + 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 updateOrganizationWirelessLocationScanningReceiver(self, organizationId: str, receiverId: str, **kwargs): + """ + **Change scanning API receiver settings** + https://developer.cisco.com/meraki/api-v1/#!update-organization-wireless-location-scanning-receiver + + - organizationId (string): Organization ID + - receiverId (string): Receiver ID + - url (string): Receiver Url + - version (string): Scanning API Version + - radio (object): Add scanning API Radio + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'configure', 'location', 'scanning', 'receivers'], + 'operation': 'updateOrganizationWirelessLocationScanningReceiver' + } + resource = f'/organizations/{organizationId}/wireless/location/scanning/receivers/{receiverId}' + + body_params = ['url', 'version', 'radio', ] + 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 deleteOrganizationWirelessLocationScanningReceiver(self, organizationId: str, receiverId: str): + """ + **Delete a scanning API receiver** + https://developer.cisco.com/meraki/api-v1/#!delete-organization-wireless-location-scanning-receiver + + - organizationId (string): Organization ID + - receiverId (string): Receiver ID + """ + + metadata = { + 'tags': ['wireless', 'configure', 'location', 'scanning', 'receivers'], + 'operation': 'deleteOrganizationWirelessLocationScanningReceiver' + } + resource = f'/organizations/{organizationId}/wireless/location/scanning/receivers/{receiverId}' + + action = { + "resource": resource, + "operation": "delete", + } + return action + + + + + + def recalculateOrganizationWirelessRadioAutoRfChannels(self, organizationId: str, networkIds: list): """ **Recalculates automatically assigned channels for every AP within specified the specified network(s). Note: This could cause a brief loss in connectivity for wireless clients.** diff --git a/meraki/api/campusGateway.py b/meraki/api/campusGateway.py new file mode 100644 index 00000000..b824ad25 --- /dev/null +++ b/meraki/api/campusGateway.py @@ -0,0 +1,108 @@ +import urllib + + +class CampusGateway(object): + def __init__(self, session): + super(CampusGateway, self).__init__() + self._session = session + + + + def createNetworkCampusGatewayCluster(self, networkId: str, name: str, uplinks: list, tunnels: list, nameservers: dict, portChannels: list, **kwargs): + """ + **Create a cluster and add campus gateways to it** + https://developer.cisco.com/meraki/api-v1/#!create-network-campus-gateway-cluster + + - networkId (string): Network ID + - name (string): Name of the new cluster + - uplinks (array): Uplink interface settings of the cluster + - tunnels (array): Tunnel interface settings of the cluster: Reuse uplink or specify tunnel interface + - nameservers (object): Nameservers of the cluster + - portChannels (array): Port channel settings of the cluster + - devices (array): Devices to be added to the cluster + - notes (string): Notes about cluster with max size of 511 characters allowed + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['campusGateway', 'configure', 'clusters'], + 'operation': 'createNetworkCampusGatewayCluster' + } + networkId = urllib.parse.quote(str(networkId), safe='') + resource = f'/networks/{networkId}/campusGateway/clusters' + + body_params = ['name', 'uplinks', 'tunnels', 'nameservers', 'portChannels', 'devices', 'notes', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.post(metadata, resource, payload) + + + + def updateNetworkCampusGatewayCluster(self, networkId: str, clusterId: str, **kwargs): + """ + **Update a cluster and add/remove campus gateways to/from it** + https://developer.cisco.com/meraki/api-v1/#!update-network-campus-gateway-cluster + + - networkId (string): Network ID + - clusterId (string): Cluster ID + - name (string): Name of the cluster + - uplinks (array): Uplink interface settings of the cluster + - tunnels (array): Tunnel interface settings of the cluster: Reuse uplink or specify tunnel interface + - nameservers (object): Nameservers of the cluster + - portChannels (array): Port channel settings of the cluster + - devices (array): Devices in the cluster + - notes (string): Notes about cluster with max size of 511 characters allowed + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['campusGateway', 'configure', 'clusters'], + 'operation': 'updateNetworkCampusGatewayCluster' + } + networkId = urllib.parse.quote(str(networkId), safe='') + clusterId = urllib.parse.quote(str(clusterId), safe='') + resource = f'/networks/{networkId}/campusGateway/clusters/{clusterId}' + + body_params = ['name', 'uplinks', 'tunnels', 'nameservers', 'portChannels', 'devices', 'notes', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.put(metadata, resource, payload) + + + + def getOrganizationCampusGatewayDevicesUplinksLocalOverridesByDevice(self, organizationId: str, total_pages=1, direction='next', **kwargs): + """ + **Uplink overrides configured locally on Campus Gateway devices in an organization.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-campus-gateway-devices-uplinks-local-overrides-by-device + + - organizationId (string): Organization ID + - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages + - direction (string): direction to paginate, either "next" (default) or "prev" page + - serials (array): A list of serial numbers. The returned devices will be filtered to only include these serials. + - 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. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['campusGateway', 'configure', 'devices', 'uplinks', 'localOverrides', 'byDevice'], + 'operation': 'getOrganizationCampusGatewayDevicesUplinksLocalOverridesByDevice' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/campusGateway/devices/uplinks/localOverrides/byDevice' + + query_params = ['serials', 'perPage', 'startingAfter', 'endingBefore', ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = ['serials', ] + for k, v in kwargs.items(): + if k.strip() in array_params: + params[f'{k.strip()}[]'] = kwargs[f'{k}'] + params.pop(k.strip()) + + return self._session.get_pages(metadata, resource, params, total_pages, direction) + diff --git a/meraki/api/networks.py b/meraki/api/networks.py index 647e793b..da1a1a6e 100644 --- a/meraki/api/networks.py +++ b/meraki/api/networks.py @@ -650,6 +650,7 @@ def claimNetworkDevices(self, networkId: str, serials: list, **kwargs): - networkId (string): Network ID - serials (array): A list of serials of devices to claim - addAtomically (boolean): Whether to claim devices atomically. If true, all devices will be claimed or none will be claimed. Default is true. + - detailsByDevice (array): Optional details for claimed devices (currently only used for Catalyst devices) """ kwargs.update(locals()) @@ -661,7 +662,7 @@ def claimNetworkDevices(self, networkId: str, serials: list, **kwargs): networkId = urllib.parse.quote(str(networkId), safe='') resource = f'/networks/{networkId}/devices/claim' - body_params = ['serials', ] + body_params = ['serials', 'detailsByDevice', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} return self._session.post(metadata, resource, payload) @@ -731,7 +732,7 @@ def getNetworkEvents(self, networkId: str, total_pages=1, direction='prev', even - total_pages (integer or string): use with perPage to get total results up to total_pages*perPage; -1 or "all" for all pages - direction (string): direction to paginate, either "next" or "prev" (default) page - event_log_end_time (string): ISO8601 Zulu/UTC time, to use in conjunction with startingAfter, to retrieve events within a time window - - productType (string): The product type to fetch events for. This parameter is required for networks with multiple device types. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, wirelessController, and secureConnect + - productType (string): The product type to fetch events for. This parameter is required for networks with multiple device types. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, wirelessController, campusGateway, and secureConnect - includedEventTypes (array): A list of event types. The returned events will be filtered to only include events with these types. - excludedEventTypes (array): A list of event types. The returned events will be filtered to exclude events with these types. - deviceMac (string): The MAC address of the Meraki device which the list of events will be filtered with @@ -753,7 +754,7 @@ def getNetworkEvents(self, networkId: str, total_pages=1, direction='prev', even kwargs.update(locals()) if 'productType' in kwargs: - options = ['appliance', 'camera', 'cellularGateway', 'secureConnect', 'switch', 'systemsManager', 'wireless', 'wirelessController'] + options = ['appliance', 'camera', 'campusGateway', 'cellularGateway', 'secureConnect', 'switch', 'systemsManager', 'wireless', 'wirelessController'] assert kwargs['productType'] in options, f'''"productType" cannot be "{kwargs['productType']}", & must be set to one of: {options}''' metadata = { diff --git a/meraki/api/organizations.py b/meraki/api/organizations.py index 17ea9c4a..9ff3ddaf 100644 --- a/meraki/api/organizations.py +++ b/meraki/api/organizations.py @@ -1398,7 +1398,7 @@ def getOrganizationBrandingPolicies(self, organizationId: str): - def createOrganizationBrandingPolicy(self, organizationId: str, **kwargs): + def createOrganizationBrandingPolicy(self, organizationId: str, name: str, **kwargs): """ **Add a new branding policy to an organization** https://developer.cisco.com/meraki/api-v1/#!create-organization-branding-policy @@ -1497,7 +1497,7 @@ def getOrganizationBrandingPolicy(self, organizationId: str, brandingPolicyId: s - def updateOrganizationBrandingPolicy(self, organizationId: str, brandingPolicyId: str, **kwargs): + def updateOrganizationBrandingPolicy(self, organizationId: str, brandingPolicyId: str, name: str, **kwargs): """ **Update a branding policy** https://developer.cisco.com/meraki/api-v1/#!update-organization-branding-policy @@ -1856,7 +1856,7 @@ def getOrganizationDevices(self, organizationId: str, total_pages=1, direction=' - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - configurationUpdatedAfter (string): Filter results by whether or not the device's configuration has been updated after the given timestamp - networkIds (array): Optional parameter to filter devices by network. - - productTypes (array): Optional parameter to filter devices by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, wirelessController, and secureConnect. + - productTypes (array): Optional parameter to filter devices by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, wirelessController, campusGateway, and secureConnect. - tags (array): Optional parameter to filter devices by tags. - tagsFilterType (string): Optional parameter of value 'withAnyTags' or 'withAllTags' to indicate whether to return networks which contain ANY or ALL of the included tags. If no type is included, 'withAnyTags' will be selected. - name (string): Optional parameter to filter devices by name. All returned devices will have a name that contains the search term or is an exact match. @@ -2197,6 +2197,35 @@ def createOrganizationDevicesPacketCaptureCapture(self, organizationId: str, ser + def bulkOrganizationDevicesPacketCaptureCapturesCreate(self, organizationId: str, devices: list, name: str, **kwargs): + """ + **Perform a packet capture on multiple devices and store in Meraki Cloud.** + https://developer.cisco.com/meraki/api-v1/#!bulk-organization-devices-packet-capture-captures-create + + - organizationId (string): Organization ID + - devices (array): Device details (maximum of 20 devices allowed) + - name (string): Name of packet capture file + - notes (string): Reason for capture + - duration (integer): Duration of the capture in seconds + - filterExpression (string): Filter expression for the capture + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['organizations', 'configure', 'devices', 'packetCapture', 'captures'], + 'operation': 'bulkOrganizationDevicesPacketCaptureCapturesCreate' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/devices/packetCapture/captures/bulkCreate' + + body_params = ['devices', 'notes', 'duration', 'filterExpression', 'name', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.post(metadata, resource, payload) + + + def bulkOrganizationDevicesPacketCaptureCapturesDelete(self, organizationId: str, captureIds: list): """ **BulkDelete packet captures from cloud** @@ -2541,7 +2570,7 @@ def getOrganizationDevicesStatuses(self, organizationId: str, total_pages=1, dir - networkIds (array): Optional parameter to filter devices by network ids. - serials (array): Optional parameter to filter devices by serials. - statuses (array): Optional parameter to filter devices by statuses. Valid statuses are ["online", "alerting", "offline", "dormant"]. - - productTypes (array): An optional parameter to filter device statuses by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, wirelessController, and secureConnect. + - productTypes (array): An optional parameter to filter device statuses by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, wirelessController, campusGateway, and secureConnect. - models (array): Optional parameter to filter devices by models. - tags (array): An optional parameter to filter devices by tags. The filtering is case-sensitive. If tags are included, 'tagsFilterType' should also be included (see below). - tagsFilterType (string): An optional parameter of value 'withAnyTags' or 'withAllTags' to indicate whether to return devices which contain ANY or ALL of the included tags. If no type is included, 'withAnyTags' will be selected. @@ -2579,7 +2608,7 @@ def getOrganizationDevicesStatusesOverview(self, organizationId: str, **kwargs): https://developer.cisco.com/meraki/api-v1/#!get-organization-devices-statuses-overview - organizationId (string): Organization ID - - productTypes (array): An optional parameter to filter device statuses by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, wirelessController, and secureConnect. + - productTypes (array): An optional parameter to filter device statuses by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, wirelessController, campusGateway, and secureConnect. - networkIds (array): An optional parameter to filter device statuses by network. """ @@ -2622,7 +2651,7 @@ def getOrganizationDevicesSystemMemoryUsageHistoryByInterval(self, organizationI - interval (integer): The time interval in seconds for returned data. The valid intervals are: 300, 1200, 3600, 14400. The default is 300. Interval is calculated if time params are provided. - networkIds (array): Optional parameter to filter the result set by the included set of network IDs - serials (array): Optional parameter to filter device availabilities history by device serial numbers - - productTypes (array): Optional parameter to filter device statuses by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, wirelessController, and secureConnect. + - productTypes (array): Optional parameter to filter device statuses by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, wirelessController, campusGateway, and secureConnect. """ kwargs.update(locals()) @@ -3142,7 +3171,7 @@ def getOrganizationInventoryDevices(self, organizationId: str, total_pages=1, di - orderNumbers (array): Search for devices in inventory based on order numbers. - tags (array): Filter devices by tags. The filtering is case-sensitive. If tags are included, 'tagsFilterType' should also be included (see below). - tagsFilterType (string): To use with 'tags' parameter, to filter devices which contain ANY or ALL given tags. Accepted values are 'withAnyTags' or 'withAllTags', default is 'withAnyTags'. - - productTypes (array): Filter devices by product type. Accepted values are appliance, camera, cellularGateway, secureConnect, sensor, switch, systemsManager, wireless, and wirelessController. + - productTypes (array): Filter devices by product type. Accepted values are appliance, camera, campusGateway, cellularGateway, secureConnect, sensor, switch, systemsManager, wireless, and wirelessController. """ kwargs.update(locals()) @@ -4921,7 +4950,7 @@ def getOrganizationWebhooksAlertTypes(self, organizationId: str, **kwargs): kwargs.update(locals()) if 'productType' in kwargs: - options = ['appliance', 'camera', 'cellularGateway', 'health', 'platform', 'sensor', 'sm', 'switch', 'wireless'] + options = ['appliance', 'camera', 'cellularGateway', 'platform', 'sensor', 'sm', 'switch', 'wireless'] assert kwargs['productType'] in options, f'''"productType" cannot be "{kwargs['productType']}", & must be set to one of: {options}''' metadata = { diff --git a/meraki/api/spaces.py b/meraki/api/spaces.py new file mode 100644 index 00000000..e59cc58c --- /dev/null +++ b/meraki/api/spaces.py @@ -0,0 +1,27 @@ +import urllib + + +class Spaces(object): + def __init__(self, session): + super(Spaces, self).__init__() + self._session = session + + + + def removeOrganizationSpacesIntegration(self, organizationId: str): + """ + **Remove the Spaces integration from Meraki** + https://developer.cisco.com/meraki/api-v1/#!remove-organization-spaces-integration + + - organizationId (string): Organization ID + """ + + metadata = { + 'tags': ['organizations', 'configure', 'spaces', 'integration'], + 'operation': 'removeOrganizationSpacesIntegration' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/spaces/integration/remove' + + return self._session.post(metadata, resource) + diff --git a/meraki/api/switch.py b/meraki/api/switch.py index 2921bd40..893a70ab 100644 --- a/meraki/api/switch.py +++ b/meraki/api/switch.py @@ -149,6 +149,8 @@ def updateDeviceSwitchPort(self, serial: str, portId: str, **kwargs): - accessPolicyType (string): The type of the access policy of the switch port. Only applicable to access ports. Can be one of 'Open', 'Custom access policy', 'MAC allow list' or 'Sticky MAC allow list'. - accessPolicyNumber (integer): The number of a custom access policy to configure on the switch port. Only applicable when 'accessPolicyType' is 'Custom access policy'. - macAllowList (array): Only devices with MAC addresses specified in this list will have access to this port. Up to 20 MAC addresses can be defined. Only applicable when 'accessPolicyType' is 'MAC allow list'. + - macWhitelistLimit (integer): The maximum number of MAC addresses for regular MAC allow list. Only applicable when 'accessPolicyType' is 'MAC allow list'. + Note: Config only supported on verions greater than ms18 only for classic switches. - stickyMacAllowList (array): The initial list of MAC addresses for sticky Mac allow list. Only applicable when 'accessPolicyType' is 'Sticky MAC allow list'. - stickyMacAllowListLimit (integer): The maximum number of MAC addresses for sticky MAC allow list. Only applicable when 'accessPolicyType' is 'Sticky MAC allow list'. - stormControlEnabled (boolean): The storm control status of the switch port. @@ -183,7 +185,7 @@ def updateDeviceSwitchPort(self, serial: str, portId: str, **kwargs): portId = urllib.parse.quote(str(portId), safe='') resource = f'/devices/{serial}/switch/ports/{portId}' - body_params = ['name', 'tags', 'enabled', 'poeEnabled', 'type', 'vlan', 'voiceVlan', 'allowedVlans', 'isolationEnabled', 'rstpEnabled', 'stpGuard', 'linkNegotiation', 'portScheduleId', 'udld', 'accessPolicyType', 'accessPolicyNumber', 'macAllowList', 'stickyMacAllowList', 'stickyMacAllowListLimit', 'stormControlEnabled', 'adaptivePolicyGroupId', 'peerSgtCapable', 'flexibleStackingEnabled', 'daiTrusted', 'profile', 'dot3az', ] + body_params = ['name', 'tags', 'enabled', 'poeEnabled', 'type', 'vlan', 'voiceVlan', 'allowedVlans', 'isolationEnabled', 'rstpEnabled', 'stpGuard', 'linkNegotiation', 'portScheduleId', 'udld', 'accessPolicyType', 'accessPolicyNumber', 'macAllowList', 'macWhitelistLimit', 'stickyMacAllowList', 'stickyMacAllowListLimit', 'stormControlEnabled', 'adaptivePolicyGroupId', 'peerSgtCapable', 'flexibleStackingEnabled', 'daiTrusted', 'profile', 'dot3az', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} return self._session.put(metadata, resource, payload) @@ -225,7 +227,7 @@ def createDeviceSwitchRoutingInterface(self, serial: str, name: str, **kwargs): https://developer.cisco.com/meraki/api-v1/#!create-device-switch-routing-interface - serial (string): Serial - - name (string): A friendly name or description for the interface or VLAN. + - name (string): A friendly name or description for the interface or VLAN (max length 128 characters). - subnet (string): The network that this L3 interface is on, in CIDR notation (ex. 10.1.1.0/24). - interfaceIp (string): The IP address that will be used for Layer 3 routing on this VLAN or subnet. This cannot be the same as the device management IP. - multicastRouting (string): Enable multicast support if, multicast routing between VLANs is required. Options are: 'disabled', 'enabled' or 'IGMP snooping querier'. Default is 'disabled'. @@ -283,7 +285,7 @@ def updateDeviceSwitchRoutingInterface(self, serial: str, interfaceId: str, **kw - serial (string): Serial - interfaceId (string): Interface ID - - name (string): A friendly name or description for the interface or VLAN. + - name (string): A friendly name or description for the interface or VLAN (max length 128 characters). - subnet (string): The network that this L3 interface is on, in CIDR notation (ex. 10.1.1.0/24). - interfaceIp (string): The IP address that will be used for Layer 3 routing on this VLAN or subnet. This cannot be the same as the device management IP. - multicastRouting (string): Enable multicast support if, multicast routing between VLANs is required. Options are: 'disabled', 'enabled' or 'IGMP snooping querier'. Default is 'disabled'. @@ -644,7 +646,7 @@ def createNetworkSwitchAccessPolicy(self, networkId: str, name: str, radiusServe https://developer.cisco.com/meraki/api-v1/#!create-network-switch-access-policy - networkId (string): Network ID - - name (string): Name of the access policy + - name (string): Name of the access policy(max length 255) - radiusServers (array): List of RADIUS servers to require connecting devices to authenticate against before granting network access - radiusTestingEnabled (boolean): If enabled, Meraki devices will periodically send access-request messages to these RADIUS servers - radiusCoaSupportEnabled (boolean): Change of authentication for RADIUS re-authentication and disconnection @@ -714,7 +716,7 @@ def updateNetworkSwitchAccessPolicy(self, networkId: str, accessPolicyNumber: st - networkId (string): Network ID - accessPolicyNumber (string): Access policy number - - name (string): Name of the access policy + - name (string): Name of the access policy(max length 255) - radiusServers (array): List of RADIUS servers to require connecting devices to authenticate against before granting network access - radius (object): Object for RADIUS Settings - guestPortBouncing (boolean): If enabled, Meraki devices will periodically send access-request messages to these RADIUS servers @@ -1940,7 +1942,7 @@ def createNetworkSwitchStackRoutingInterface(self, networkId: str, switchStackId - networkId (string): Network ID - switchStackId (string): Switch stack ID - - name (string): A friendly name or description for the interface or VLAN. + - name (string): A friendly name or description for the interface or VLAN (max length 128 characters). - subnet (string): The network that this L3 interface is on, in CIDR notation (ex. 10.1.1.0/24). - interfaceIp (string): The IP address that will be used for Layer 3 routing on this VLAN or subnet. This cannot be the same as the device management IP. - multicastRouting (string): Enable multicast support if, multicast routing between VLANs is required. Options are: 'disabled', 'enabled' or 'IGMP snooping querier'. Default is 'disabled'. @@ -2002,7 +2004,7 @@ def updateNetworkSwitchStackRoutingInterface(self, networkId: str, switchStackId - networkId (string): Network ID - switchStackId (string): Switch stack ID - interfaceId (string): Interface ID - - name (string): A friendly name or description for the interface or VLAN. + - name (string): A friendly name or description for the interface or VLAN (max length 128 characters). - subnet (string): The network that this L3 interface is on, in CIDR notation (ex. 10.1.1.0/24). - interfaceIp (string): The IP address that will be used for Layer 3 routing on this VLAN or subnet. This cannot be the same as the device management IP. - multicastRouting (string): Enable multicast support if, multicast routing between VLANs is required. Options are: 'disabled', 'enabled' or 'IGMP snooping querier'. Default is 'disabled'. @@ -2454,6 +2456,8 @@ def updateOrganizationConfigTemplateSwitchProfilePort(self, organizationId: str, - accessPolicyType (string): The type of the access policy of the switch template port. Only applicable to access ports. Can be one of 'Open', 'Custom access policy', 'MAC allow list' or 'Sticky MAC allow list'. - accessPolicyNumber (integer): The number of a custom access policy to configure on the switch template port. Only applicable when 'accessPolicyType' is 'Custom access policy'. - macAllowList (array): Only devices with MAC addresses specified in this list will have access to this port. Up to 20 MAC addresses can be defined. Only applicable when 'accessPolicyType' is 'MAC allow list'. + - macWhitelistLimit (integer): The maximum number of MAC addresses for regular MAC allow list. Only applicable when 'accessPolicyType' is 'MAC allow list'. + Note: Config only supported on verions greater than ms18 only for classic switches. - stickyMacAllowList (array): The initial list of MAC addresses for sticky Mac allow list. Only applicable when 'accessPolicyType' is 'Sticky MAC allow list'. - stickyMacAllowListLimit (integer): The maximum number of MAC addresses for sticky MAC allow list. Only applicable when 'accessPolicyType' is 'Sticky MAC allow list'. - stormControlEnabled (boolean): The storm control status of the switch template port. @@ -2488,7 +2492,7 @@ def updateOrganizationConfigTemplateSwitchProfilePort(self, organizationId: str, portId = urllib.parse.quote(str(portId), safe='') resource = f'/organizations/{organizationId}/configTemplates/{configTemplateId}/switch/profiles/{profileId}/ports/{portId}' - body_params = ['name', 'tags', 'enabled', 'poeEnabled', 'type', 'vlan', 'voiceVlan', 'allowedVlans', 'isolationEnabled', 'rstpEnabled', 'stpGuard', 'linkNegotiation', 'portScheduleId', 'udld', 'accessPolicyType', 'accessPolicyNumber', 'macAllowList', 'stickyMacAllowList', 'stickyMacAllowListLimit', 'stormControlEnabled', 'flexibleStackingEnabled', 'daiTrusted', 'profile', 'dot3az', ] + body_params = ['name', 'tags', 'enabled', 'poeEnabled', 'type', 'vlan', 'voiceVlan', 'allowedVlans', 'isolationEnabled', 'rstpEnabled', 'stpGuard', 'linkNegotiation', 'portScheduleId', 'udld', 'accessPolicyType', 'accessPolicyNumber', 'macAllowList', 'macWhitelistLimit', 'stickyMacAllowList', 'stickyMacAllowListLimit', 'stormControlEnabled', 'flexibleStackingEnabled', 'daiTrusted', 'profile', 'dot3az', ] payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} return self._session.put(metadata, resource, payload) diff --git a/meraki/api/wireless.py b/meraki/api/wireless.py index 2fd3642a..3754d645 100644 --- a/meraki/api/wireless.py +++ b/meraki/api/wireless.py @@ -1349,6 +1349,32 @@ def getNetworkWirelessLatencyStats(self, networkId: str, **kwargs): + def updateNetworkWirelessLocationScanning(self, networkId: str, **kwargs): + """ + **Change scanning API settings** + https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-location-scanning + + - networkId (string): Network ID + - enabled (boolean): Collect location and scanning analytics + - api (object): Enable push API for scanning events, analytics must be enabled + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'configure', 'location', 'scanning'], + 'operation': 'updateNetworkWirelessLocationScanning' + } + networkId = urllib.parse.quote(str(networkId), safe='') + resource = f'/networks/{networkId}/wireless/location/scanning' + + body_params = ['enabled', 'api', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.put(metadata, resource, payload) + + + def getNetworkWirelessMeshStatuses(self, networkId: str, total_pages=1, direction='next', **kwargs): """ **List wireless mesh statuses for repeaters** @@ -1727,6 +1753,7 @@ def updateNetworkWirelessSsid(self, networkId: str, number: str, **kwargs): - visible (boolean): Boolean indicating whether APs should advertise or hide this SSID. APs will only broadcast this SSID if set to true - availableOnAllAps (boolean): Boolean indicating whether all APs should broadcast the SSID or if it should be restricted to APs matching any availability tags. Can only be false if the SSID has availability tags. - availabilityTags (array): Accepts a list of tags for this SSID. If availableOnAllAps is false, then the SSID will only be broadcast by APs with tags matching any of the tags in this list. + - adaptivePolicyGroupId (string): Adaptive policy group ID this SSID is assigned to. - mandatoryDhcpEnabled (boolean): If true, Mandatory DHCP will enforce that clients connecting to this SSID must use the IP address assigned by the DHCP server. Clients who use a static IP address won't be able to associate. - adultContentFilteringEnabled (boolean): Boolean indicating whether or not adult content will be blocked - dnsRewrite (object): DNS servers rewrite settings @@ -1769,7 +1796,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', 'localAuth', 'authMode', 'enterpriseAdminAccess', 'encryptionMode', 'psk', 'wpaEncryptionMode', 'dot11w', 'dot11r', 'splashPage', 'splashGuestSponsorDomains', 'oauth', 'localRadius', 'ldap', 'activeDirectory', 'radiusServers', 'radiusProxyEnabled', 'radiusTestingEnabled', 'radiusCalledStationId', 'radiusAuthenticationNasId', 'radiusServerTimeout', 'radiusServerAttemptsLimit', 'radiusFallbackEnabled', 'radiusRadsec', 'radiusCoaEnabled', 'radiusFailoverPolicy', 'radiusLoadBalancingPolicy', 'radiusAccountingEnabled', 'radiusAccountingServers', 'radiusAccountingInterimInterval', 'radiusAttributeForGroupPolicies', 'ipAssignmentMode', 'useVlanTagging', 'concentratorNetworkId', 'secondaryConcentratorNetworkId', 'disassociateClientsOnVpnFailover', 'vlanId', 'defaultVlanId', 'apTagsAndVlanIds', 'walledGardenEnabled', 'walledGardenRanges', 'gre', 'radiusOverride', 'radiusGuestVlanEnabled', 'radiusGuestVlanId', 'minBitrate', 'bandSelection', 'perClientBandwidthLimitUp', 'perClientBandwidthLimitDown', 'perSsidBandwidthLimitUp', 'perSsidBandwidthLimitDown', 'lanIsolationEnabled', 'visible', 'availableOnAllAps', 'availabilityTags', 'mandatoryDhcpEnabled', 'adultContentFilteringEnabled', 'dnsRewrite', 'speedBurst', 'namedVlans', ] + body_params = ['name', 'enabled', 'localAuth', 'authMode', 'enterpriseAdminAccess', 'encryptionMode', 'psk', 'wpaEncryptionMode', 'dot11w', 'dot11r', 'splashPage', 'splashGuestSponsorDomains', 'oauth', 'localRadius', 'ldap', 'activeDirectory', 'radiusServers', 'radiusProxyEnabled', 'radiusTestingEnabled', 'radiusCalledStationId', 'radiusAuthenticationNasId', 'radiusServerTimeout', 'radiusServerAttemptsLimit', 'radiusFallbackEnabled', 'radiusRadsec', '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', 'adaptivePolicyGroupId', '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) @@ -2949,6 +2976,144 @@ def getOrganizationWirelessDevicesPowerModeHistory(self, organizationId: str, to + def getOrganizationWirelessDevicesRadsecCertificatesAuthorities(self, organizationId: str, **kwargs): + """ + **Query for details on the organization's RADSEC device Certificate Authority certificates (CAs)** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-radsec-certificates-authorities + + - organizationId (string): Organization ID + - certificateAuthorityIds (array): Optional parameter to filter CAs by one or more CA IDs. All returned CAs will have an ID that is an exact match. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'configure', 'devices', 'radsec', 'certificates', 'authorities'], + 'operation': 'getOrganizationWirelessDevicesRadsecCertificatesAuthorities' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/wireless/devices/radsec/certificates/authorities' + + query_params = ['certificateAuthorityIds', ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = ['certificateAuthorityIds', ] + 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(metadata, resource, params) + + + + def updateOrganizationWirelessDevicesRadsecCertificatesAuthorities(self, organizationId: str, **kwargs): + """ + **Update an organization's RADSEC device Certificate Authority (CA) state** + https://developer.cisco.com/meraki/api-v1/#!update-organization-wireless-devices-radsec-certificates-authorities + + - organizationId (string): Organization ID + - status (string): The "status" to update the Certificate Authority to. Only valid option is "trusted". + - certificateAuthorityId (string): The ID of the Certificate Authority to update. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'configure', 'devices', 'radsec', 'certificates', 'authorities'], + 'operation': 'updateOrganizationWirelessDevicesRadsecCertificatesAuthorities' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/wireless/devices/radsec/certificates/authorities' + + body_params = ['status', 'certificateAuthorityId', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.put(metadata, resource, payload) + + + + def createOrganizationWirelessDevicesRadsecCertificatesAuthority(self, organizationId: str): + """ + **Create an organization's RADSEC device Certificate Authority (CA)** + https://developer.cisco.com/meraki/api-v1/#!create-organization-wireless-devices-radsec-certificates-authority + + - organizationId (string): Organization ID + """ + + metadata = { + 'tags': ['wireless', 'configure', 'devices', 'radsec', 'certificates', 'authorities'], + 'operation': 'createOrganizationWirelessDevicesRadsecCertificatesAuthority' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/wireless/devices/radsec/certificates/authorities' + + return self._session.post(metadata, resource) + + + + def getOrganizationWirelessDevicesRadsecCertificatesAuthoritiesCrls(self, organizationId: str, **kwargs): + """ + **Query for certificate revocation list (CRL) for the organization's RADSEC device Certificate Authorities (CAs).** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-radsec-certificates-authorities-crls + + - organizationId (string): Organization ID + - certificateAuthorityIds (array): Optional parameter to filter CAs by one or more CA IDs. All returned CAs will have an ID that is an exact match. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'configure', 'devices', 'radsec', 'certificates', 'authorities', 'crls'], + 'operation': 'getOrganizationWirelessDevicesRadsecCertificatesAuthoritiesCrls' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/wireless/devices/radsec/certificates/authorities/crls' + + query_params = ['certificateAuthorityIds', ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = ['certificateAuthorityIds', ] + 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(metadata, resource, params) + + + + def getOrganizationWirelessDevicesRadsecCertificatesAuthoritiesCrlsDeltas(self, organizationId: str, **kwargs): + """ + **Query for all delta certificate revocation list (CRL) for the organization's RADSEC device Certificate Authority (CA) with the given id.** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-devices-radsec-certificates-authorities-crls-deltas + + - organizationId (string): Organization ID + - certificateAuthorityIds (array): Parameter to filter CAs by one or more CA IDs. All returned CAs will have an ID that is an exact match. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'configure', 'devices', 'radsec', 'certificates', 'authorities', 'crls', 'deltas'], + 'operation': 'getOrganizationWirelessDevicesRadsecCertificatesAuthoritiesCrlsDeltas' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/wireless/devices/radsec/certificates/authorities/crls/deltas' + + query_params = ['certificateAuthorityIds', ] + params = {k.strip(): v for k, v in kwargs.items() if k.strip() in query_params} + + array_params = ['certificateAuthorityIds', ] + 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(metadata, resource, params) + + + def getOrganizationWirelessDevicesSystemCpuLoadHistory(self, organizationId: str, total_pages=1, direction='next', **kwargs): """ **Return the CPU Load history for a list of wireless devices in the organization.** @@ -3027,6 +3192,157 @@ def getOrganizationWirelessDevicesWirelessControllersByDevice(self, organization + def getOrganizationWirelessLocationScanningByNetwork(self, organizationId: str, total_pages=1, direction='next', **kwargs): + """ + **Return scanning API settings** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-location-scanning-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 - 250. 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 scanning settings by network ID. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'configure', 'location', 'scanning', 'byNetwork'], + 'operation': 'getOrganizationWirelessLocationScanningByNetwork' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/wireless/location/scanning/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 getOrganizationWirelessLocationScanningReceivers(self, organizationId: str, total_pages=1, direction='next', **kwargs): + """ + **Return scanning API receivers** + https://developer.cisco.com/meraki/api-v1/#!get-organization-wireless-location-scanning-receivers + + - 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 - 250. 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 scanning API receivers by network ID. + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'configure', 'location', 'scanning', 'receivers'], + 'operation': 'getOrganizationWirelessLocationScanningReceivers' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/wireless/location/scanning/receivers' + + 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 createOrganizationWirelessLocationScanningReceiver(self, organizationId: str, network: dict, url: str, version: str, radio: dict, sharedSecret: str): + """ + **Add new receiver for scanning API** + https://developer.cisco.com/meraki/api-v1/#!create-organization-wireless-location-scanning-receiver + + - organizationId (string): Organization ID + - network (object): Add scanning API receiver for network + - url (string): Receiver Url + - version (string): Scanning API Version + - radio (object): Add scanning API Radio + - sharedSecret (string): Secret Value for Receiver + """ + + kwargs = locals() + + metadata = { + 'tags': ['wireless', 'configure', 'location', 'scanning', 'receivers'], + 'operation': 'createOrganizationWirelessLocationScanningReceiver' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + resource = f'/organizations/{organizationId}/wireless/location/scanning/receivers' + + body_params = ['network', 'url', 'version', 'radio', 'sharedSecret', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.post(metadata, resource, payload) + + + + def updateOrganizationWirelessLocationScanningReceiver(self, organizationId: str, receiverId: str, **kwargs): + """ + **Change scanning API receiver settings** + https://developer.cisco.com/meraki/api-v1/#!update-organization-wireless-location-scanning-receiver + + - organizationId (string): Organization ID + - receiverId (string): Receiver ID + - url (string): Receiver Url + - version (string): Scanning API Version + - radio (object): Add scanning API Radio + """ + + kwargs.update(locals()) + + metadata = { + 'tags': ['wireless', 'configure', 'location', 'scanning', 'receivers'], + 'operation': 'updateOrganizationWirelessLocationScanningReceiver' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + receiverId = urllib.parse.quote(str(receiverId), safe='') + resource = f'/organizations/{organizationId}/wireless/location/scanning/receivers/{receiverId}' + + body_params = ['url', 'version', 'radio', ] + payload = {k.strip(): v for k, v in kwargs.items() if k.strip() in body_params} + + return self._session.put(metadata, resource, payload) + + + + def deleteOrganizationWirelessLocationScanningReceiver(self, organizationId: str, receiverId: str): + """ + **Delete a scanning API receiver** + https://developer.cisco.com/meraki/api-v1/#!delete-organization-wireless-location-scanning-receiver + + - organizationId (string): Organization ID + - receiverId (string): Receiver ID + """ + + metadata = { + 'tags': ['wireless', 'configure', 'location', 'scanning', 'receivers'], + 'operation': 'deleteOrganizationWirelessLocationScanningReceiver' + } + organizationId = urllib.parse.quote(str(organizationId), safe='') + receiverId = urllib.parse.quote(str(receiverId), safe='') + resource = f'/organizations/{organizationId}/wireless/location/scanning/receivers/{receiverId}' + + return self._session.delete(metadata, resource) + + + def recalculateOrganizationWirelessRadioAutoRfChannels(self, organizationId: str, networkIds: list): """ **Recalculates automatically assigned channels for every AP within specified the specified network(s)** @@ -3064,7 +3380,7 @@ def getOrganizationWirelessRfProfilesAssignmentsByDevice(self, organizationId: s - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - networkIds (array): Optional parameter to filter devices by network. - - productTypes (array): Optional parameter to filter devices by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, wirelessController, and secureConnect. + - productTypes (array): Optional parameter to filter devices by product type. Valid types are wireless, appliance, switch, systemsManager, camera, cellularGateway, sensor, wirelessController, campusGateway, and secureConnect. - name (string): Optional parameter to filter RF profiles by device name. All returned devices will have a name that contains the search term or is an exact match. - mac (string): Optional parameter to filter RF profiles by device MAC address. All returned devices will have a MAC address that contains the search term or is an exact match. - serial (string): Optional parameter to filter RF profiles by device serial number. All returned devices will have a serial number that contains the search term or is an exact match. diff --git a/meraki/exception_handler.py b/meraki/exception_handler.py deleted file mode 100644 index e69de29b..00000000 diff --git a/poetry.lock b/poetry.lock index 5a8e97fb..8e86d62a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.1.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.1.3 and should not be changed by hand. [[package]] name = "aiohappyeyeballs" @@ -138,7 +138,7 @@ description = "Timeout context manager for asyncio programs" optional = false python-versions = ">=3.8" groups = ["main"] -markers = "python_version < \"3.11\"" +markers = "python_version == \"3.10\"" files = [ {file = "async_timeout-5.0.1-py3-none-any.whl", hash = "sha256:39e3809566ff85354557ec2398b55e096c8364bacac9405a7a1fa429e77fe76c"}, {file = "async_timeout-5.0.1.tar.gz", hash = "sha256:d9321a7a3d5a6a5e187e824d2fa0793ce379a202935782d555d6e9d2735677d3"}, @@ -298,7 +298,7 @@ description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" groups = ["main"] -markers = "python_version < \"3.11\"" +markers = "python_version == \"3.10\"" files = [ {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"}, @@ -839,7 +839,7 @@ description = "A lil' TOML parser" optional = false python-versions = ">=3.8" groups = ["main"] -markers = "python_version < \"3.11\"" +markers = "python_version == \"3.10\"" files = [ {file = "tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249"}, {file = "tomli-2.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6"}, @@ -882,7 +882,7 @@ description = "Backported and Experimental Type Hints for Python 3.8+" optional = false python-versions = ">=3.8" groups = ["main"] -markers = "python_version < \"3.11\"" +markers = "python_version == \"3.10\"" files = [ {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, diff --git a/pyproject.toml b/pyproject.toml index d723bb8a..aef9c290 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "meraki" -version = "2.0.2" +version = "2.0.3" description = "Meraki library for Python" authors = [ {name = "Cisco Meraki",email = "api-feedback@meraki.net"}